diff src/browser/sat_browser/menu.py @ 654:40c72f3b7638 frontends_multi_profiles

browser_side: MainPanel is now based on a DockPanel, which allows to use less tables and also to remove some "window resized" listeners
author souliane <souliane@mailoo.org>
date Fri, 27 Feb 2015 02:39:43 +0100
parents 6d3142b782c3
children 6a8a1103ad10
line wrap: on
line diff
--- a/src/browser/sat_browser/menu.py	Fri Feb 27 01:45:34 2015 +0100
+++ b/src/browser/sat_browser/menu.py	Fri Feb 27 02:39:43 2015 +0100
@@ -55,22 +55,6 @@
     def getCategoryHTML(cls, menu_name_i18n, type_):
         return cls.ITEM_TPL % (type_, menu_name_i18n)
 
-
-class MainMenuPanel(SimplePanel):
-    """Container for the main menu bar"""
-
-    def __init__(self, host):
-        self.host = host
-        SimplePanel.__init__(self)
-        self.setStyleName('menuContainer')
-        self.menu_bar = MainMenuBar(self.host)
-
-    def addMenuItem(self, *args):
-        self.menu_bar.addMenuItem(*args)
-
-    def addCategory(self, *args):
-        self.menu_bar.addCategory(*args)
-
     def createMenus(self):
         self.addMenuItem("General", [_("General"), _("Web widget")], 'home', MenuCmd(self, "onWebWidget"))
         self.addMenuItem("General", [_("General"), _("Disconnect")], 'home', MenuCmd(self, "onDisconnect"))
@@ -81,12 +65,12 @@
         self.addMenuItem("Games", [_("Games"), _("Xiangqi")], 'games', MenuCmd(self, "onXiangqiGame"))
 
         # additional menus
-        self.menu_bar.addCachedMenus(C.MENU_GLOBAL)
+        self.addCachedMenus(C.MENU_GLOBAL)
 
         # menu items that should be displayed after the automatically added ones
         self.addMenuItem("Contacts", [_("Contacts"), _("Manage groups")], 'social', MenuCmd(self, "onManageContactGroups"))
 
-        self.menu_bar.addSeparator()
+        self.addSeparator()
 
         self.addMenuItem("Help", [_("Help"), _("Social contract")], 'help', MenuCmd(self, "onSocialContract"))
         self.addMenuItem("Help", [_("Help"), _("About")], 'help', MenuCmd(self, "onAbout"))
@@ -96,8 +80,6 @@
         # XXX: temporary, will change when a full profile will be managed in SàT
         self.addMenuItem("Settings", [_("Settings"), _("Upload avatar")], 'settings', MenuCmd(self, "onAvatarUpload"))
 
-        self.add(self.menu_bar)
-
     # General menu
     def onWebWidget(self):
         web_widget = self.host.displayWidget(widget.WebWidget, C.WEB_PANEL_DEFAULT_URL)