From b0e368c9ab2b52750b3888f2a07dda5efcd14c80 Mon Sep 17 00:00:00 2001 From: Andrew Resch Date: Mon, 16 Mar 2009 00:29:49 +0000 Subject: [PATCH] Fix issue where core_config would become {} when adding multiple torrents externally at once --- deluge/ui/gtkui/addtorrentdialog.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/deluge/ui/gtkui/addtorrentdialog.py b/deluge/ui/gtkui/addtorrentdialog.py index b25b573d8..fbf4907a7 100644 --- a/deluge/ui/gtkui/addtorrentdialog.py +++ b/deluge/ui/gtkui/addtorrentdialog.py @@ -132,8 +132,9 @@ class AddTorrentDialog(component.Component): self.update_core_config() def show(self, focus=False): - self.update_core_config() + self.update_core_config(True, focus) + def _show(self, focus=False): if client.is_localhost(): self.glade.get_widget("button_location").show() 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) return None - def update_core_config(self): - self.core_config = {} - + def update_core_config(self, show=False, focus=False): def _on_config_values(config): self.core_config = config self.set_default_options() + if show: + self._show(focus) # Send requests to the core for these config values client.core.get_config_values(self.core_keys).addCallback(_on_config_values)