Mercurial > libervia-backend
comparison frontends/src/wix/main_window.py @ 501:e9634d2e7b38
core, quick_frontend, primitivus, wix: Contacts List refactoring phase 1:
- QuickContactManagement is not used anymore and will be removed, ContactList + Core are used instead
- disconnected contacts are now displayed in Primitivus (M-d to show/hide them)
- avatars are temporary unavailable in wix
- new bridge method: getContactsFromGroup
author | Goffi <goffi@goffi.org> |
---|---|
date | Tue, 25 Sep 2012 00:58:34 +0200 |
parents | 1e4731f1e1d7 |
children | 886754295efe |
comparison
equal
deleted
inserted
replaced
500:00d3679976ab | 501:e9634d2e7b38 |
---|---|
62 """main app window""" | 62 """main app window""" |
63 | 63 |
64 def __init__(self): | 64 def __init__(self): |
65 QuickApp.__init__(self) | 65 QuickApp.__init__(self) |
66 wx.Frame.__init__(self,None, title="SàT Wix", size=(300,500)) | 66 wx.Frame.__init__(self,None, title="SàT Wix", size=(300,500)) |
67 self.CM = QuickContactManagement() #FIXME: not the best place | |
68 | 67 |
69 #sizer | 68 #sizer |
70 self.sizer = wx.BoxSizer(wx.VERTICAL) | 69 self.sizer = wx.BoxSizer(wx.VERTICAL) |
71 self.SetSizer(self.sizer) | 70 self.SetSizer(self.sizer) |
72 | 71 |
73 #Frame elements | 72 #Frame elements |
74 self.contactList = ContactList(self, self) | 73 self.contact_list = ContactList(self, self) |
75 self.contactList.registerActivatedCB(self.onContactActivated) | 74 self.contact_list.registerActivatedCB(self.onContactActivated) |
76 self.contactList.Hide() | 75 self.contact_list.Hide() |
77 self.sizer.Add(self.contactList, 1, flag=wx.EXPAND) | 76 self.sizer.Add(self.contact_list, 1, flag=wx.EXPAND) |
78 | 77 |
79 self.chat_wins=ChatList(self) | 78 self.chat_wins=ChatList(self) |
80 self.CreateStatusBar() | 79 self.CreateStatusBar() |
81 | 80 |
82 #ToolBar | 81 #ToolBar |
118 | 117 |
119 def plug_profile(self, profile_key='@DEFAULT@'): | 118 def plug_profile(self, profile_key='@DEFAULT@'): |
120 """Hide profile panel then plug profile""" | 119 """Hide profile panel then plug profile""" |
121 debug (_('plugin profile %s' % profile_key)) | 120 debug (_('plugin profile %s' % profile_key)) |
122 self.profile_pan.Hide() | 121 self.profile_pan.Hide() |
123 self.contactList.Show() | 122 self.contact_list.Show() |
124 self.sizer.Layout() | 123 self.sizer.Layout() |
125 for i in range(self.menuBar.GetMenuCount()): | 124 for i in range(self.menuBar.GetMenuCount()): |
126 self.menuBar.EnableTop(i, True) | 125 self.menuBar.EnableTop(i, True) |
127 super(MainWindow, self).plug_profile(profile_key) | 126 super(MainWindow, self).plug_profile(profile_key) |
128 | 127 |
408 | 407 |
409 dlg.Destroy() | 408 dlg.Destroy() |
410 | 409 |
411 def onRemoveContact(self, e): | 410 def onRemoveContact(self, e): |
412 debug(_("Remove contact request")) | 411 debug(_("Remove contact request")) |
413 target = self.contactList.getSelection() | 412 target = self.contact_list.getSelection() |
414 if not target: | 413 if not target: |
415 dlg = wx.MessageDialog(self, _("You haven't selected any contact !"), | 414 dlg = wx.MessageDialog(self, _("You haven't selected any contact !"), |
416 _('Error'), | 415 _('Error'), |
417 wx.OK | wx.ICON_ERROR | 416 wx.OK | wx.ICON_ERROR |
418 ) | 417 ) |
431 | 430 |
432 dlg.Destroy() | 431 dlg.Destroy() |
433 | 432 |
434 def onShowProfile(self, e): | 433 def onShowProfile(self, e): |
435 debug(_("Show contact's profile request")) | 434 debug(_("Show contact's profile request")) |
436 target = self.contactList.getSelection() | 435 target = self.contact_list.getSelection() |
437 if not target: | 436 if not target: |
438 dlg = wx.MessageDialog(self, _("You haven't selected any contact !"), | 437 dlg = wx.MessageDialog(self, _("You haven't selected any contact !"), |
439 _('Error'), | 438 _('Error'), |
440 wx.OK | wx.ICON_ERROR | 439 wx.OK | wx.ICON_ERROR |
441 ) | 440 ) |