diff --git a/aqt/dyndeckconf.py b/aqt/dyndeckconf.py index b1b1e7924..9f2b52258 100644 --- a/aqt/dyndeckconf.py +++ b/aqt/dyndeckconf.py @@ -13,7 +13,6 @@ class DeckConf(QDialog): QDialog.__init__(self, mw) self.mw = mw self.deck = deck or self.mw.col.decks.current() - # context-sensitive extras like deck:foo self.search = search self.form = aqt.forms.dyndconf.Ui_Dialog() self.form.setupUi(self) @@ -31,6 +30,9 @@ class DeckConf(QDialog): self.setWindowTitle(_("Options for %s") % self.deck['name']) self.setupOrder() self.loadConf() + if search: + self.form.search.setText(search) + self.form.search.selectAll() self.show() self.exec_() diff --git a/aqt/main.py b/aqt/main.py index 716353870..0e5cda4cf 100644 --- a/aqt/main.py +++ b/aqt/main.py @@ -715,6 +715,10 @@ and check the statistics for a home deck instead.""")) def onCram(self, search=""): import aqt.dyndeckconf n = 1 + if not search: + deck = self.col.decks.current() + if not deck['dyn']: + search = 'deck:%s ' % deck['name'] decks = self.col.decks.allNames() while _("Filtered Deck %d") % n in decks: n += 1