Fix #1162 problem with the queued torrents dialog from not properly adding to the add torrent dialog if set to auto add
This commit is contained in:
parent
cfeae2baf4
commit
e5c734fb05
|
@ -148,7 +148,7 @@ class AddTorrentDialog(component.Component):
|
||||||
self.update_core_config()
|
self.update_core_config()
|
||||||
|
|
||||||
def show(self, focus=False):
|
def show(self, focus=False):
|
||||||
self.update_core_config(True, focus)
|
return self.update_core_config(True, focus)
|
||||||
|
|
||||||
def _show(self, focus=False):
|
def _show(self, focus=False):
|
||||||
if client.is_localhost():
|
if client.is_localhost():
|
||||||
|
@ -184,7 +184,7 @@ class AddTorrentDialog(component.Component):
|
||||||
self._show(focus)
|
self._show(focus)
|
||||||
|
|
||||||
# Send requests to the core for these config values
|
# Send requests to the core for these config values
|
||||||
client.core.get_config_values(self.core_keys).addCallback(_on_config_values)
|
return client.core.get_config_values(self.core_keys).addCallback(_on_config_values)
|
||||||
|
|
||||||
def add_from_files(self, filenames):
|
def add_from_files(self, filenames):
|
||||||
import os.path
|
import os.path
|
||||||
|
|
|
@ -49,7 +49,7 @@ import common
|
||||||
|
|
||||||
class QueuedTorrents(component.Component):
|
class QueuedTorrents(component.Component):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
component.Component.__init__(self, "QueuedTorrents", depend=["StatusBar"])
|
component.Component.__init__(self, "QueuedTorrents", depend=["StatusBar", "AddTorrentDialog"])
|
||||||
self.queue = []
|
self.queue = []
|
||||||
self.status_item = None
|
self.status_item = None
|
||||||
|
|
||||||
|
@ -174,20 +174,27 @@ class QueuedTorrents(component.Component):
|
||||||
torrent_path = model.get_value(iter, 1)
|
torrent_path = model.get_value(iter, 1)
|
||||||
if deluge.common.is_url(torrent_path):
|
if deluge.common.is_url(torrent_path):
|
||||||
if self.config["interactive_add"]:
|
if self.config["interactive_add"]:
|
||||||
component.get("AddTorrentDialog").add_from_url(torrent_path)
|
def on_show(result):
|
||||||
component.get("AddTorrentDialog").show(self.config["focus_add_dialog"])
|
component.get("AddTorrentDialog").add_from_url(torrent_path)
|
||||||
|
|
||||||
|
d = component.get("AddTorrentDialog").show(self.config["focus_add_dialog"])
|
||||||
|
d.addCallback(on_show)
|
||||||
else:
|
else:
|
||||||
client.core.add_torrent_url(torrent_path, None)
|
client.core.add_torrent_url(torrent_path, None)
|
||||||
elif deluge.common.is_magnet(torrent_path):
|
elif deluge.common.is_magnet(torrent_path):
|
||||||
if self.config["interactive_add"]:
|
if self.config["interactive_add"]:
|
||||||
component.get("AddTorrentDialog").add_from_magnets([torrent_path])
|
def on_show(result):
|
||||||
component.get("AddTorrentDialog").show(self.config["focus_add_dialog"])
|
component.get("AddTorrentDialog").add_from_magnets([torrent_path])
|
||||||
|
d = component.get("AddTorrentDialog").show(self.config["focus_add_dialog"])
|
||||||
|
d.addCallback(on_show)
|
||||||
else:
|
else:
|
||||||
client.core.add_magnet_uris([torrent_path], [])
|
client.core.add_magnet_uris([torrent_path], [])
|
||||||
else:
|
else:
|
||||||
if self.config["interactive_add"]:
|
if self.config["interactive_add"]:
|
||||||
component.get("AddTorrentDialog").add_from_files([torrent_path])
|
def on_show(result):
|
||||||
component.get("AddTorrentDialog").show(self.config["focus_add_dialog"])
|
component.get("AddTorrentDialog").add_from_files([torrent_path])
|
||||||
|
d = component.get("AddTorrentDialog").show(self.config["focus_add_dialog"])
|
||||||
|
d.addCallback(on_show)
|
||||||
else:
|
else:
|
||||||
client.core.add_torrent_file(
|
client.core.add_torrent_file(
|
||||||
os.path.split(torrent_path)[-1],
|
os.path.split(torrent_path)[-1],
|
||||||
|
|
Loading…
Reference in New Issue