From 74c0b8979ae1faa65c1adb409235f180f1c38d88 Mon Sep 17 00:00:00 2001 From: mbridak Date: Thu, 5 Dec 2024 07:55:48 -0800 Subject: [PATCH] @mbridak Add rtc settings to dialog. --- not1mm/data/configuration.ui | 70 ++++++++++++++++++++++++++++++++++++ not1mm/lib/settings.py | 22 ++++++++++++ 2 files changed, 92 insertions(+) diff --git a/not1mm/data/configuration.ui b/not1mm/data/configuration.ui index 44852bb..f6684e8 100644 --- a/not1mm/data/configuration.ui +++ b/not1mm/data/configuration.ui @@ -2173,6 +2173,76 @@ + + + + Qt::Horizontal + + + + + + + Use RTC score reporting + + + + + + + + https://hamscore.com/postxml/ + + + + + https://contestonlinescore.com/post/ + + + + + http://contest.run + + + + + + + + username + + + + + + + QLineEdit::EchoMode::Password + + + password + + + + + + + Score posting interval (minutes) + + + Qt::AlignCenter + + + + + + + 2 + + + Qt::AlignCenter + + + diff --git a/not1mm/lib/settings.py b/not1mm/lib/settings.py index 4a5f5b3..38dc93b 100644 --- a/not1mm/lib/settings.py +++ b/not1mm/lib/settings.py @@ -41,6 +41,19 @@ def __init__(self, app_data_path, pref, parent=None): def setup(self): """setup dialog""" + self.send_rtc_scores.setChecked( + bool(self.preference.get("send_rtc_scores", False)) + ) + + value = self.preference.get("rtc_url", "") + index = self.rtc_url.findText(value) + if index != -1: + self.rtc_url.setCurrentIndex(index) + + self.rtc_user.setText(str(self.preference.get("rtc_user", ""))) + self.rtc_pass.setText(str(self.preference.get("rtc_pass", ""))) + self.rtc_interval.setText(str(self.preference.get("rtc_interval", "2"))) + self.use_call_history.setChecked( bool(self.preference.get("use_call_history", False)) ) @@ -195,6 +208,15 @@ def save_changes(self): """ Write preferences to json file. """ + self.preference["send_rtc_scores"] = self.send_rtc_scores.isChecked() + self.preference["rtc_url"] = self.rtc_url.currentText() + self.preference["rtc_user"] = self.rtc_user.text() + self.preference["rtc_pass"] = self.rtc_pass.text() + try: + self.preference["rtc_interval"] = int(self.rtc_interval.text()) + except ValueError: + self.preference["rtc_interval"] = 2 + 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()