Remove actionCreateFilteredDeck2 and use modifier

This commit is contained in:
RumovZ 2021-02-02 09:29:09 +01:00
parent 7fc32db0c9
commit 16462941ab
3 changed files with 9 additions and 20 deletions

View File

@ -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:

View File

@ -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()
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
######################################################################

View File

@ -232,7 +232,6 @@
<addaction name="actionClose"/>
<addaction name="separator"/>
<addaction name="actionCreateFilteredDeck"/>
<addaction name="actionCreateFilteredDeck2"/>
</widget>
<widget class="QMenu" name="menuJump">
<property name="title">
@ -588,20 +587,12 @@
</action>
<action name="actionCreateFilteredDeck">
<property name="text">
<string>BROWSING_CREATE_FILTERED_DECK</string>
<string>QT_MISC_CREATE_FILTERED_DECK</string>
</property>
<property name="shortcut">
<string notr="true">Ctrl+G</string>
</property>
</action>
<action name="actionCreateFilteredDeck2">
<property name="text">
<string>BROWSING_CREATE_FILTERED_DECK_2</string>
</property>
<property name="shortcut">
<string notr="true">Ctrl+Shift+G</string>
</property>
</action>
</widget>
<resources>
<include location="icons.qrc"/>