# HG changeset patch # User souliane # Date 1428572805 -7200 # Node ID 16079280a39e74b858760475d234d9e558b8d7b9 # Parent 76a67d04c63e8696527b7eb0edd3069b5494cd66 browser_side: minor fixes for ContactMenuBar and ContactGroupManager diff -r 76a67d04c63e -r 16079280a39e src/browser/sat_browser/contact_group.py --- a/src/browser/sat_browser/contact_group.py Thu Apr 09 11:40:53 2015 +0200 +++ b/src/browser/sat_browser/contact_group.py Thu Apr 09 11:46:45 2015 +0200 @@ -188,7 +188,7 @@ self.toggle.addStyleName("toggleAssignedContacts") self.contacts = contact_panel.ContactsPanel(self.host) for contact in self.all_contacts: - self.contacts.add(contact) + self.contacts.updateContactBox(contact) panel = VerticalPanel() panel.add(self.toggle) panel.add(self.contacts) diff -r 76a67d04c63e -r 16079280a39e src/browser/sat_browser/contact_widget.py --- a/src/browser/sat_browser/contact_widget.py Thu Apr 09 11:40:53 2015 +0200 +++ b/src/browser/sat_browser/contact_widget.py Thu Apr 09 11:46:45 2015 +0200 @@ -104,6 +104,8 @@ @param url (unicode): avatar URL """ + if not self.items: # the menu is empty but we've been asked to set an avatar + self.addCategory("dummy") self.items[0].setHTML('' % url) @@ -127,10 +129,6 @@ self.label = ContactLabel(host, self.jid, display=display) self.avatar = ContactMenuBar(self, host) if plugin_menu_context else Image() self.states = HTML() - try: # FIXME: dirty hack to force using an Image when the menu is actually empty - self.avatar.items[0] - except IndexError: - self.avatar = Image() self.add(self.avatar) self.add(self.label) self.add(self.states)