def setupUi( self, flip_shortcut: str, presentation_mode: bool, presentation_shortcut: str ): self.ui.flipShortcut.setKeySequence(QKeySequence(flip_shortcut)) self.ui.presentationCheckBox.setChecked(presentation_mode) self.ui.presentationShortcut.setKeySequence(QKeySequence(presentation_shortcut))
def setupUi( self, open: str, open_browser: str, close: str, next: str, previous: str, ): self.ui.shortcutOpen.setKeySequence(QKeySequence(open)) self.ui.shortcutOpenBrowser.setKeySequence(QKeySequence(open_browser)) self.ui.shortcutClose.setKeySequence(QKeySequence(close)) self.ui.shortcutNext.setKeySequence(QKeySequence(next)) self.ui.shortcutPrevious.setKeySequence(QKeySequence(previous))
def setupUi(self, occlude_shortcut: str, occlude_accept_behavior: str, max_height: int) -> None: self.ui.occludeShortcut.setKeySequence(QKeySequence(occlude_shortcut)) self.ui.occlusionAcceptBehavior.setCurrentIndex( behaviors.index(occlude_accept_behavior)) self.ui.maxHeight.setValue(max_height) self.ui.versionInfo.setText(f"Closet {version}")
def addMenuItem(menuName, text, function, keys=None): action = QAction(text, mw) if keys: action.setShortcut(QKeySequence(keys)) action.triggered.connect(function) if menuName == 'File': mw.form.menuCol.addAction(action) elif menuName == 'Edit': mw.form.menuEdit.addAction(action) elif menuName == 'Tools': mw.form.menuTools.addAction(action) elif menuName == 'Help': mw.form.menuHelp.addAction(action) else: addMenu(menuName) mw.customMenus[menuName].addAction(action) return action
from aqt import mw, QAction, QKeySequence from .mainwindow import MainWindow from . import startmodule def start(): startmodule.start() def debugStart(): from . import debugreload debugreload.reloadAll(__name__) startmodule.start() startAction = QAction("English word manager: start", mw) startAction.setShortcut(QKeySequence('Ctrl+M')) startAction.triggered.connect(debugStart) mw.form.menuTools.addSeparator() mw.form.menuTools.addAction(startAction)
def setupUi(self, toggle_field_shortcut: str, toggle_all_shortcut: str): self.ui.toggleFieldShortcut.setKeySequence( QKeySequence(toggle_field_shortcut)) self.ui.toggleAllShortcut.setKeySequence( QKeySequence(toggle_all_shortcut))
def setupUi(self, toggle_mode_shortcut: str, toggle_zoom_shortcut: str): self.ui.toggleModeShortcut.setKeySequence( QKeySequence(toggle_mode_shortcut)) self.ui.toggleZoomShortcut.setKeySequence( QKeySequence(toggle_zoom_shortcut))