mirror of
https://github.com/ankitects/anki.git
synced 2026-01-14 06:23:57 -05:00
Add search_for method
This commit is contained in:
parent
74981145cf
commit
ae26e2fc70
1 changed files with 5 additions and 0 deletions
|
|
@ -794,6 +794,11 @@ class Browser(QMainWindow):
|
|||
self._lastSearchTxt = txt
|
||||
self.search()
|
||||
|
||||
def search_for(self, search: str, prompt: Optional[str] = None) -> None:
|
||||
self._lastSearchTxt = search
|
||||
self.form.searchEdit.lineEdit().setText(prompt or search)
|
||||
self.search()
|
||||
|
||||
# search triggered programmatically. caller must have saved note first.
|
||||
def search(self) -> None:
|
||||
if "is:current" in self._lastSearchTxt:
|
||||
|
|
|
|||
Loading…
Reference in a new issue