Mercurial > libervia-backend
comparison 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 |
comparison
equal
deleted
inserted
replaced
560:7ffae708b176 | 561:97f6a445d6e8 |
---|---|
147 callback=lambda watched: self.plug_profile_4(watched, autoconnect, profile), errback=self._getParamError) | 147 callback=lambda watched: self.plug_profile_4(watched, autoconnect, profile), errback=self._getParamError) |
148 | 148 |
149 def plug_profile_4(self, watched, autoconnect, profile): | 149 def plug_profile_4(self, watched, autoconnect, profile): |
150 if autoconnect and not self.bridge.isConnected(profile): | 150 if autoconnect and not self.bridge.isConnected(profile): |
151 #Does the user want autoconnection ? | 151 #Does the user want autoconnection ? |
152 self.bridge.connect(profile) | 152 self.bridge.asyncConnect(profile, callback=lambda: self.plug_profile_5(watched, autoconnect, profile), errback=lambda ignore: error(_('Error during autoconnection'))) |
153 | 153 else: |
154 self.plug_profile_5(watched, autoconnect, profile) | |
155 | |
156 def plug_profile_5(self, watched, autoconnect, profile): | |
154 self.profiles[profile]['watched'] = watched.split() #TODO: put this in a plugin | 157 self.profiles[profile]['watched'] = watched.split() #TODO: put this in a plugin |
155 | 158 |
156 ## misc ## | 159 ## misc ## |
157 self.profiles[profile]['onlineContact'] = set() #FIXME: temporary | 160 self.profiles[profile]['onlineContact'] = set() #FIXME: temporary |
158 | 161 |