Skip to content

Commit

Permalink
@mbridak Save and load use call history flag in the settings.
Browse files Browse the repository at this point in the history
  • Loading branch information
mbridak committed Nov 2, 2024
1 parent bf62ad5 commit dd3e41f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 2 additions & 0 deletions not1mm/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,7 @@ class MainWindow(QtWidgets.QMainWindow):
text_color = QColorConstants.Black
current_palette = None
use_esm = False
use_call_history = False
esm_dict = {}

radio_thread = QThread()
Expand Down Expand Up @@ -2950,6 +2951,7 @@ def readpreferences(self) -> None:
"DISABLED": None,
}

self.use_call_history = self.pref.get("use_call_history", False)
self.use_esm = self.pref.get("use_esm", False)
self.esm_dict["CQ"] = fkey_dict.get(self.pref.get("esm_cq", "DISABLED"))
self.esm_dict["EXCH"] = fkey_dict.get(self.pref.get("esm_exch", "DISABLED"))
Expand Down
7 changes: 6 additions & 1 deletion not1mm/lib/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,11 @@ def __init__(self, app_data_path, pref, parent=None):
def setup(self):
"""setup dialog"""

self.use_esm.setChecked(bool(self.preference.get("use_esm")))
self.use_call_history.setChecked(
bool(self.preference.get("use_call_history", False))
)

self.use_esm.setChecked(bool(self.preference.get("use_esm", False)))

value = self.preference.get("esm_agn", "DISABLED")
index = self.esm_agn.findText(value)
Expand Down Expand Up @@ -190,6 +194,7 @@ def save_changes(self):
"""
Write preferences to json file.
"""
self.preference["use_call_history"] = self.use_call_history.isChecked()
self.preference["use_esm"] = self.use_esm.isChecked()
self.preference["esm_cq"] = self.esm_cq.currentText()
self.preference["esm_agn"] = self.esm_agn.currentText()
Expand Down

0 comments on commit dd3e41f

Please sign in to comment.