Module: deluge
Branch: master
Commit: e5c734fb0537b6280348c3a5a9ad3af04c27e842

Author: Andrew Resch <[email protected]>
Date:   Sun Feb 28 16:58:19 2010 -0800

Fix #1162 problem with the queued torrents dialog from not properly adding to 
the add torrent dialog if set to auto add

---

 deluge/ui/gtkui/addtorrentdialog.py |    4 ++--
 deluge/ui/gtkui/queuedtorrents.py   |   21 ++++++++++++++-------
 2 files changed, 16 insertions(+), 9 deletions(-)

diff --git a/deluge/ui/gtkui/addtorrentdialog.py 
b/deluge/ui/gtkui/addtorrentdialog.py
index 8753970..44980c4 100644
--- a/deluge/ui/gtkui/addtorrentdialog.py
+++ b/deluge/ui/gtkui/addtorrentdialog.py
@@ -148,7 +148,7 @@ class AddTorrentDialog(component.Component):
         self.update_core_config()
 
     def show(self, focus=False):
-        self.update_core_config(True, focus)
+        return self.update_core_config(True, focus)
 
     def _show(self, focus=False):
         if client.is_localhost():
@@ -184,7 +184,7 @@ class AddTorrentDialog(component.Component):
                 self._show(focus)
 
         # 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):
         import os.path
diff --git a/deluge/ui/gtkui/queuedtorrents.py 
b/deluge/ui/gtkui/queuedtorrents.py
index 77e0dac..fa18a1f 100644
--- a/deluge/ui/gtkui/queuedtorrents.py
+++ b/deluge/ui/gtkui/queuedtorrents.py
@@ -49,7 +49,7 @@ import common
 
 class QueuedTorrents(component.Component):
     def __init__(self):
-        component.Component.__init__(self, "QueuedTorrents", 
depend=["StatusBar"])
+        component.Component.__init__(self, "QueuedTorrents", 
depend=["StatusBar", "AddTorrentDialog"])
         self.queue = []
         self.status_item = None
 
@@ -174,20 +174,27 @@ class QueuedTorrents(component.Component):
             torrent_path = model.get_value(iter, 1)
             if deluge.common.is_url(torrent_path):
                 if self.config["interactive_add"]:
-                    
component.get("AddTorrentDialog").add_from_url(torrent_path)
-                    
component.get("AddTorrentDialog").show(self.config["focus_add_dialog"])
+                    def on_show(result):
+                        
component.get("AddTorrentDialog").add_from_url(torrent_path)
+                        
+                    d = 
component.get("AddTorrentDialog").show(self.config["focus_add_dialog"])
+                    d.addCallback(on_show)
                 else:
                     client.core.add_torrent_url(torrent_path, None)
             elif deluge.common.is_magnet(torrent_path):
                 if self.config["interactive_add"]:
-                    
component.get("AddTorrentDialog").add_from_magnets([torrent_path])
-                    
component.get("AddTorrentDialog").show(self.config["focus_add_dialog"])
+                    def on_show(result):
+                        
component.get("AddTorrentDialog").add_from_magnets([torrent_path])
+                    d = 
component.get("AddTorrentDialog").show(self.config["focus_add_dialog"])
+                    d.addCallback(on_show)
                 else:
                     client.core.add_magnet_uris([torrent_path], [])
             else:
                 if self.config["interactive_add"]:
-                    
component.get("AddTorrentDialog").add_from_files([torrent_path])
-                    
component.get("AddTorrentDialog").show(self.config["focus_add_dialog"])
+                    def on_show(result):
+                        
component.get("AddTorrentDialog").add_from_files([torrent_path])
+                    d = 
component.get("AddTorrentDialog").show(self.config["focus_add_dialog"])
+                    d.addCallback(on_show)
                 else:
                     client.core.add_torrent_file(
                         os.path.split(torrent_path)[-1],

-- 
You received this message because you are subscribed to the Google Groups 
"deluge-commit" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/deluge-commit?hl=en.

Reply via email to