'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().'

def update_bars(self, reveal_bar=False):

    showing_device = self.location_manager.has_device
    main_bar = self.main_bars[(1 if showing_device else 0)]
    child_bar = self.child_bars[0]
    for bar in self.bars:
        bar.setVisible(False)
        bar.update_lm_actions()
    if main_bar.added_actions:
        main_bar.setVisible(True)
        if (reveal_bar and (not config[u'disable_animations'])):
            self.reveal_bar.start(main_bar)
    if child_bar.added_actions:
        child_bar.setVisible(True)
    self.menu_bar.init_bar(self.bar_actions[(4 if showing_device else 3)])
    self.menu_bar.update_lm_actions()
    self.menu_bar.setVisible(bool(self.menu_bar.added_actions))
