Ticket #892: deluge-delete.patch
File deluge-delete.patch, 1.2 KB (added by , 15 years ago) |
---|
-
torrentview.py
old new 49 49 from deluge.ui.client import aclient as client 50 50 from deluge.log import LOG as log 51 51 import deluge.ui.gtkui.listview as listview 52 from removetorrentdialog import RemoveTorrentDialog 52 53 53 54 # Status icons.. Create them from file only once to avoid constantly 54 55 # re-creating them. … … 204 205 self.on_selection_changed) 205 206 206 207 self.treeview.connect("drag-drop", self.on_drag_drop) 208 self.treeview.connect("key_press_event", self.on_key_press_event); 207 209 208 210 def start(self): 209 211 """Start the torrentview""" … … 435 437 436 438 def on_drag_drop(self, widget, drag_context, x, y, timestamp): 437 439 widget.stop_emission("drag-drop") 440 441 # Handle keyboard shortcuts 442 def on_key_press_event(self, widget, event): 443 keyname = gtk.gdk.keyval_name(event.keyval) 444 func = getattr(self, 'keypress_' + keyname, None) 445 if func: 446 return func() 447 448 def keypress_Delete(self): 449 log.debug("keypress_Delete") 450 if self.get_selected_torrents(): 451 RemoveTorrentDialog(self.get_selected_torrents()).run()