From 2d169def5ff5f8ae6179f1d6ce2e5fc87b71f26d Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Wed, 18 May 2011 20:59:00 -0600 Subject: [PATCH] ... --- src/calibre/gui2/bars.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/calibre/gui2/bars.py b/src/calibre/gui2/bars.py index 8bae9d65d1..d586bfe1c3 100644 --- a/src/calibre/gui2/bars.py +++ b/src/calibre/gui2/bars.py @@ -277,6 +277,13 @@ class BarsManager(QObject): bar.init_bar(actions) def update_bars(self): + ''' + This shows the correct main toolbar and rebuilds the menubar based on + whether a device is connected or not. Note that the toolbars are + explicitly not rebuilt, this is to workaround a Qt limitation iwth + QToolButton's popup menus and modal dialogs. If you want the toolbars + rebuilt, call init_bars(). + ''' showing_device = self.location_manager.has_device main_bar = self.main_bars[1 if showing_device else 0] child_bar = self.child_bars[0]