예제 #1
0
파일: bars.py 프로젝트: auspex/calibre
 def __init__(self, clone, parent, is_top_level=False, clone_shortcuts=True):
     QAction.__init__(self, clone.text().replace('&&', '&'), parent)
     self.setMenuRole(QAction.NoRole)  # ensure this action is not moved around by Qt
     self.is_top_level = is_top_level
     self.clone_shortcuts = clone_shortcuts
     self.clone = clone
     clone.changed.connect(self.clone_changed)
     self.clone_changed()
     self.triggered.connect(self.do_trigger)
예제 #2
0
 def __init__(self, clone, parent, is_top_level=False, clone_shortcuts=True):
     QAction.__init__(self, clone.text().replace('&&', '&'), parent)
     self.setMenuRole(QAction.NoRole)  # ensure this action is not moved around by Qt
     self.is_top_level = is_top_level
     self.clone_shortcuts = clone_shortcuts
     self.clone = clone
     clone.changed.connect(self.clone_changed)
     self.clone_changed()
     self.triggered.connect(self.do_trigger)
예제 #3
0
 def __init__(self, wac, icon, text, checkable, view):
     QAction.__init__(self, QIcon(I(icon + '.png')), text, view)
     self._page_action = getattr(QWebPage, wac)
     self.setCheckable(checkable)
     self.triggered.connect(self.trigger_page_action)
     view.selectionChanged.connect(self.update_state,
                                   type=Qt.QueuedConnection)
     self.page_action.changed.connect(self.update_state,
                                      type=Qt.QueuedConnection)
     self.update_state()
예제 #4
0
    def __init__(self, text, parent):
        """
        Create action.

        Arguments:
            text (str): Action's text.
            parent (QObject): Parent object.
        """
        QAction.__init__(self, text, parent)
        self.changed.connect(self._changed)
예제 #5
0
 def __init__(self, wac, icon, text, checkable, view):
     QAction.__init__(self, QIcon(I(icon+'.png')), text, view)
     self._page_action = getattr(QWebPage, wac)
     self.setCheckable(checkable)
     self.triggered.connect(self.trigger_page_action)
     view.selectionChanged.connect(self.update_state,
             type=Qt.QueuedConnection)
     self.page_action.changed.connect(self.update_state,
             type=Qt.QueuedConnection)
     self.update_state()
 def __init__(self, orig_action, parent=None):
     QAction.__init__(self, orig_action.icon(), orig_action.text(), parent)
     if orig_action.isCheckable():
         self.setCheckable(True)
         self.setChecked(orig_action.isChecked())
         self.toggled.connect(self.toggle_orig)
     self.setEnabled(orig_action.isEnabled())
     self.setVisible(orig_action.isVisible())
     self.setToolTip(orig_action.toolTip())
     self.orig = weakref.ref(orig_action)
     self.triggered.connect(self.fire_orig)
     # If this plugin has a menu need to iterate through making clone wrappers of it.
     if orig_action.menu():
         clone_m = QMenu(orig_action.text(), parent)
         self._clone_menu(orig_action.menu(), clone_m)
         self.setMenu(clone_m)
예제 #7
0
    def __init__(self, parent=None):
        """
        Create action.

        Arguments:
            parent (Optional[QObject]): Parent object. Defaults to None.
        """
        QAction.__init__(self, parent)
        self.setMenu(UndoMenu())
        self._items = []
        self._message = ""
        self._comment = ""
        self._tooltip = ""
        self._statustip = ""
        self._shortcut_hint = ""
        self.triggered.connect(self._triggered)
        self.menu().triggered.connect(self._triggered)
예제 #8
0
    def __init__(self, *args):
        QAction.__init__(self, *args)

        self.triggered.connect(lambda x: self.correct.emit(self.text()))
예제 #9
0
 def __init__(self, clone, parent):
     QAction.__init__(self, clone.text(), parent)
     self.clone = clone
     clone.changed.connect(self.clone_changed)
예제 #10
0
 def __init__(self, path, parent):
     self.path = path
     QAction.__init__(self, os.path.basename(path), parent)
예제 #11
0
파일: main.py 프로젝트: Solertis/calibre
 def __init__(self, path, parent):
     self.path = path
     QAction.__init__(self, os.path.basename(path), parent)
예제 #12
0
 def __init__(self, text, name, view):
     QAction.__init__(self, text, view)
     self._name = name
     self.triggered.connect(self.apply_style)
예제 #13
0
 def __init__(self, file_name, open_file_slot, parent=None):
     QAction.__init__(self, parent)
     self.file_name = file_name
     self.triggered.connect(self.on_triggered)
     self.open_file_requested.connect(open_file_slot)
     self.setText(file_name)
예제 #14
0
 def __init__(self, text, key, ascending, parent):
     QAction.__init__(self, text, parent)
     self.key, self.ascending = key, ascending
     self.triggered.connect(self)
예제 #15
0
파일: bars.py 프로젝트: auspex/calibre
 def __init__(self, clone, parent):
     QAction.__init__(self, clone.text(), parent)
     self.clone = clone
     clone.changed.connect(self.clone_changed)
예제 #16
0
파일: widgets.py 프로젝트: davidfor/calibre
 def __init__(self, mb):
     QAction.__init__(self, mb)
예제 #17
0
파일: sort.py 프로젝트: artbycrunk/calibre
 def __init__(self, text, key, ascending, parent):
     QAction.__init__(self, text, parent)
     self.key, self.ascending = key, ascending
     self.triggered.connect(self)
예제 #18
0
 def __init__(self, mb):
     QAction.__init__(self, mb)
예제 #19
0
 def __init__(self, text, name, view):
     QAction.__init__(self, text, view)
     self._name = name
     self.triggered.connect(self.apply_style)
예제 #20
0
파일: view.py 프로젝트: thesaikot/calibre
 def __init__(self, id_, title, parent):
     QAction.__init__(self, title, parent)
     self.id = id_
     self.triggered.connect(self._triggered)
예제 #21
0
파일: view.py 프로젝트: davidfor/calibre
 def __init__(self, id_, title, parent):
     QAction.__init__(self, title, parent)
     self.id = id_
     self.triggered.connect(self._triggered)
예제 #22
0
    def __init__(self, *args):
        QAction.__init__(self, *args)

        self.triggered.connect(lambda x: self.correct.emit(self.text()))