mirror of
https://git.deluge-torrent.org/deluge
synced 2025-08-03 06:58:42 +00:00
Add #891 remove torrents by pressing the Delete key
This commit is contained in:
parent
3f69b05ded
commit
ee76075fa4
2 changed files with 21 additions and 5 deletions
|
@ -25,6 +25,7 @@
|
|||
* Fix #782 do not ask for tray password when window is not minimized to tray
|
||||
* Fix #1036 autoconnecting to localhost daemon on start-up
|
||||
* Fix issue where hosts will show up erroneously as Offline
|
||||
* Add #891 remove torrents by pressing the Delete key
|
||||
|
||||
==== Console ====
|
||||
* Fix using the console in Windows, but only in command-line mode
|
||||
|
|
|
@ -49,6 +49,7 @@ from deluge.ui.client import client
|
|||
from deluge.log import LOG as log
|
||||
import listview
|
||||
from deluge.ui.tracker_icons import TrackerIcons
|
||||
from removetorrentdialog import RemoveTorrentDialog
|
||||
|
||||
# Status icons.. Create them from file only once to avoid constantly
|
||||
# re-creating them.
|
||||
|
@ -238,6 +239,7 @@ class TorrentView(listview.ListView, component.Component):
|
|||
self.on_selection_changed)
|
||||
|
||||
self.treeview.connect("drag-drop", self.on_drag_drop)
|
||||
self.treeview.connect("key_press_event", self.on_key_press_event)
|
||||
|
||||
client.register_event_handler("TorrentStateChangedEvent", self.on_torrentstatechanged_event)
|
||||
client.register_event_handler("TorrentAddedEvent", self.on_torrentadded_event)
|
||||
|
@ -526,3 +528,16 @@ class TorrentView(listview.ListView, component.Component):
|
|||
def on_torrentqueuechanged_event(self):
|
||||
self.mark_dirty()
|
||||
self.update()
|
||||
|
||||
# Handle keyboard shortcuts
|
||||
def on_key_press_event(self, widget, event):
|
||||
keyname = gtk.gdk.keyval_name(event.keyval)
|
||||
func = getattr(self, 'keypress_' + keyname, None)
|
||||
if func:
|
||||
return func()
|
||||
|
||||
def keypress_Delete(self):
|
||||
log.debug("keypress_Delete")
|
||||
torrents = self.get_selected_torrents()
|
||||
if torrents:
|
||||
RemoveTorrentDialog(torrents).run()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue