mirror of
https://github.com/ankitects/anki.git
synced 2025-09-19 14:32:22 -04:00
Set to browser.py finddupes.ui remember the last search text
https://anki.tenderapp.com/discussions/ankidesktop/39468-find-and-replace-does-not-remember-the-input-from-last-time
This commit is contained in:
parent
a74e43a515
commit
a78b3d522e
2 changed files with 18 additions and 4 deletions
|
@ -2013,6 +2013,8 @@ update cards set usn=?, mod=?, did=? where id in """
|
||||||
frm = aqt.forms.finddupes.Ui_Dialog()
|
frm = aqt.forms.finddupes.Ui_Dialog()
|
||||||
frm.setupUi(d)
|
frm.setupUi(d)
|
||||||
restoreGeom(d, "findDupes")
|
restoreGeom(d, "findDupes")
|
||||||
|
searchHistory = setupComboBoxHistory(frm.search, "findDupesFind")
|
||||||
|
|
||||||
fields = sorted(
|
fields = sorted(
|
||||||
anki.find.fieldNames(self.col, downcase=False), key=lambda x: x.lower()
|
anki.find.fieldNames(self.col, downcase=False), key=lambda x: x.lower()
|
||||||
)
|
)
|
||||||
|
@ -2030,10 +2032,9 @@ update cards set usn=?, mod=?, did=? where id in """
|
||||||
qconnect(d.finished, onFin)
|
qconnect(d.finished, onFin)
|
||||||
|
|
||||||
def onClick():
|
def onClick():
|
||||||
|
search_text = saveComboBoxHistory(frm.search, searchHistory, "findDupesFind")
|
||||||
field = fields[frm.fields.currentIndex()]
|
field = fields[frm.fields.currentIndex()]
|
||||||
self.duplicatesReport(
|
self.duplicatesReport(frm.webView, field, search_text, frm, web_context)
|
||||||
frm.webView, field, frm.search.text(), frm, web_context
|
|
||||||
)
|
|
||||||
|
|
||||||
search = frm.buttonBox.addButton(_("Search"), QDialogButtonBox.ActionRole)
|
search = frm.buttonBox.addButton(_("Search"), QDialogButtonBox.ActionRole)
|
||||||
qconnect(search.clicked, onClick)
|
qconnect(search.clicked, onClick)
|
||||||
|
|
|
@ -34,7 +34,20 @@
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="2" column="2" colspan="2">
|
<item row="2" column="2" colspan="2">
|
||||||
<widget class="QLineEdit" name="search"/>
|
<widget class="QComboBox" name="search">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
|
||||||
|
<horstretch>9</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="editable">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
<property name="insertPolicy">
|
||||||
|
<enum>QComboBox::NoInsert</enum>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
|
|
Loading…
Reference in a new issue