From 4870f3ee87003aca9eb3f8e830e01ed841ca76a2 Mon Sep 17 00:00:00 2001 From: serversdown Date: Wed, 20 May 2026 04:06:53 +0000 Subject: [PATCH 1/2] feat: enhance settings dialog and update check logging --- thor_settings_dialog.py | 19 ++++++++++++++----- thor_tray.py | 13 ++++++++----- 2 files changed, 22 insertions(+), 10 deletions(-) diff --git a/thor_settings_dialog.py b/thor_settings_dialog.py index 34e0554..19eb9e6 100644 --- a/thor_settings_dialog.py +++ b/thor_settings_dialog.py @@ -487,12 +487,21 @@ class SettingsDialog: def _build_tab_updates(self, nb): f = self._tab_frame(nb, "Updates") - tk.Label(f, text="Auto-Update Source", anchor="w").grid( + # Current version display + tk.Label(f, text="Current Version", anchor="w").grid( row=0, column=0, sticky="w", padx=(8, 4), pady=(8, 2) ) + tk.Label( + f, text="v{}".format(watcher.VERSION), anchor="w", + font=("TkDefaultFont", 9, "bold"), + ).grid(row=0, column=1, sticky="w", padx=(0, 8), pady=(8, 2)) + + tk.Label(f, text="Auto-Update Source", anchor="w").grid( + row=1, column=0, sticky="w", padx=(8, 4), pady=(8, 2) + ) radio_frame = tk.Frame(f) - radio_frame.grid(row=0, column=1, sticky="w", padx=(0, 8), pady=(8, 2)) + radio_frame.grid(row=1, column=1, sticky="w", padx=(0, 8), pady=(8, 2)) ttk.Radiobutton( radio_frame, text="Gitea (default)", @@ -513,10 +522,10 @@ class SettingsDialog: ).grid(row=0, column=2, sticky="w") tk.Label(f, text="Update Server URL", anchor="w").grid( - row=1, column=0, sticky="w", padx=(8, 4), pady=4 + row=2, column=0, sticky="w", padx=(8, 4), pady=4 ) self._update_url_entry = ttk.Entry(f, textvariable=self.var_update_url, width=42) - self._update_url_entry.grid(row=1, column=1, sticky="ew", padx=(0, 8), pady=4) + self._update_url_entry.grid(row=2, column=1, sticky="ew", padx=(0, 8), pady=4) tk.Label( f, @@ -528,7 +537,7 @@ class SettingsDialog: "still works when disabled." ), justify="left", fg="#555555", wraplength=380, - ).grid(row=2, column=0, columnspan=2, sticky="w", padx=(8, 8), pady=(4, 8)) + ).grid(row=3, column=0, columnspan=2, sticky="w", padx=(8, 8), pady=(4, 8)) self._on_update_source_change() diff --git a/thor_tray.py b/thor_tray.py index f2212db..5bcf8b2 100644 --- a/thor_tray.py +++ b/thor_tray.py @@ -126,17 +126,17 @@ def check_for_update(): cfg = _read_config() update_source = str(cfg.get("update_source", "gitea")).strip().lower() update_url = str(cfg.get("update_url", "")).strip() - except Exception: + except Exception as exc: + _update_log("config read failed in check_for_update: {} — defaulting to gitea".format(exc)) update_source = "gitea" update_url = "" - if update_source == "disabled": - return None, None - _update_log("Checking for update (source={}, version={})".format( update_source, _CURRENT_VERSION )) + if update_source == "disabled": + return None, None if update_source == "url": return _check_for_update_url(update_url) else: @@ -472,8 +472,11 @@ class WatcherTray: def _icon_updater(self): """Periodically refresh the tray icon and check for updates.""" + _update_log("Updater thread started (version={}, first check in ~30s)".format(_CURRENT_VERSION)) last_status = None - update_check_counter = 0 # check every ~5 min (30 × 10s ticks) + # Initial first-check fires at counter==3 (~30s) so we get a confirmation + # line in the log soon after startup; subsequent checks every ~5 min. + update_check_counter = 27 while not self.stop_event.is_set(): icon_status = self._tray_status() -- 2.52.0 From 5340332f32fd04ba3c6fc5a6dece86ac6bc3d097 Mon Sep 17 00:00:00 2001 From: serversdown Date: Mon, 1 Jun 2026 21:29:14 +0000 Subject: [PATCH 2/2] chore: bump to version 0.3.1 --- CHANGELOG.md | 7 +++++++ README.md | 6 +++--- installer.iss | 2 +- series4_ingest.py | 4 ++-- thor_settings_dialog.py | 2 +- thor_tray.py | 2 +- 6 files changed, 15 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ced8640..fc6fb7a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,13 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [0.3.1] - 2026-05-20 + +### Hot fix +- Improved update logging +- Improved update settings + + ## [0.3.0] - 2026-05-19 ### Added diff --git a/README.md b/README.md index 8a558ee..f2e74d1 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Thor Watcher -**Version:** 0.3.0 +**Version:** 0.3.1 Micromate (Series 4) watcher agent for Terra-View fleet management. Runs as a Windows system tray application, scans THORDATA for Micromate unit activity, sends heartbeat data to Terra-View, and (optionally) forwards `.IDFH`/`.IDFW` event files to a seismo-relay SFM server. @@ -29,7 +29,7 @@ build.bat ``` Produces: -- `dist\thor-watcher-0.3.0.exe` — upload to Gitea release +- `dist\thor-watcher-0.3.1.exe` — upload to Gitea release - `dist\thor-watcher.exe` — use with Inno Setup Then run Inno Setup Compiler on `installer.iss` to produce `thor-watcher-setup.exe`. @@ -121,7 +121,7 @@ Posted to `api_url` on each API interval: { "source_id": "THOR-PC", "source_type": "series4_watcher", - "version": "0.3.0", + "version": "0.3.1", "generated_at": "2026-03-20T14:30:00Z", "log_tail": ["...last 25 log lines..."], "units": [ diff --git a/installer.iss b/installer.iss index ec54dd0..018b932 100644 --- a/installer.iss +++ b/installer.iss @@ -3,7 +3,7 @@ [Setup] AppName=Thor Watcher -AppVersion=0.2.0 +AppVersion=0.3.1 AppPublisher=Terra-Mechanics Inc. DefaultDirName={pf}\ThorWatcher DefaultGroupName=Thor Watcher diff --git a/series4_ingest.py b/series4_ingest.py index fcacc40..638a977 100644 --- a/series4_ingest.py +++ b/series4_ingest.py @@ -1,5 +1,5 @@ """ -Thor Watcher — Series 4 Ingest Agent v0.3.0 +Thor Watcher — Series 4 Ingest Agent v0.3.1 Micromate (Series 4) ingest agent for Terra-View. @@ -29,7 +29,7 @@ import event_forwarder # ── Version ─────────────────────────────────────────────────────────────────── -VERSION = "0.3.0" +VERSION = "0.3.1" # ── Config ──────────────────────────────────────────────────────────────────── diff --git a/thor_settings_dialog.py b/thor_settings_dialog.py index 19eb9e6..d17746e 100644 --- a/thor_settings_dialog.py +++ b/thor_settings_dialog.py @@ -1,5 +1,5 @@ """ -Thor Watcher — Settings Dialog v0.3.0 +Thor Watcher — Settings Dialog v0.3.1 Provides a Tkinter settings dialog that doubles as a first-run wizard. diff --git a/thor_tray.py b/thor_tray.py index 5bcf8b2..506e64d 100644 --- a/thor_tray.py +++ b/thor_tray.py @@ -1,5 +1,5 @@ """ -Thor Watcher — System Tray Launcher v0.3.0 +Thor Watcher — System Tray Launcher v0.3.1 Requires: pystray, Pillow, tkinter (stdlib) Run with: pythonw thor_tray.py (no console window) -- 2.52.0