Mercurial > libervia-web
comparison browser_side/menu.py @ 256:0e7f3944bd27
browser_side: added contact group manager based on ListManager
author | souliane <souliane@mailoo.org> |
---|---|
date | Sat, 09 Nov 2013 09:39:45 +0100 |
parents | a25aa882e09a |
children | 377de26d5bc2 |
comparison
equal
deleted
inserted
replaced
255:da0487f0a2e7 | 256:0e7f3944bd27 |
---|---|
38 from jid import JID | 38 from jid import JID |
39 from tools import html_sanitize | 39 from tools import html_sanitize |
40 from xmlui import XMLUI | 40 from xmlui import XMLUI |
41 import panels | 41 import panels |
42 import dialog | 42 import dialog |
43 from contact_group import ContactGroupEditor | |
43 import re | 44 import re |
44 | 45 |
45 | 46 |
46 class MenuCmd: | 47 class MenuCmd: |
47 | 48 |
136 menu_general = MenuBar(vertical=True) | 137 menu_general = MenuBar(vertical=True) |
137 menu_general.addItem("Web widget", MenuCmd(self, "onWebWidget")) | 138 menu_general.addItem("Web widget", MenuCmd(self, "onWebWidget")) |
138 menu_general.addItem("Disconnect", MenuCmd(self, "onDisconnect")) | 139 menu_general.addItem("Disconnect", MenuCmd(self, "onDisconnect")) |
139 | 140 |
140 menu_contacts = MenuBar(vertical=True) | 141 menu_contacts = MenuBar(vertical=True) |
141 menu_contacts.addItem("add contact", MenuCmd(self, "onAddContact")) | 142 menu_contacts.addItem("Add contact", MenuCmd(self, "onAddContact")) |
142 menu_contacts.addItem("update contact", MenuCmd(self, "onUpdateContact")) | 143 menu_contacts.addItem("Update contact", MenuCmd(self, "onUpdateContact")) |
143 menu_contacts.addItem("remove contact", MenuCmd(self, "onRemoveContact")) | 144 menu_contacts.addItem("Remove contact", MenuCmd(self, "onRemoveContact")) |
145 menu_contacts.addItem("Manage groups", MenuCmd(self, "onManageContactGroups")) | |
144 | 146 |
145 menu_group = MenuBar(vertical=True) | 147 menu_group = MenuBar(vertical=True) |
146 menu_group.addItem("join room", MenuCmd(self, "onJoinRoom")) | 148 menu_group.addItem("Join room", MenuCmd(self, "onJoinRoom")) |
147 menu_group.addItem("Collective radio", MenuCmd(self, "onCollectiveRadio")) | 149 menu_group.addItem("Collective radio", MenuCmd(self, "onCollectiveRadio")) |
148 | 150 |
149 menu_games = MenuBar(vertical=True) | 151 menu_games = MenuBar(vertical=True) |
150 menu_games.addItem("Tarot", MenuCmd(self, "onTarotGame")) | 152 menu_games.addItem("Tarot", MenuCmd(self, "onTarotGame")) |
151 menu_games.addItem("Xiangqi", MenuCmd(self, "onXiangqiGame")) | 153 menu_games.addItem("Xiangqi", MenuCmd(self, "onXiangqiGame")) |
275 | 277 |
276 for contact in self.host.contact_panel.getContacts(): | 278 for contact in self.host.contact_panel.getContacts(): |
277 _contacts_list.addItem(contact) | 279 _contacts_list.addItem(contact) |
278 _dialog = dialog.GenericConfirmDialog([_contacts_list], dialogCb, "Who do you want to remove from your contacts ?") | 280 _dialog = dialog.GenericConfirmDialog([_contacts_list], dialogCb, "Who do you want to remove from your contacts ?") |
279 _dialog.show() | 281 _dialog.show() |
282 | |
283 def onManageContactGroups(self): | |
284 """Open the contact groups manager.""" | |
285 | |
286 def onCloseCallback(): | |
287 pass | |
288 | |
289 ContactGroupEditor(self.host, None, onCloseCallback) | |
280 | 290 |
281 #Group menu | 291 #Group menu |
282 def onJoinRoom(self): | 292 def onJoinRoom(self): |
283 _dialog = None | 293 _dialog = None |
284 _edit = None | 294 _edit = None |