diff --git a/frontends/src/wix/profile_manager.py b/frontends/src/wix/profile_manager.py index f4299b82..dffd3a54 100644 --- a/frontends/src/wix/profile_manager.py +++ b/frontends/src/wix/profile_manager.py @@ -136,8 +136,13 @@ class ProfileManager(wx.Panel): 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 @@ class ProfileManager(wx.Panel): 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()