From 947f58032f94a30d151b8f104a8a109c3dd459b2 Mon Sep 17 00:00:00 2001 From: evandrocoan Date: Mon, 8 Jun 2020 15:55:25 -0300 Subject: [PATCH] Moved the utils.py new save/restore functions together --- qt/aqt/utils.py | 44 ++++++++++++++++++++++---------------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/qt/aqt/utils.py b/qt/aqt/utils.py index 8833c0944..59e936bff 100644 --- a/qt/aqt/utils.py +++ b/qt/aqt/utils.py @@ -470,6 +470,28 @@ def restoreState(widget, key: str): 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): key += "IsChecked" aqt.mw.pm.profile[key] = widget.isChecked() @@ -524,28 +546,6 @@ def restore_combo_history(comboBox: QComboBox, name: str): 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): print("mungeQA() deprecated; use mw.prepare_card_text_for_display()") txt = col.media.escapeImages(txt)