Make torrent_actions_popup capable of directly displaying/executing one of the torrent actions without displaying choice dialog

This commit is contained in:
Asmageddon 2012-03-19 19:33:11 +01:00
parent e68358661a
commit acb77213e1
1 changed files with 4 additions and 1 deletions

View File

@ -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)