Use backend nid filter in addcards and mediacheck
This commit is contained in:
parent
da6f3b7e76
commit
a930aa41f0
@ -144,7 +144,7 @@ class AddCards(QDialog):
|
|||||||
def onHistory(self) -> None:
|
def onHistory(self) -> None:
|
||||||
m = QMenu(self)
|
m = QMenu(self)
|
||||||
for nid in self.history:
|
for nid in self.history:
|
||||||
if self.mw.col.findNotes("nid:%s" % nid):
|
if self.mw.col.findNotes(self.col.search_string(nids=[nid])):
|
||||||
note = self.mw.col.getNote(nid)
|
note = self.mw.col.getNote(nid)
|
||||||
fields = note.fields
|
fields = note.fields
|
||||||
txt = htmlToTextLine(", ".join(fields))
|
txt = htmlToTextLine(", ".join(fields))
|
||||||
@ -162,7 +162,7 @@ class AddCards(QDialog):
|
|||||||
|
|
||||||
def editHistory(self, nid):
|
def editHistory(self, nid):
|
||||||
browser = aqt.dialogs.open("Browser", self.mw)
|
browser = aqt.dialogs.open("Browser", self.mw)
|
||||||
browser.form.searchEdit.lineEdit().setText("nid:%d" % nid)
|
browser.form.searchEdit.lineEdit().setText(self.col.search_string(nids=[nid]))
|
||||||
browser.onSearchActivated()
|
browser.onSearchActivated()
|
||||||
|
|
||||||
def addNote(self, note) -> Optional[Note]:
|
def addNote(self, note) -> Optional[Note]:
|
||||||
|
@ -1705,7 +1705,7 @@ where id in %s"""
|
|||||||
t += (
|
t += (
|
||||||
"""<li><a href=# onclick="pycmd('%s');return false;">%s</a>: %s</a>"""
|
"""<li><a href=# onclick="pycmd('%s');return false;">%s</a>: %s</a>"""
|
||||||
% (
|
% (
|
||||||
self.col.search_string(nids=nids).replace('"', '"'),
|
self.col.search_string(nids=nids).replace('"', """),
|
||||||
tr(TR.BROWSING_NOTE_COUNT, count=len(nids)),
|
tr(TR.BROWSING_NOTE_COUNT, count=len(nids)),
|
||||||
html.escape(val),
|
html.escape(val),
|
||||||
)
|
)
|
||||||
|
@ -146,7 +146,8 @@ class MediaChecker:
|
|||||||
if out is not None:
|
if out is not None:
|
||||||
nid, err = out
|
nid, err = out
|
||||||
browser = aqt.dialogs.open("Browser", self.mw)
|
browser = aqt.dialogs.open("Browser", self.mw)
|
||||||
browser.form.searchEdit.lineEdit().setText("nid:%d" % nid)
|
search = self.mw.col.search_string(nids=[nid])
|
||||||
|
browser.form.searchEdit.lineEdit().setText(search)
|
||||||
browser.onSearchActivated()
|
browser.onSearchActivated()
|
||||||
showText(err, type="html")
|
showText(err, type="html")
|
||||||
else:
|
else:
|
||||||
|
Loading…
Reference in New Issue
Block a user