mirror of
https://github.com/ankitects/anki.git
synced 2025-12-10 21:36:55 -05:00
Moved restoreComboHistory below saveComboHistory as others
This commit is contained in:
parent
87d051fa71
commit
4bc895f7df
1 changed files with 9 additions and 9 deletions
|
|
@ -498,15 +498,6 @@ def restoreComboIndex(widget: QComboBox, history: List[str], key: str):
|
||||||
widget.setCurrentIndex(index)
|
widget.setCurrentIndex(index)
|
||||||
|
|
||||||
|
|
||||||
def restoreComboHistory(comboBox: QComboBox, name: str):
|
|
||||||
name += "BoxHistory"
|
|
||||||
history = aqt.mw.pm.profile.get(name, [])
|
|
||||||
comboBox.addItems(history)
|
|
||||||
comboBox.lineEdit().setText(history[0] if history else "")
|
|
||||||
comboBox.lineEdit().selectAll()
|
|
||||||
return history
|
|
||||||
|
|
||||||
|
|
||||||
def saveComboHistory(comboBox: QComboBox, history: List[str], name: str):
|
def saveComboHistory(comboBox: QComboBox, history: List[str], name: str):
|
||||||
name += "BoxHistory"
|
name += "BoxHistory"
|
||||||
text_input = comboBox.lineEdit().text()
|
text_input = comboBox.lineEdit().text()
|
||||||
|
|
@ -520,6 +511,15 @@ def saveComboHistory(comboBox: QComboBox, history: List[str], name: str):
|
||||||
return text_input
|
return text_input
|
||||||
|
|
||||||
|
|
||||||
|
def restoreComboHistory(comboBox: QComboBox, name: str):
|
||||||
|
name += "BoxHistory"
|
||||||
|
history = aqt.mw.pm.profile.get(name, [])
|
||||||
|
comboBox.addItems(history)
|
||||||
|
comboBox.lineEdit().setText(history[0] if history else "")
|
||||||
|
comboBox.lineEdit().selectAll()
|
||||||
|
return history
|
||||||
|
|
||||||
|
|
||||||
def saveSplitter(widget, key):
|
def saveSplitter(widget, key):
|
||||||
key += "Splitter"
|
key += "Splitter"
|
||||||
aqt.mw.pm.profile[key] = widget.saveState()
|
aqt.mw.pm.profile[key] = widget.saveState()
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue