comparison frontends/src/quick_frontend/quick_app.py @ 1074:a47995155e55

frontends (quick_frontend): fixes the handling of asyncConnect failure
author souliane <souliane@mailoo.org>
date Sun, 15 Jun 2014 16:09:30 +0200
parents 6ec513ad92c2
children 11e2bb20e896
comparison
equal deleted inserted replaced
1073:f094583732de 1074:a47995155e55
155 if not callback: 155 if not callback:
156 callback = lambda dummy: None 156 callback = lambda dummy: None
157 if not errback: 157 if not errback:
158 def errback(failure): 158 def errback(failure):
159 log.error(_(u"Can't connect profile [%s]") % failure) 159 log.error(_(u"Can't connect profile [%s]") % failure)
160 self.launchAction(C.CHANGE_XMPP_PASSWD_ID, {}, profile_key=profile) 160 if failure.module.startswith('twisted.words.protocols.jabber') and failure.condition == "not-authorized":
161 self.launchAction(C.CHANGE_XMPP_PASSWD_ID, {}, profile_key=profile)
162 else:
163 self.showDialog(failure.message, failure.fullname, 'error')
161 self.bridge.asyncConnect(profile, callback=callback, errback=errback) 164 self.bridge.asyncConnect(profile, callback=callback, errback=errback)
162 165
163 def plug_profile_4(self, watched, autoconnect, profile): 166 def plug_profile_4(self, watched, autoconnect, profile):
164 if autoconnect and not self.bridge.isConnected(profile): 167 if autoconnect and not self.bridge.isConnected(profile):
165 #Does the user want autoconnection ? 168 #Does the user want autoconnection ?