wix: fixed profile manager

This commit is contained in:
Goffi 2012-11-24 02:21:02 +01:00
commit 2555fdf014

View file

@ -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()