summaryrefslogtreecommitdiff
path: root/ui/main_window.py
diff options
context:
space:
mode:
authorChristian Kolset <christian.kolset@gmail.com>2026-06-03 12:53:35 -0600
committerChristian Kolset <christian.kolset@gmail.com>2026-06-03 12:53:35 -0600
commit6edbeba5d93569cd4f8f00670399c86909047bab (patch)
tree4af17f2f6029281bfadd676b64f17d9c1798bcd6 /ui/main_window.py
parent6fb559b64682d6f564d134b8937a688df59ed8e5 (diff)
Persist settings per-computer; add Reset to Defaults in General tab
- New core/app_settings.py: load/save settings.json to platform config dir (Windows: %APPDATA%, Linux: ~/.config, macOS: ~/Library/Application Support) - MainWindow loads saved settings on startup, saves on every Apply & Close - Settings survive profile switches and app restarts independently of profiles - Settings > General: Reset to Defaults button with QMessageBox confirmation Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Diffstat (limited to 'ui/main_window.py')
-rw-r--r--ui/main_window.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/ui/main_window.py b/ui/main_window.py
index 7527a8a..ea299e7 100644
--- a/ui/main_window.py
+++ b/ui/main_window.py
@@ -45,6 +45,7 @@ from ui.windows.settings_window import SettingsWindow
from plugins.plugin_manager import PluginManager
from plugins.base_plugin import PluginContext
+from core.app_settings import load_settings, save_settings
_DARK_QSS = os.path.join(os.path.dirname(os.path.abspath(__file__)), "style_dark.qss")
@@ -60,7 +61,7 @@ class MainWindow(QMainWindow):
self.registry = DeviceRegistry()
self.engine = AcquisitionEngine(poll_interval_ms=100)
self.processor = SignalProcessor()
- self._settings = dict(SettingsWindow._defaults)
+ self._settings = load_settings(SettingsWindow._defaults)
self._elapsed = 0
self._win_devices = None
@@ -548,6 +549,7 @@ class MainWindow(QMainWindow):
def _on_settings(self, cfg: dict):
self._settings.update(cfg)
self.engine._interval = cfg.get("poll_ms", 100) / 1000.0
+ save_settings(self._settings)
def _tick(self):
self._elapsed += 1