Renamed save_combo_index to save_combo_index_for_session

This commit is contained in:
evandrocoan 2020-06-08 15:54:20 -03:00
parent 1d32873869
commit 38fba41fb2
2 changed files with 8 additions and 8 deletions

View File

@ -37,14 +37,14 @@ from aqt.utils import (
openHelp,
qtMenuShortcutWorkaround,
restore_combo_history,
restore_combo_index,
restore_combo_index_for_session,
restore_is_checked,
restoreGeom,
restoreHeader,
restoreSplitter,
restoreState,
save_combo_history,
save_combo_index,
save_combo_index_for_session,
save_is_checked,
saveGeom,
saveHeader,
@ -1946,7 +1946,7 @@ update cards set usn=?, mod=?, did=? where id in """
frm.find.setFocus()
allfields = [_("All Fields")] + fields
frm.field.addItems(allfields)
restore_combo_index(frm.field, allfields, combo + "Field")
restore_combo_index_for_session(frm.field, allfields, combo + "Field")
qconnect(frm.buttonBox.helpRequested, self.onFindReplaceHelp)
restoreGeom(d, "findreplace")
r = d.exec_()
@ -1954,7 +1954,7 @@ update cards set usn=?, mod=?, did=? where id in """
if not r:
return
save_combo_index(frm.field, combo + "Field")
save_combo_index_for_session(frm.field, combo + "Field")
if frm.field.currentIndex() == 0:
field = None
else:
@ -2019,7 +2019,7 @@ update cards set usn=?, mod=?, did=? where id in """
anki.find.fieldNames(self.col, downcase=False), key=lambda x: x.lower()
)
frm.fields.addItems(fields)
restore_combo_index(frm.fields, fields, "findDupesFields")
restore_combo_index_for_session(frm.fields, fields, "findDupesFields")
self._dupesButton = None
# links
@ -2035,7 +2035,7 @@ update cards set usn=?, mod=?, did=? where id in """
def onClick():
search_text = save_combo_history(frm.search, searchHistory, "findDupesFind")
save_combo_index(frm.fields, "findDupesFields")
save_combo_index_for_session(frm.fields, "findDupesFields")
field = fields[frm.fields.currentIndex()]
self.duplicatesReport(frm.webView, field, search_text, frm, web_context)

View File

@ -481,14 +481,14 @@ def restore_is_checked(widget, key: str):
widget.setChecked(aqt.mw.pm.profile[key])
def save_combo_index(widget: QComboBox, key: str):
def save_combo_index_for_session(widget: QComboBox, key: str):
textKey = key + "ComboActiveText"
indexKey = key + "ComboActiveIndex"
aqt.mw.pm.session[textKey] = widget.currentText()
aqt.mw.pm.session[indexKey] = widget.currentIndex()
def restore_combo_index(widget: QComboBox, history: List[str], key: str):
def restore_combo_index_for_session(widget: QComboBox, history: List[str], key: str):
textKey = key + "ComboActiveText"
indexKey = key + "ComboActiveIndex"
text = aqt.mw.pm.session.get(textKey)