Mercurial > libervia-web
diff src/browser/sat_browser/contact_list.py @ 671:2201ff543a05 frontends_multi_profiles
browser_side: replace ContactsPanel and ContactBox init "parent" attribute with "host" + menus bound to the avatar can be parameterized
author | souliane <souliane@mailoo.org> |
---|---|
date | Mon, 09 Mar 2015 16:30:06 +0100 |
parents | 1bf645e73fe8 |
children | e489218886d7 |
line wrap: on
line diff
--- a/src/browser/sat_browser/contact_list.py Mon Mar 09 16:27:20 2015 +0100 +++ b/src/browser/sat_browser/contact_list.py Mon Mar 09 16:30:06 2015 +0100 @@ -136,10 +136,13 @@ class ContactsPanel(contact_panel.ContactsPanel): """The contact list that is displayed on the left side.""" - def __init__(self, parent): + def __init__(self, host): + def on_click(contact_jid): self.host.displayWidget(chat.Chat, contact_jid, type_=C.CHAT_ONE2ONE) - contact_panel.ContactsPanel.__init__(self, parent, on_click=on_click, handle_menu=True) + + contact_panel.ContactsPanel.__init__(self, host, contacts_click=on_click, + contacts_menus=(C.MENU_JID_CONTEXT, C.MENU_ROSTER_JID_CONTEXT)) def setState(self, jid_, type_, state): """Change the appearance of the contact, according to the state @@ -185,7 +188,7 @@ self.vPanel = VerticalPanel() _title = ContactTitleLabel(host, 'Contacts') DOM.setStyleAttribute(_title.getElement(), "cursor", "pointer") - self._contacts_panel = ContactsPanel(self) + self._contacts_panel = ContactsPanel(host) self._contacts_panel.setStyleName('contactPanel') # FIXME: style doesn't exists ! self._group_panel = GroupPanel(self)