Set to browser.py finddupes.ui remember the last selected field

https://anki.tenderapp.com/discussions/ankidesktop/39468-find-and-replace-does-not-remember-the-input-from-last-time
This commit is contained in:
evandrocoan 2020-05-31 18:37:10 -03:00
parent bf55ebbd8a
commit 87d051fa71

View file

@ -2019,7 +2019,9 @@ update cards set usn=?, mod=?, did=? where id in """
anki.find.fieldNames(self.col, downcase=False), key=lambda x: x.lower() anki.find.fieldNames(self.col, downcase=False), key=lambda x: x.lower()
) )
frm.fields.addItems(fields) frm.fields.addItems(fields)
restoreComboIndex(frm.fields, fields, "findDupesFields")
self._dupesButton = None self._dupesButton = None
# links # links
frm.webView.title = "find duplicates" frm.webView.title = "find duplicates"
web_context = FindDupesDialog(dialog=d, browser=self) web_context = FindDupesDialog(dialog=d, browser=self)
@ -2033,6 +2035,7 @@ update cards set usn=?, mod=?, did=? where id in """
def onClick(): def onClick():
search_text = saveComboHistory(frm.search, searchHistory, "findDupesFind") search_text = saveComboHistory(frm.search, searchHistory, "findDupesFind")
saveComboIndex(frm.fields, "findDupesFields")
field = fields[frm.fields.currentIndex()] field = fields[frm.fields.currentIndex()]
self.duplicatesReport(frm.webView, field, search_text, frm, web_context) self.duplicatesReport(frm.webView, field, search_text, frm, web_context)