comparison frontends/src/quick_frontend/quick_app.py @ 1034:5197600a1e13

quick_app, primitivus: update the connection mechanism to ask for non empty profile passwords
author souliane <souliane@mailoo.org>
date Wed, 07 May 2014 16:11:32 +0200
parents 6a16ec17a458
children 066308706dc6
comparison
equal deleted inserted replaced
1033:d87aa6bdb0b4 1034:5197600a1e13
134 return 134 return
135 self.profiles[profile] = {} 135 self.profiles[profile] = {}
136 if self.single_profile: 136 if self.single_profile:
137 self.profile = profile 137 self.profile = profile
138 138
139 self.launchAction(C.AUTHENTICATE_PROFILE_ID, {'caller': 'plug_profile'}, profile_key=profile)
140
141 def plug_profile_1(self, profile):
139 ###now we get the essential params### 142 ###now we get the essential params###
140 self.bridge.asyncGetParamA("JabberID", "Connection", profile_key=profile, 143 self.bridge.asyncGetParamA("JabberID", "Connection", profile_key=profile,
141 callback=lambda _jid: self.plug_profile_2(_jid, profile), errback=self._getParamError) 144 callback=lambda _jid: self.plug_profile_2(_jid, profile), errback=self._getParamError)
142 145
143 def plug_profile_2(self, _jid, profile): 146 def plug_profile_2(self, _jid, profile):
150 callback=lambda watched: self.plug_profile_4(watched, autoconnect, profile), errback=self._getParamError) 153 callback=lambda watched: self.plug_profile_4(watched, autoconnect, profile), errback=self._getParamError)
151 154
152 def plug_profile_4(self, watched, autoconnect, profile): 155 def plug_profile_4(self, watched, autoconnect, profile):
153 if autoconnect and not self.bridge.isConnected(profile): 156 if autoconnect and not self.bridge.isConnected(profile):
154 #Does the user want autoconnection ? 157 #Does the user want autoconnection ?
155 self.bridge.asyncConnect(profile, callback=lambda: self.plug_profile_5(watched, autoconnect, profile), errback=lambda ignore: log.error(_('Error during autoconnection'))) 158 self.bridge.asyncConnect(profile, callback=lambda dummy: self.plug_profile_5(watched, autoconnect, profile), errback=lambda ignore: log.error(_('Error during autoconnection')))
156 else: 159 else:
157 self.plug_profile_5(watched, autoconnect, profile) 160 self.plug_profile_5(watched, autoconnect, profile)
158 161
159 def plug_profile_5(self, watched, autoconnect, profile): 162 def plug_profile_5(self, watched, autoconnect, profile):
160 self.profiles[profile]['watched'] = watched.split() # TODO: put this in a plugin 163 self.profiles[profile]['watched'] = watched.split() # TODO: put this in a plugin