From acb77213e16b234320360e891bb3599f8eda7be4 Mon Sep 17 00:00:00 2001 From: Asmageddon Date: Mon, 19 Mar 2012 19:33:11 +0100 Subject: [PATCH] Make torrent_actions_popup capable of directly displaying/executing one of the torrent actions without displaying choice dialog --- deluge/ui/console/modes/torrent_actions.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/deluge/ui/console/modes/torrent_actions.py b/deluge/ui/console/modes/torrent_actions.py index c9fc82aa1..6bd5b4ba9 100644 --- a/deluge/ui/console/modes/torrent_actions.py +++ b/deluge/ui/console/modes/torrent_actions.py @@ -201,7 +201,10 @@ def torrent_action(idx, data, mode, ids): return True # Creates the popup. mode is the calling mode, tids is a list of torrents to take action upon -def torrent_actions_popup(mode,tids,details=False): +def torrent_actions_popup(mode,tids,details=False, action = None): + if action != None: + torrent_action(-1, action, mode, tids) + return popup = SelectablePopup(mode,"Torrent Actions",torrent_action,mode,tids) popup.add_line("_Pause",data=ACTION.PAUSE) popup.add_line("_Resume",data=ACTION.RESUME)