comparison src/browser/sat_browser/contact_group.py @ 944:5d9f6d25c586

browser: various fixes this is a first pass to fix main Libervia features which have been broken with changes in backend: - fixed Chat signature - added/removed/replaced a couple of missing methods - use contact_list_widget instead of contact_list when needed
author Goffi <goffi@goffi.org>
date Fri, 19 May 2017 17:03:04 +0200
parents f8a7a046ff9c
children
comparison
equal deleted inserted replaced
943:aacda981c348 944:5d9f6d25c586
88 container = DialogBox(autoHide=False, centered=True) 88 container = DialogBox(autoHide=False, centered=True)
89 container.setHTML("Manage contact groups") 89 container.setHTML("Manage contact groups")
90 self.container = container 90 self.container = container
91 self._on_close_callback = onCloseCallback 91 self._on_close_callback = onCloseCallback
92 92
93 self.all_contacts = contact_list.JIDList(self.host.contact_list.roster_entities) 93 self.all_contacts = contact_list.JIDList(self.host.contact_list.roster)
94 roster_entities_by_group = self.host.contact_list.roster_entities_by_group 94 roster_entities_by_group = self.host.contact_list.roster_entities_by_group
95 del roster_entities_by_group[None] # remove the empty group 95 del roster_entities_by_group[None] # remove the empty group
96 roster_groups = roster_entities_by_group.keys() 96 roster_groups = roster_entities_by_group.keys()
97 roster_groups.sort() 97 roster_groups.sort()
98 98
124 # need to be done after the contact list has been initialized 124 # need to be done after the contact list has been initialized
125 self.updateContactList() 125 self.updateContactList()
126 126
127 # Hide the contacts list from the main panel to not confuse the user 127 # Hide the contacts list from the main panel to not confuse the user
128 self.restore_contact_panel = False 128 self.restore_contact_panel = False
129 clist = self.host.contact_list 129 clist = self.host.contact_list_widget
130 if clist.getVisible(): 130 if clist.getVisible():
131 self.restore_contact_panel = True 131 self.restore_contact_panel = True
132 self.host.panel._contactsSwitch() 132 self.host.panel._contactsSwitch()
133 133
134 container.add(self) 134 container.add(self)
166 buttons.add(Button("Save", listener=self.closeAndSave)) 166 buttons.add(Button("Save", listener=self.closeAndSave))
167 return buttons 167 return buttons
168 168
169 def initContactList(self): 169 def initContactList(self):
170 """Add the contact list to the DockPanel.""" 170 """Add the contact list to the DockPanel."""
171 171
172 self.toggle = CheckBox("Hide assigned contacts") 172 self.toggle = CheckBox("Hide assigned contacts")
173 self.toggle.addClickListener(lambda dummy: self.updateContactList()) 173 self.toggle.addClickListener(lambda dummy: self.updateContactList())
174 self.toggle.addStyleName("toggleAssignedContacts") 174 self.toggle.addStyleName("toggleAssignedContacts")
175 self.contacts = contact_panel.ContactsPanel(self.host) 175 self.contacts = contact_panel.ContactsPanel(self.host)
176 for contact in self.all_contacts: 176 for contact in self.all_contacts: