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]