Moved the utils.py new save/restore functions together
This commit is contained in:
parent
38fba41fb2
commit
947f58032f
@ -470,6 +470,28 @@ def restoreState(widget, key: str):
|
|||||||
widget.restoreState(aqt.mw.pm.profile[key])
|
widget.restoreState(aqt.mw.pm.profile[key])
|
||||||
|
|
||||||
|
|
||||||
|
def saveSplitter(widget, key):
|
||||||
|
key += "Splitter"
|
||||||
|
aqt.mw.pm.profile[key] = widget.saveState()
|
||||||
|
|
||||||
|
|
||||||
|
def restoreSplitter(widget, key):
|
||||||
|
key += "Splitter"
|
||||||
|
if aqt.mw.pm.profile.get(key):
|
||||||
|
widget.restoreState(aqt.mw.pm.profile[key])
|
||||||
|
|
||||||
|
|
||||||
|
def saveHeader(widget, key):
|
||||||
|
key += "Header"
|
||||||
|
aqt.mw.pm.profile[key] = widget.saveState()
|
||||||
|
|
||||||
|
|
||||||
|
def restoreHeader(widget, key):
|
||||||
|
key += "Header"
|
||||||
|
if aqt.mw.pm.profile.get(key):
|
||||||
|
widget.restoreState(aqt.mw.pm.profile[key])
|
||||||
|
|
||||||
|
|
||||||
def save_is_checked(widget, key: str):
|
def save_is_checked(widget, key: str):
|
||||||
key += "IsChecked"
|
key += "IsChecked"
|
||||||
aqt.mw.pm.profile[key] = widget.isChecked()
|
aqt.mw.pm.profile[key] = widget.isChecked()
|
||||||
@ -524,28 +546,6 @@ def restore_combo_history(comboBox: QComboBox, name: str):
|
|||||||
return history
|
return history
|
||||||
|
|
||||||
|
|
||||||
def saveSplitter(widget, key):
|
|
||||||
key += "Splitter"
|
|
||||||
aqt.mw.pm.profile[key] = widget.saveState()
|
|
||||||
|
|
||||||
|
|
||||||
def restoreSplitter(widget, key):
|
|
||||||
key += "Splitter"
|
|
||||||
if aqt.mw.pm.profile.get(key):
|
|
||||||
widget.restoreState(aqt.mw.pm.profile[key])
|
|
||||||
|
|
||||||
|
|
||||||
def saveHeader(widget, key):
|
|
||||||
key += "Header"
|
|
||||||
aqt.mw.pm.profile[key] = widget.saveState()
|
|
||||||
|
|
||||||
|
|
||||||
def restoreHeader(widget, key):
|
|
||||||
key += "Header"
|
|
||||||
if aqt.mw.pm.profile.get(key):
|
|
||||||
widget.restoreState(aqt.mw.pm.profile[key])
|
|
||||||
|
|
||||||
|
|
||||||
def mungeQA(col, txt):
|
def mungeQA(col, txt):
|
||||||
print("mungeQA() deprecated; use mw.prepare_card_text_for_display()")
|
print("mungeQA() deprecated; use mw.prepare_card_text_for_display()")
|
||||||
txt = col.media.escapeImages(txt)
|
txt = col.media.escapeImages(txt)
|
||||||
|
Loading…
Reference in New Issue
Block a user