Mercurial > libervia-backend
comparison frontends/src/quick_frontend/quick_app.py @ 2142:be96beb7ca14
core, bridge, frontends: renamed asyncConnect to connect, and added options parameters (not used yet)
author | Goffi <goffi@goffi.org> |
---|---|
date | Mon, 06 Feb 2017 22:54:43 +0100 |
parents | 4e67d6ffea66 |
children | 4b78b4c7f805 |
comparison
equal
deleted
inserted
replaced
2141:35762e9ce8b9 | 2142:be96beb7ca14 |
---|---|
88 callback=self._plug_profile_autoconnect, errback=self._getParamError) | 88 callback=self._plug_profile_autoconnect, errback=self._getParamError) |
89 | 89 |
90 def _plug_profile_autoconnect(self, value_str): | 90 def _plug_profile_autoconnect(self, value_str): |
91 autoconnect = C.bool(value_str) | 91 autoconnect = C.bool(value_str) |
92 if autoconnect and not self.connected: | 92 if autoconnect and not self.connected: |
93 self.host.asyncConnect(self.profile, callback=lambda dummy: self._plug_profile_afterconnect()) | 93 self.host.connect(self.profile, callback=lambda dummy: self._plug_profile_afterconnect()) |
94 else: | 94 else: |
95 self._plug_profile_afterconnect() | 95 self._plug_profile_afterconnect() |
96 | 96 |
97 def _plug_profile_afterconnect(self): | 97 def _plug_profile_afterconnect(self): |
98 # Profile can be connected or not | 98 # Profile can be connected or not |
438 | 438 |
439 self.callListeners('profilePlugged', profile=profile) | 439 self.callListeners('profilePlugged', profile=profile) |
440 if not self._plugs_in_progress: | 440 if not self._plugs_in_progress: |
441 self.contact_lists.lockUpdate(False) | 441 self.contact_lists.lockUpdate(False) |
442 | 442 |
443 def asyncConnect(self, profile, callback=None, errback=None): | 443 def connect(self, profile, callback=None, errback=None): |
444 if not callback: | 444 if not callback: |
445 callback = lambda dummy: None | 445 callback = lambda dummy: None |
446 if not errback: | 446 if not errback: |
447 def errback(failure): | 447 def errback(failure): |
448 log.error(_(u"Can't connect profile [%s]") % failure) | 448 log.error(_(u"Can't connect profile [%s]") % failure) |
460 fullname = 'error' | 460 fullname = 'error' |
461 if module.startswith('twisted.words.protocols.jabber') and failure.condition == "not-authorized": | 461 if module.startswith('twisted.words.protocols.jabber') and failure.condition == "not-authorized": |
462 self.launchAction(C.CHANGE_XMPP_PASSWD_ID, {}, profile=profile) | 462 self.launchAction(C.CHANGE_XMPP_PASSWD_ID, {}, profile=profile) |
463 else: | 463 else: |
464 self.showDialog(message, fullname, 'error') | 464 self.showDialog(message, fullname, 'error') |
465 self.bridge.asyncConnect(profile, callback=callback, errback=errback) | 465 self.bridge.connect(profile, callback=callback, errback=errback) |
466 | 466 |
467 def plug_profiles(self, profiles): | 467 def plug_profiles(self, profiles): |
468 """Tell application which profiles must be used | 468 """Tell application which profiles must be used |
469 | 469 |
470 @param profiles: list of valid profile names | 470 @param profiles: list of valid profile names |