diff frontends/src/quick_frontend/quick_app.py @ 561:97f6a445d6e8

quick frontend: asyncConnect is now used, to be sure that roster is available before continuing profile plugging
author Goffi <goffi@goffi.org>
date Wed, 19 Dec 2012 23:22:10 +0100
parents 3eeb6c865e4d
children ca13633d3b6b
line wrap: on
line diff
--- a/frontends/src/quick_frontend/quick_app.py	Tue Dec 18 00:02:28 2012 +0100
+++ b/frontends/src/quick_frontend/quick_app.py	Wed Dec 19 23:22:10 2012 +0100
@@ -149,8 +149,11 @@
     def plug_profile_4(self, watched, autoconnect, profile):
         if autoconnect and not self.bridge.isConnected(profile):
             #Does the user want autoconnection ?
-            self.bridge.connect(profile)
-
+            self.bridge.asyncConnect(profile, callback=lambda: self.plug_profile_5(watched, autoconnect, profile), errback=lambda ignore: error(_('Error during autoconnection')))
+        else:
+            self.plug_profile_5(watched, autoconnect, profile)
+    
+    def plug_profile_5(self, watched, autoconnect, profile):
         self.profiles[profile]['watched'] = watched.split() #TODO: put this in a plugin
 
         ## misc ##