diff 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
line wrap: on
line diff
--- a/browser_side/menu.py	Sat Nov 09 15:31:39 2013 +0100
+++ b/browser_side/menu.py	Sat Nov 09 09:39:45 2013 +0100
@@ -40,6 +40,7 @@
 from xmlui import XMLUI
 import panels
 import dialog
+from contact_group import ContactGroupEditor
 import re
 
 
@@ -138,12 +139,13 @@
         menu_general.addItem("Disconnect", MenuCmd(self, "onDisconnect"))
 
         menu_contacts = MenuBar(vertical=True)
-        menu_contacts.addItem("add contact", MenuCmd(self, "onAddContact"))
-        menu_contacts.addItem("update contact", MenuCmd(self, "onUpdateContact"))
-        menu_contacts.addItem("remove contact", MenuCmd(self, "onRemoveContact"))
+        menu_contacts.addItem("Add contact", MenuCmd(self, "onAddContact"))
+        menu_contacts.addItem("Update contact", MenuCmd(self, "onUpdateContact"))
+        menu_contacts.addItem("Remove contact", MenuCmd(self, "onRemoveContact"))
+        menu_contacts.addItem("Manage groups", MenuCmd(self, "onManageContactGroups"))
 
         menu_group = MenuBar(vertical=True)
-        menu_group.addItem("join room", MenuCmd(self, "onJoinRoom"))
+        menu_group.addItem("Join room", MenuCmd(self, "onJoinRoom"))
         menu_group.addItem("Collective radio", MenuCmd(self, "onCollectiveRadio"))
 
         menu_games = MenuBar(vertical=True)
@@ -278,6 +280,14 @@
         _dialog = dialog.GenericConfirmDialog([_contacts_list], dialogCb, "Who do you want to remove from your contacts ?")
         _dialog.show()
 
+    def onManageContactGroups(self):
+        """Open the contact groups manager."""
+
+        def onCloseCallback():
+            pass
+
+        ContactGroupEditor(self.host, None, onCloseCallback)
+
     #Group menu
     def onJoinRoom(self):
         _dialog = None