diff --git a/ftl/core/search.ftl b/ftl/core/search.ftl index 4f7fc10bc..768d77109 100644 --- a/ftl/core/search.ftl +++ b/ftl/core/search.ftl @@ -35,3 +35,5 @@ search-card-modified = Card Modified ## +# Tooltip for search lines outside browser +search-view-in-browser = View in browser diff --git a/qt/aqt/dyndeckconf.py b/qt/aqt/dyndeckconf.py index 44e955bc6..e73fe7072 100644 --- a/qt/aqt/dyndeckconf.py +++ b/qt/aqt/dyndeckconf.py @@ -71,6 +71,7 @@ class DeckConf(QDialog): without_unicode_isolation(tr(TR.ACTIONS_OPTIONS_FOR, val=self.deck["name"])) ) self.form.buttonBox.addButton(label, QDialogButtonBox.AcceptRole) + self.form.search.setFocus() self.form.search.selectAll() if self.mw.col.schedVer() == 1: self.form.secondFilter.setVisible(False) @@ -83,7 +84,8 @@ class DeckConf(QDialog): ): if search is not None: self.form.search.setText(search) - self.form.search.selectAll() + self.form.search.setFocus() + self.form.search.selectAll() def new_dyn_deck(self): suffix: int = 1 @@ -110,6 +112,8 @@ class DeckConf(QDialog): ) def initialSetup(self): + qconnect(self.form.search_button.clicked, self.on_search_button) + import anki.consts as cs self.form.order.addItems(list(cs.dynOrderLabels(self.mw.col).values())) @@ -117,6 +121,16 @@ class DeckConf(QDialog): qconnect(self.form.resched.stateChanged, self._onReschedToggled) + def on_search_button(self): + try: + search = self.mw.col.build_search_string(self.form.search.text()) + except InvalidInput as err: + self.form.search.setFocus() + self.form.search.selectAll() + show_invalid_search_error(err) + else: + aqt.dialogs.open("Browser", self.mw, search=(search,)) + def _onReschedToggled(self, _state: int): self.form.previewDelayWidget.setVisible( not self.form.resched.isChecked() and self.mw.col.schedVer() > 1 diff --git a/qt/aqt/editor.py b/qt/aqt/editor.py index c38d6c6a0..d8e950eca 100644 --- a/qt/aqt/editor.py +++ b/qt/aqt/editor.py @@ -548,7 +548,7 @@ class Editor: first_field=self.note.fields[0], ) ), - ) + ), ) def fieldsAreBlank(self, previousNote=None): diff --git a/qt/aqt/forms/dyndconf.ui b/qt/aqt/forms/dyndconf.ui index 163fd84b1..c0bdebbc8 100644 --- a/qt/aqt/forms/dyndconf.ui +++ b/qt/aqt/forms/dyndconf.ui @@ -6,7 +6,7 @@ 0 0 - 392 + 416 472 @@ -21,20 +21,44 @@ + + + + true + + + + SEARCH_VIEW_IN_BROWSER + + + QPushButton { text-align: left; color: blue; padding: 0; border: 0 } + + + ACTIONS_SEARCH + + + false + + + true + + + + DECKS_LIMIT_TO - - + + - ACTIONS_SEARCH + DECKS_CARDS_SELECTED_BY - + @@ -50,19 +74,12 @@ - - - - DECKS_CARDS_SELECTED_BY - - - - - - - + + + +