Mercurial > libervia-backend
changeset 552:6970ab58b020
wix: fixed profile manager
author | Goffi <goffi@goffi.org> |
---|---|
date | Sat, 24 Nov 2012 02:21:02 +0100 |
parents | dcec4ba8e72c |
children | 2b3e3349f6a4 |
files | frontends/src/wix/profile_manager.py |
diffstat | 1 files changed, 8 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- 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()