mirror of
https://github.com/ankitects/anki.git
synced 2025-09-18 14:02:21 -04:00
default to searching the current deck when creating filtered
This commit is contained in:
parent
e2a8b8a8e7
commit
452548a0ef
2 changed files with 7 additions and 1 deletions
|
@ -13,7 +13,6 @@ class DeckConf(QDialog):
|
||||||
QDialog.__init__(self, mw)
|
QDialog.__init__(self, mw)
|
||||||
self.mw = mw
|
self.mw = mw
|
||||||
self.deck = deck or self.mw.col.decks.current()
|
self.deck = deck or self.mw.col.decks.current()
|
||||||
# context-sensitive extras like deck:foo
|
|
||||||
self.search = search
|
self.search = search
|
||||||
self.form = aqt.forms.dyndconf.Ui_Dialog()
|
self.form = aqt.forms.dyndconf.Ui_Dialog()
|
||||||
self.form.setupUi(self)
|
self.form.setupUi(self)
|
||||||
|
@ -31,6 +30,9 @@ class DeckConf(QDialog):
|
||||||
self.setWindowTitle(_("Options for %s") % self.deck['name'])
|
self.setWindowTitle(_("Options for %s") % self.deck['name'])
|
||||||
self.setupOrder()
|
self.setupOrder()
|
||||||
self.loadConf()
|
self.loadConf()
|
||||||
|
if search:
|
||||||
|
self.form.search.setText(search)
|
||||||
|
self.form.search.selectAll()
|
||||||
self.show()
|
self.show()
|
||||||
self.exec_()
|
self.exec_()
|
||||||
|
|
||||||
|
|
|
@ -715,6 +715,10 @@ and check the statistics for a home deck instead."""))
|
||||||
def onCram(self, search=""):
|
def onCram(self, search=""):
|
||||||
import aqt.dyndeckconf
|
import aqt.dyndeckconf
|
||||||
n = 1
|
n = 1
|
||||||
|
if not search:
|
||||||
|
deck = self.col.decks.current()
|
||||||
|
if not deck['dyn']:
|
||||||
|
search = 'deck:%s ' % deck['name']
|
||||||
decks = self.col.decks.allNames()
|
decks = self.col.decks.allNames()
|
||||||
while _("Filtered Deck %d") % n in decks:
|
while _("Filtered Deck %d") % n in decks:
|
||||||
n += 1
|
n += 1
|
||||||
|
|
Loading…
Reference in a new issue