Exemple #1
0
 def __init__(self, parent, menu_registrar, bus):
     global menu_counter
     if not parent.isWindow():
         raise ValueError(
             'You must supply a top level window widget as the parent for an exported menu bar'
         )
     self._blocked = False
     self.is_visible = True
     QMenuBar.__init__(self, parent)
     QMenuBar.setVisible(self, False)
     self.menu_action = MenuBarAction(self)
     self.menu_registrar = menu_registrar
     self.registered_window_id = None
     self.bus = bus
     menu_counter += 1
     import dbus
     from calibre.gui2.dbus_export.menu import DBusMenu
     self.object_path = dbus.ObjectPath('/MenuBar/%d' % menu_counter)
     self.dbus_menu = DBusMenu(self.object_path)
     self.dbus_menu.publish_new_menu(self)
     self.register()
     parent.installEventFilter(self)
     # See https://bugreports.qt-project.org/browse/QTBUG-42281
     if hasattr(parent, 'window_blocked'):
         parent.window_blocked.connect(self._block)
         parent.window_unblocked.connect(self._unblock)
Exemple #2
0
        def __init__(self, location_manager, parent):
            QMenuBar.__init__(self, parent)
            parent.setMenuBar(self)
            self.gui = parent

            self.location_manager = location_manager
            self.added_actions = []

            self.donate_action = QAction(_('Donate'), self)
            self.donate_menu = QMenu()
            self.donate_menu.addAction(self.gui.donate_action)
            self.donate_action.setMenu(self.donate_menu)
Exemple #3
0
        def __init__(self, location_manager, parent):
            QMenuBar.__init__(self, parent)
            parent.setMenuBar(self)
            self.gui = parent

            self.location_manager = location_manager
            self.added_actions = []

            self.donate_action = QAction(_("Donate"), self)
            self.donate_menu = QMenu()
            self.donate_menu.addAction(self.gui.donate_action)
            self.donate_action.setMenu(self.donate_menu)
Exemple #4
0
 def __init__(self, parent, menu_registrar, bus):
     global menu_counter
     if not parent.isWindow():
         raise ValueError('You must supply a top level window widget as the parent for an exported menu bar')
     QMenuBar.__init__(self, parent)
     QMenuBar.setVisible(self, False)
     self.menu_action = MenuBarAction(self)
     self.menu_registrar = menu_registrar
     self.registered_window_id = None
     self.bus = bus
     menu_counter += 1
     import dbus
     from calibre.gui2.dbus_export.menu import DBusMenu
     self.object_path = dbus.ObjectPath('/MenuBar/%d' % menu_counter)
     self.dbus_menu = DBusMenu(self.object_path)
     self.dbus_menu.publish_new_menu(self)
     self.register()
     parent.installEventFilter(self)
Exemple #5
0
 def __init__(self, parent, menu_registrar, bus):
     global menu_counter
     if not parent.isWindow():
         raise ValueError('You must supply a top level window widget as the parent for an exported menu bar')
     self._blocked = False
     self.is_visible = True
     QMenuBar.__init__(self, parent)
     QMenuBar.setVisible(self, False)
     self.menu_action = MenuBarAction(self)
     self.menu_registrar = menu_registrar
     self.registered_window_id = None
     self.bus = bus
     menu_counter += 1
     import dbus
     from calibre.gui2.dbus_export.menu import DBusMenu
     self.object_path = dbus.ObjectPath('/MenuBar/%d' % menu_counter)
     self.dbus_menu = DBusMenu(self.object_path)
     self.dbus_menu.publish_new_menu(self)
     self.register()
     parent.installEventFilter(self)
     # See https://bugreports.qt-project.org/browse/QTBUG-42281
     if hasattr(parent, 'window_blocked'):
         parent.window_blocked.connect(self._block)
         parent.window_unblocked.connect(self._unblock)