comparison frontends/src/wix/main_window.py @ 688:f7878ad3c846

tools: renamed tools.jid.JID attribute "short" to "bare"
author souliane <souliane@mailoo.org>
date Tue, 29 Oct 2013 16:26:55 +0100
parents 59c9a7ff903d
children 6246eb6d64a0
comparison
equal deleted inserted replaced
687:af0d08a84cc6 688:f7878ad3c846
337 337
338 ### events ### 338 ### events ###
339 339
340 def onContactActivated(self, jid): 340 def onContactActivated(self, jid):
341 debug (_("onContactActivated: %s"), jid) 341 debug (_("onContactActivated: %s"), jid)
342 if self.chat_wins[jid.short].IsShown(): 342 if self.chat_wins[jid.bare].IsShown():
343 self.chat_wins[jid.short].Hide() 343 self.chat_wins[jid.bare].Hide()
344 else: 344 else:
345 self.chat_wins[jid.short].Show() 345 self.chat_wins[jid.bare].Show()
346 346
347 def onConnectRequest(self, e): 347 def onConnectRequest(self, e):
348 self.bridge.connect(self.profile) 348 self.bridge.connect(self.profile)
349 349
350 def onDisconnectRequest(self, e): 350 def onDisconnectRequest(self, e):
392 _('Adding a contact'), _('name@server.tld')) 392 _('Adding a contact'), _('name@server.tld'))
393 393
394 if dlg.ShowModal() == wx.ID_OK: 394 if dlg.ShowModal() == wx.ID_OK:
395 jid=JID(dlg.GetValue()) 395 jid=JID(dlg.GetValue())
396 if jid.is_valid(): 396 if jid.is_valid():
397 self.bridge.addContact(jid.short, profile_key=self.profile) 397 self.bridge.addContact(jid.bare, profile_key=self.profile)
398 else: 398 else:
399 error (_("'%s' is an invalid JID !"), jid) 399 error (_("'%s' is an invalid JID !"), jid)
400 #TODO: notice the user 400 #TODO: notice the user
401 401
402 dlg.Destroy() 402 dlg.Destroy()
411 ) 411 )
412 dlg.ShowModal() 412 dlg.ShowModal()
413 dlg.Destroy() 413 dlg.Destroy()
414 return 414 return
415 415
416 dlg = wx.MessageDialog(self, _("Are you sure you want to delete %s from your roster list ?") % target.short, 416 dlg = wx.MessageDialog(self, _("Are you sure you want to delete %s from your roster list ?") % target.bare,
417 _('Contact suppression'), 417 _('Contact suppression'),
418 wx.YES_NO | wx.ICON_QUESTION 418 wx.YES_NO | wx.ICON_QUESTION
419 ) 419 )
420 420
421 if dlg.ShowModal() == wx.ID_YES: 421 if dlg.ShowModal() == wx.ID_YES:
422 info(_("Unsubscribing %s presence"), target.short) 422 info(_("Unsubscribing %s presence"), target.bare)
423 self.bridge.delContact(target.short, profile_key=self.profile) 423 self.bridge.delContact(target.bare, profile_key=self.profile)
424 424
425 dlg.Destroy() 425 dlg.Destroy()
426 426
427 def onShowProfile(self, e): 427 def onShowProfile(self, e):
428 debug(_("Show contact's profile request")) 428 debug(_("Show contact's profile request"))
433 wx.OK | wx.ICON_ERROR 433 wx.OK | wx.ICON_ERROR
434 ) 434 )
435 dlg.ShowModal() 435 dlg.ShowModal()
436 dlg.Destroy() 436 dlg.Destroy()
437 return 437 return
438 _id = self.bridge.getCard(target.short, profile_key=self.profile) 438 _id = self.bridge.getCard(target.bare, profile_key=self.profile)
439 self.current_action_ids.add(_id) 439 self.current_action_ids.add(_id)
440 self.current_action_ids_cb[_id] = self.onProfileReceived 440 self.current_action_ids_cb[_id] = self.onProfileReceived
441 441
442 def onProfileReceived(self, data): 442 def onProfileReceived(self, data):
443 """Called when a profile is received""" 443 """Called when a profile is received"""