From 16462941abbca4ff1899cacebf815979f46c501e Mon Sep 17 00:00:00 2001 From: RumovZ Date: Tue, 2 Feb 2021 09:29:09 +0100 Subject: [PATCH] Remove actionCreateFilteredDeck2 and use modifier --- ftl/core/browsing.ftl | 2 -- qt/aqt/browser.py | 16 ++++++++-------- qt/aqt/forms/browser.ui | 11 +---------- 3 files changed, 9 insertions(+), 20 deletions(-) diff --git a/ftl/core/browsing.ftl b/ftl/core/browsing.ftl index 8ce372e8f..bf408f834 100644 --- a/ftl/core/browsing.ftl +++ b/ftl/core/browsing.ftl @@ -24,8 +24,6 @@ browsing-change-to = Change { $val } to: browsing-clear-unused = Clear Unused browsing-clear-unused-tags = Clear Unused Tags browsing-created = Created -browsing-create-filtered-deck = Create Filtered Deck... -browsing-create-filtered-deck_2 = Create Filtered Deck (2nd Filter)... browsing-ctrlandshiftande = Ctrl+Shift+E browsing-current-deck = Current Deck browsing-current-note-type = Current note type: diff --git a/qt/aqt/browser.py b/qt/aqt/browser.py index ca51dce3d..cd0026f63 100644 --- a/qt/aqt/browser.py +++ b/qt/aqt/browser.py @@ -489,9 +489,7 @@ class Browser(QMainWindow): if not isMac: f.actionClose.setVisible(False) qconnect(f.actionCreateFilteredDeck.triggered, self.createFilteredDeck) - qconnect(f.actionCreateFilteredDeck2.triggered, self.createFilteredDeck2) - if self.mw.col.schedVer() == 1: - f.menuEdit.removeAction(f.actionCreateFilteredDeck2) + f.actionCreateFilteredDeck.setShortcuts(["Ctrl+G", "Ctrl+Alt+G"]) # notes qconnect(f.actionAdd.triggered, self.mw.onAddCard) qconnect(f.actionAdd_Tags.triggered, lambda: self.addTags()) @@ -1199,11 +1197,13 @@ where id in %s""" def createFilteredDeck(self) -> None: search = self.form.searchEdit.lineEdit().text() - aqt.dialogs.open("DynDeckConfDialog", self.mw, search=search) - - def createFilteredDeck2(self) -> None: - search = self.form.searchEdit.lineEdit().text() - aqt.dialogs.open("DynDeckConfDialog", self.mw, search_2=search) + if ( + self.mw.col.schedVer() != 1 + and self.mw.app.keyboardModifiers() & Qt.AltModifier + ): + aqt.dialogs.open("DynDeckConfDialog", self.mw, search_2=search) + else: + aqt.dialogs.open("DynDeckConfDialog", self.mw, search=search) # Preview ###################################################################### diff --git a/qt/aqt/forms/browser.ui b/qt/aqt/forms/browser.ui index 72d24f97c..d94235fc6 100644 --- a/qt/aqt/forms/browser.ui +++ b/qt/aqt/forms/browser.ui @@ -232,7 +232,6 @@ - @@ -588,20 +587,12 @@ - BROWSING_CREATE_FILTERED_DECK + QT_MISC_CREATE_FILTERED_DECK Ctrl+G - - - BROWSING_CREATE_FILTERED_DECK_2 - - - Ctrl+Shift+G - -