mirror of
https://github.com/ankitects/anki.git
synced 2025-09-19 14:32:22 -04:00
Add exception handling for filter modifications
This commit is contained in:
parent
d9f7d2e70d
commit
539f701573
1 changed files with 21 additions and 17 deletions
|
@ -1219,6 +1219,7 @@ QTableView {{ gridline-color: {grid} }}
|
||||||
items.append(txt)
|
items.append(txt)
|
||||||
txt = ""
|
txt = ""
|
||||||
txt = " AND ".join(items)
|
txt = " AND ".join(items)
|
||||||
|
try:
|
||||||
if self.mw.app.keyboardModifiers() & Qt.AltModifier:
|
if self.mw.app.keyboardModifiers() & Qt.AltModifier:
|
||||||
txt = self.col.backend.negate_search(txt)
|
txt = self.col.backend.negate_search(txt)
|
||||||
cur = str(self.form.searchEdit.lineEdit().text())
|
cur = str(self.form.searchEdit.lineEdit().text())
|
||||||
|
@ -1234,6 +1235,9 @@ QTableView {{ gridline-color: {grid} }}
|
||||||
txt = self.col.backend.concatenate_searches(
|
txt = self.col.backend.concatenate_searches(
|
||||||
sep=pb.ConcatenateSearchesIn.Separator.OR, searches=[cur, txt]
|
sep=pb.ConcatenateSearchesIn.Separator.OR, searches=[cur, txt]
|
||||||
)
|
)
|
||||||
|
except InvalidInput as e:
|
||||||
|
showWarning(str(e))
|
||||||
|
else:
|
||||||
self.form.searchEdit.lineEdit().setText(txt)
|
self.form.searchEdit.lineEdit().setText(txt)
|
||||||
self.onSearchActivated()
|
self.onSearchActivated()
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue