Fix issue where core_config would become {} when adding multiple
torrents externally at once
This commit is contained in:
parent
930c479718
commit
b0e368c9ab
|
@ -132,8 +132,9 @@ 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()
|
self.update_core_config(True, focus)
|
||||||
|
|
||||||
|
def _show(self, focus=False):
|
||||||
if client.is_localhost():
|
if client.is_localhost():
|
||||||
self.glade.get_widget("button_location").show()
|
self.glade.get_widget("button_location").show()
|
||||||
self.glade.get_widget("entry_download_path").hide()
|
self.glade.get_widget("entry_download_path").hide()
|
||||||
|
@ -159,12 +160,12 @@ class AddTorrentDialog(component.Component):
|
||||||
self.dialog.set_transient_for(component.get("MainWindow").window)
|
self.dialog.set_transient_for(component.get("MainWindow").window)
|
||||||
return None
|
return None
|
||||||
|
|
||||||
def update_core_config(self):
|
def update_core_config(self, show=False, focus=False):
|
||||||
self.core_config = {}
|
|
||||||
|
|
||||||
def _on_config_values(config):
|
def _on_config_values(config):
|
||||||
self.core_config = config
|
self.core_config = config
|
||||||
self.set_default_options()
|
self.set_default_options()
|
||||||
|
if show:
|
||||||
|
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)
|
client.core.get_config_values(self.core_keys).addCallback(_on_config_values)
|
||||||
|
|
Loading…
Reference in New Issue