mirror of
https://github.com/ankitects/anki.git
synced 2025-09-18 22:12:21 -04:00
dyndeckconf -> filtered_deck
This commit is contained in:
parent
12597e1094
commit
5a1b00b6e6
7 changed files with 12 additions and 12 deletions
|
@ -69,7 +69,7 @@ except ImportError as e:
|
||||||
# - make preferences modal? cmd+q does wrong thing
|
# - make preferences modal? cmd+q does wrong thing
|
||||||
|
|
||||||
|
|
||||||
from aqt import addcards, addons, browser, editcurrent, dyndeckconf # isort:skip
|
from aqt import addcards, addons, browser, editcurrent, filtered_deck # isort:skip
|
||||||
from aqt import stats, about, preferences, mediasync # isort:skip
|
from aqt import stats, about, preferences, mediasync # isort:skip
|
||||||
|
|
||||||
|
|
||||||
|
@ -80,7 +80,7 @@ class DialogManager:
|
||||||
"AddonsDialog": [addons.AddonsDialog, None],
|
"AddonsDialog": [addons.AddonsDialog, None],
|
||||||
"Browser": [browser.Browser, None],
|
"Browser": [browser.Browser, None],
|
||||||
"EditCurrent": [editcurrent.EditCurrent, None],
|
"EditCurrent": [editcurrent.EditCurrent, None],
|
||||||
"DynDeckConfDialog": [dyndeckconf.DeckConf, None],
|
"FilteredDeckConfigDialog": [filtered_deck.FilteredDeckConfigDialog, None],
|
||||||
"DeckStats": [stats.DeckStats, None],
|
"DeckStats": [stats.DeckStats, None],
|
||||||
"NewDeckStats": [stats.NewDeckStats, None],
|
"NewDeckStats": [stats.NewDeckStats, None],
|
||||||
"About": [about.show, None],
|
"About": [about.show, None],
|
||||||
|
|
|
@ -1108,9 +1108,9 @@ where id in %s"""
|
||||||
def createFilteredDeck(self) -> None:
|
def createFilteredDeck(self) -> None:
|
||||||
search = self.form.searchEdit.lineEdit().text()
|
search = self.form.searchEdit.lineEdit().text()
|
||||||
if self.mw.col.schedVer() != 1 and KeyboardModifiersPressed().alt:
|
if self.mw.col.schedVer() != 1 and KeyboardModifiersPressed().alt:
|
||||||
aqt.dialogs.open("DynDeckConfDialog", self.mw, search_2=search)
|
aqt.dialogs.open("FilteredDeckConfigDialog", self.mw, search_2=search)
|
||||||
else:
|
else:
|
||||||
aqt.dialogs.open("DynDeckConfDialog", self.mw, search=search)
|
aqt.dialogs.open("FilteredDeckConfigDialog", self.mw, search=search)
|
||||||
|
|
||||||
# Preview
|
# Preview
|
||||||
######################################################################
|
######################################################################
|
||||||
|
|
|
@ -24,7 +24,7 @@ from aqt.utils import (
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
class DeckConf(QDialog):
|
class FilteredDeckConfigDialog(QDialog):
|
||||||
"""Dialogue to modify and build a filtered deck."""
|
"""Dialogue to modify and build a filtered deck."""
|
||||||
|
|
||||||
def __init__(
|
def __init__(
|
||||||
|
@ -42,7 +42,7 @@ class DeckConf(QDialog):
|
||||||
self.mw = mw
|
self.mw = mw
|
||||||
self.col = self.mw.col
|
self.col = self.mw.col
|
||||||
self.did: Optional[int] = None
|
self.did: Optional[int] = None
|
||||||
self.form = aqt.forms.dyndconf.Ui_Dialog()
|
self.form = aqt.forms.filtered_deck.Ui_Dialog()
|
||||||
self.form.setupUi(self)
|
self.form.setupUi(self)
|
||||||
self.mw.checkpoint(tr(TR.ACTIONS_OPTIONS))
|
self.mw.checkpoint(tr(TR.ACTIONS_OPTIONS))
|
||||||
self.initialSetup()
|
self.initialSetup()
|
||||||
|
@ -294,7 +294,7 @@ class DeckConf(QDialog):
|
||||||
self.mw.reset()
|
self.mw.reset()
|
||||||
saveGeom(self, "dyndeckconf")
|
saveGeom(self, "dyndeckconf")
|
||||||
QDialog.reject(self)
|
QDialog.reject(self)
|
||||||
aqt.dialogs.markClosed("DynDeckConfDialog")
|
aqt.dialogs.markClosed("FilteredDeckConfigDialog")
|
||||||
|
|
||||||
def accept(self) -> None:
|
def accept(self) -> None:
|
||||||
try:
|
try:
|
||||||
|
@ -310,7 +310,7 @@ class DeckConf(QDialog):
|
||||||
saveGeom(self, "dyndeckconf")
|
saveGeom(self, "dyndeckconf")
|
||||||
self.mw.reset()
|
self.mw.reset()
|
||||||
QDialog.accept(self)
|
QDialog.accept(self)
|
||||||
aqt.dialogs.markClosed("DynDeckConfDialog")
|
aqt.dialogs.markClosed("FilteredDeckConfigDialog")
|
||||||
|
|
||||||
def closeWithCallback(self, callback: Callable) -> None:
|
def closeWithCallback(self, callback: Callable) -> None:
|
||||||
self.reject()
|
self.reject()
|
|
@ -13,7 +13,7 @@ from . import clayout_top
|
||||||
from . import customstudy
|
from . import customstudy
|
||||||
from . import dconf
|
from . import dconf
|
||||||
from . import debug
|
from . import debug
|
||||||
from . import dyndconf
|
from . import filtered_deck
|
||||||
from . import editaddon
|
from . import editaddon
|
||||||
from . import editcurrent
|
from . import editcurrent
|
||||||
from . import edithtml
|
from . import edithtml
|
||||||
|
|
|
@ -1325,7 +1325,7 @@ title="%s" %s>%s</button>""" % (
|
||||||
if not deck:
|
if not deck:
|
||||||
deck = self.col.decks.current()
|
deck = self.col.decks.current()
|
||||||
if deck["dyn"]:
|
if deck["dyn"]:
|
||||||
aqt.dialogs.open("DynDeckConfDialog", self, deck=deck)
|
aqt.dialogs.open("FilteredDeckConfigDialog", self, deck=deck)
|
||||||
else:
|
else:
|
||||||
aqt.deckconf.DeckConf(self, deck)
|
aqt.deckconf.DeckConf(self, deck)
|
||||||
|
|
||||||
|
@ -1402,7 +1402,7 @@ title="%s" %s>%s</button>""" % (
|
||||||
##########################################################################
|
##########################################################################
|
||||||
|
|
||||||
def onCram(self) -> None:
|
def onCram(self) -> None:
|
||||||
aqt.dialogs.open("DynDeckConfDialog", self)
|
aqt.dialogs.open("FilteredDeckConfigDialog", self)
|
||||||
|
|
||||||
# Menu, title bar & status
|
# Menu, title bar & status
|
||||||
##########################################################################
|
##########################################################################
|
||||||
|
|
|
@ -87,7 +87,7 @@ class Overview:
|
||||||
elif url == "opts":
|
elif url == "opts":
|
||||||
self.mw.onDeckConf()
|
self.mw.onDeckConf()
|
||||||
elif url == "cram":
|
elif url == "cram":
|
||||||
aqt.dialogs.open("DynDeckConfDialog", self.mw)
|
aqt.dialogs.open("FilteredDeckConfigDialog", self.mw)
|
||||||
elif url == "refresh":
|
elif url == "refresh":
|
||||||
self.rebuild_current_filtered_deck()
|
self.rebuild_current_filtered_deck()
|
||||||
elif url == "empty":
|
elif url == "empty":
|
||||||
|
|
Loading…
Reference in a new issue