# HG changeset patch # User Goffi # Date 1353720062 -3600 # Node ID 6970ab58b0209fed71d94206a3f4d134de86d4d6 # Parent dcec4ba8e72cf98c5b808a67595383d04ea70fc4 wix: fixed profile manager diff -r dcec4ba8e72c -r 6970ab58b020 frontends/src/wix/profile_manager.py --- a/frontends/src/wix/profile_manager.py Thu Nov 22 00:46:49 2012 +0100 +++ b/frontends/src/wix/profile_manager.py Sat Nov 24 02:21:02 2012 +0100 @@ -136,8 +136,13 @@ return profile = self.host.bridge.getProfileName(name) assert(profile) - old_jid = self.host.bridge.getParamA("JabberID", "Connection", profile_key=profile) - old_pass = self.host.bridge.getParamA("Password", "Connection", profile_key=profile) + + self.host.bridge.asyncGetParamA("JabberID", "Connection", profile_key=profile, callback=lambda old_jid: self.__old_jidReceived(old_jid, profile), errback=self.getParamError) + + def __old_jidReceived(self, old_jid, profile): + self.host.bridge.asyncGetParamA("Password", "Connection", profile_key=profile, callback=lambda old_pass: self.__old_passReceived(old_jid, old_pass, profile), errback=self.getParamError) + + def __old_passReceived(self, old_jid, old_pass, profile): new_jid = self.login_jid.GetValue() new_pass = self.login_pass.GetValue() if old_jid != new_jid: @@ -149,5 +154,6 @@ self.host.bridge.setParam("Password", new_pass, "Connection", profile) self.host.plug_profile(profile) + def getParamError(self, ignore): wx.MessageDialog(self, _("Can't get profile parameter"), _("Profile error"), wx.ICON_ERROR).ShowModal()