comparison src/browser/sat_browser/menu.py @ 509:35ccb3ff8245

browser_side: add method GenericMenuBar.addCategory + fixes MenuNode.addMenuItem when callback argument is a sub-menu
author souliane <souliane@mailoo.org>
date Thu, 21 Aug 2014 16:18:51 +0200
parents 4aa627b059df
children 9bfd71e2b35c
comparison
equal deleted inserted replaced
508:1d41cc5b57b1 509:35ccb3ff8245
63 self.menu_bar = MainMenuBar(self.host) 63 self.menu_bar = MainMenuBar(self.host)
64 64
65 def addMenuItem(self, *args): 65 def addMenuItem(self, *args):
66 self.menu_bar.addMenuItem(*args) 66 self.menu_bar.addMenuItem(*args)
67 67
68 def addCategory(self, *args):
69 self.menu_bar.addCategory(*args)
70
68 def createMenus(self): 71 def createMenus(self):
69 self.addMenuItem("General", [_("General"), _("Web widget")], 'home', MenuCmd(self, "onWebWidget")) 72 self.addMenuItem("General", [_("General"), _("Web widget")], 'home', MenuCmd(self, "onWebWidget"))
70 self.addMenuItem("General", [_("General"), _("Disconnect")], 'home', MenuCmd(self, "onDisconnect")) 73 self.addMenuItem("General", [_("General"), _("Disconnect")], 'home', MenuCmd(self, "onDisconnect"))
71 self.addMenuItem("Contacts", [_("Contacts"), None], 'social') # save the position for this category 74 self.addCategory("Contacts", _("Contacts"), 'social') # save the position for this category
72 self.addMenuItem("Groups", [_("Groups"), _("Discussion")], 'social', MenuCmd(self, "onJoinRoom")) 75 self.addMenuItem("Groups", [_("Groups"), _("Discussion")], 'social', MenuCmd(self, "onJoinRoom"))
73 self.addMenuItem("Groups", [_("Groups"), _("Collective radio")], 'social', MenuCmd(self, "onCollectiveRadio")) 76 self.addMenuItem("Groups", [_("Groups"), _("Collective radio")], 'social', MenuCmd(self, "onCollectiveRadio"))
74 self.addMenuItem("Games", [_("Games"), _("Tarot")], 'games', MenuCmd(self, "onTarotGame")) 77 self.addMenuItem("Games", [_("Games"), _("Tarot")], 'games', MenuCmd(self, "onTarotGame"))
75 self.addMenuItem("Games", [_("Games"), _("Xiangqi")], 'games', MenuCmd(self, "onXiangqiGame")) 78 self.addMenuItem("Games", [_("Games"), _("Xiangqi")], 'games', MenuCmd(self, "onXiangqiGame"))
76 79