# HG changeset patch # User Goffi # Date 1322956700 -3600 # Node ID 485a6d125498bc248195bd8b02ffb6061d5fef79 # Parent 39a8ca1a2675eca4d4a6aa76b379d44686f43b9a Wix: fixed asynchronous call to get profile's data in profile manager diff -r 39a8ca1a2675 -r 485a6d125498 frontends/src/wix/profile_manager.py --- a/frontends/src/wix/profile_manager.py Sun Dec 04 00:05:41 2011 +0100 +++ b/frontends/src/wix/profile_manager.py Sun Dec 04 00:58:20 2011 +0100 @@ -118,10 +118,12 @@ def onProfileChange(self, event): """Called when a profile is choosen in the combo box""" - jabberID = self.host.bridge.getParamA("JabberID", "Connection", profile_key=self.profile_name.GetValue()) - password = self.host.bridge.getParamA("Password", "Connection", profile_key=self.profile_name.GetValue()) - self.login_jid.SetValue(jabberID) - self.login_pass.SetValue(password) + def setJID(jabberID): + self.login_jid.SetValue(jabberID) + def setPassword(password): + self.login_pass.SetValue(password) + self.host.bridge.asyncGetParamA("JabberID", "Connection", profile_key=self.profile_name.GetValue(), callback=setJID, errback=self.getParamError) + self.host.bridge.asyncGetParamA("Password", "Connection", profile_key=self.profile_name.GetValue(), callback=setPassword, errback=self.getParamError) def onConnectButton(self, event): """Called when the Connect button is pressed""" @@ -147,3 +149,5 @@ 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()