[#3250|Console] Fix unable to remove torrent

Trying to remove a torrent had no effect and resulted in the following
error: `'TorrentList' object has no attribute 'clear_marked'`

 * The clear_marked call needs to be made with torrentview instead.
 * Ensure the popup dialog is closed upon deleting the torrent.
This commit is contained in:
Calum Lind 2019-05-11 18:52:54 +01:00
parent 6ff7a5400f
commit 76b89a7943
1 changed files with 3 additions and 3 deletions

View File

@ -39,7 +39,7 @@ def action_remove(mode=None, torrent_ids=None, **kwargs):
mode.pop_popup() mode.pop_popup()
return True return True
mode.clear_marked() mode.torrentview.clear_marked()
remove_data = data['remove_files']['value'] remove_data = data['remove_files']['value']
def on_removed_finished(errors): def on_removed_finished(errors):
@ -54,6 +54,7 @@ def action_remove(mode=None, torrent_ids=None, **kwargs):
d = client.core.remove_torrents(torrent_ids, remove_data) d = client.core.remove_torrents(torrent_ids, remove_data)
d.addCallback(on_removed_finished) d.addCallback(on_removed_finished)
mode.pop_popup()
def got_status(status): def got_status(status):
return (status['name'], status['state']) return (status['name'], status['state'])
@ -191,10 +192,9 @@ def torrent_action(action, *args, **kwargs):
elif action == ACTION.QUEUE: elif action == ACTION.QUEUE:
queue_mode = QueueMode(mode, torrent_ids) queue_mode = QueueMode(mode, torrent_ids)
queue_mode.popup(**kwargs) queue_mode.popup(**kwargs)
return False
elif action == ACTION.REMOVE: elif action == ACTION.REMOVE:
action_remove(**kwargs) action_remove(**kwargs)
return False retval = True
elif action == ACTION.MOVE_STORAGE: elif action == ACTION.MOVE_STORAGE:
def do_move(res, **kwargs): def do_move(res, **kwargs):