comparison frontends/wix/profile_manager.py @ 89:23caf1051099

multi-profile/subscription misc fixes
author Goffi <goffi@goffi.org>
date Thu, 13 May 2010 16:27:48 +0930
parents f271fff3a713
children e5ca22113280
comparison
equal deleted inserted replaced
88:59f181e8433a 89:23caf1051099
131 return 131 return
132 if name[0]=='@': 132 if name[0]=='@':
133 wx.MessageDialog(self, _("A profile name can't start with a @"), _("Bad profile name"), wx.ICON_ERROR).ShowModal() 133 wx.MessageDialog(self, _("A profile name can't start with a @"), _("Bad profile name"), wx.ICON_ERROR).ShowModal()
134 return 134 return
135 profile = self.host.bridge.getProfileName(name) 135 profile = self.host.bridge.getProfileName(name)
136 if not profile: 136 assert(profile)
137 debug(_("The profile is new, we create it"))
138 old_jid = self.host.bridge.getParamA("JabberID", "Connection", profile_key=profile) 137 old_jid = self.host.bridge.getParamA("JabberID", "Connection", profile_key=profile)
139 old_pass = self.host.bridge.getParamA("Password", "Connection", profile_key=profile) 138 old_pass = self.host.bridge.getParamA("Password", "Connection", profile_key=profile)
140 new_jid = self.login_jid.GetValue() 139 new_jid = self.login_jid.GetValue()
141 new_pass = self.login_pass.GetValue() 140 new_pass = self.login_pass.GetValue()
141 print "old: %s, new: %s, old_pass: %s, new_pass: %s" % (old_jid, new_jid, old_pass, new_pass)
142 if old_jid != new_jid: 142 if old_jid != new_jid:
143 debug(_('Saving new JID and server')) 143 debug(_('Saving new JID and server'))
144 self.host.bridge.setParam("JabberID", new_jid, "Connection", profile) 144 self.host.bridge.setParam("JabberID", new_jid, "Connection", profile)
145 self.host.bridge.setParam("Server", JID(new_jid).domain, "Connection", profile) 145 self.host.bridge.setParam("Server", JID(new_jid).domain, "Connection", profile)
146 if old_pass != new_pass: 146 if old_pass != new_pass:
147 debug(_('Saving new password')) 147 debug(_('Saving new password'))
148 self.host.bridge.setParam("Password", new_pass, "Connection", profile) 148 self.host.bridge.setParam("Password", new_pass, "Connection", profile)
149 self.host.plug_profile(name) 149 self.host.plug_profile(profile)
150 150