comparison src/browser/sat_browser/contact_group.py @ 589:a5019e62c3e9 frontends_multi_profiles

browser side: big refactoring to base Libervia on QuickFrontend, first draft: /!\ not finished, partially working and highly instable - add collections module with an OrderedDict like class - SatWebFrontend inherit from QuickApp - general sat_frontends tools.jid module is used - bridge/json methods have moved to json module - UniBox is partially removed (should be totally removed before merge to trunk) - Signals are now register with the generic registerSignal method (which is called mainly in QuickFrontend) - the generic getOrCreateWidget method from QuickWidgetsManager is used instead of Libervia's specific methods - all Widget are now based more or less directly on QuickWidget - with the new QuickWidgetsManager.getWidgets method, it's no more necessary to check all widgets which are instance of a particular class - ChatPanel and related moved to chat module - MicroblogPanel and related moved to blog module - global and overcomplicated send method has been disabled: each class should manage its own sending - for consistency with other frontends, former ContactPanel has been renamed to ContactList and vice versa - for the same reason, ChatPanel has been renamed to Chat - for compatibility with QuickFrontend, a fake profile is used in several places, it is set to C.PROF_KEY_NONE (real profile is managed server side for obvious security reasons) - changed default url for web panel to SàT website, and contact address to generic SàT contact address - ContactList is based on QuickContactList, UI changes are done in update method - bride call (now json module) have been greatly improved, in particular call can be done in the same way as for other frontends (bridge.method_name(arg1, arg2, ..., callback=cb, errback=eb). Blocking method must be called like async methods due to javascript architecture - in bridge calls, a callback can now exists without errback - hard reload on BridgeSignals remote error has been disabled, a better option should be implemented - use of constants where that make sens, some style improvments - avatars are temporarily disabled - lot of code disabled, will be fixed or removed before merge - various other changes, check diff for more details server side: manage remote exception on getEntityData, removed getProfileJid call, added getWaitingConf, added getRoomsSubjects
author Goffi <goffi@goffi.org>
date Sat, 24 Jan 2015 01:45:39 +0100
parents 50b286866739
children 32dbbc941123
comparison
equal deleted inserted replaced
585:bade589dbd5a 589:a5019e62c3e9
26 from pyjamas.ui.DialogBox import DialogBox 26 from pyjamas.ui.DialogBox import DialogBox
27 from pyjamas.ui import HasAlignment 27 from pyjamas.ui import HasAlignment
28 28
29 import dialog 29 import dialog
30 import list_manager 30 import list_manager
31 import contact 31 import contact_list
32 32
33 33
34 class ContactGroupManager(list_manager.ListManager): 34 class ContactGroupManager(list_manager.ListManager):
35 """A manager for sub-panels to assign contacts to each group.""" 35 """A manager for sub-panels to assign contacts to each group."""
36 36
37 def __init__(self, parent, keys_dict, contact_list, offsets, style): 37 def __init__(self, parent, keys_dict, contacts, offsets, style):
38 list_manager.ListManager.__init__(self, parent, keys_dict, contact_list, offsets, style) 38 list_manager.ListManager.__init__(self, parent, keys_dict, contacts, offsets, style)
39 self.registerPopupMenuPanel(entries={"Remove group": {}}, 39 self.registerPopupMenuPanel(entries={"Remove group": {}},
40 callback=lambda sender, key: Timer(5, lambda timer: self.removeContactKey(sender, key))) 40 callback=lambda sender, key: Timer(5, lambda timer: self.removeContactKey(sender, key)))
41 41
42 def removeContactKey(self, sender, key): 42 def removeContactKey(self, sender, key):
43 key = sender.getText() 43 key = sender.getText()
151 151
152 def getContactList(self): 152 def getContactList(self):
153 """Add the contact list to the DockPanel""" 153 """Add the contact list to the DockPanel"""
154 self.toggle = Button("", self.toggleContacts) 154 self.toggle = Button("", self.toggleContacts)
155 self.toggle.addStyleName("toggleAssignedContacts") 155 self.toggle.addStyleName("toggleAssignedContacts")
156 self.contacts = contact.GenericContactList(self.host) 156 self.contacts = contact_list.BaseContactPanel(self.host)
157 for contact_ in self.all_contacts: 157 for contact_ in self.all_contacts:
158 self.contacts.add(contact_) 158 self.contacts.add(contact_)
159 contact_panel = VerticalPanel() 159 contact_panel = VerticalPanel()
160 contact_panel.add(self.toggle) 160 contact_panel.add(self.toggle)
161 contact_panel.add(self.contacts) 161 contact_panel.add(self.contacts)