From e749cca30da2d02839aca736873e7e5ad45e191c Mon Sep 17 00:00:00 2001 From: Christian Kolset Date: Mon, 17 Aug 2026 10:01:59 -0600 Subject: Add .labui file association — open by double-click, cross-platform MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Windows/Linux self-register via core/file_association.py (winreg / XDG .desktop+mime), triggered from a new Settings button since there's no installer to do it at install time. macOS gets it at build time via labui.spec's new BUNDLE() step (CFBundleDocumentTypes in Info.plist) — that step also makes mac builds a real .app bundle for the first time, not just a bare onedir folder. main.py gains a LabUIApplication subclass to catch the macOS QFileOpenEvent (buffered if it arrives before MainWindow exists) plus argv[1] handling for Windows/Linux. ProfileButton.load_path() extracted so both paths share the same load-and-apply logic as the existing file-dialog flow. Co-Authored-By: Claude Sonnet 5 --- ui/main_window.py | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'ui/main_window.py') diff --git a/ui/main_window.py b/ui/main_window.py index 012d6f5..b632535 100644 --- a/ui/main_window.py +++ b/ui/main_window.py @@ -601,6 +601,11 @@ class MainWindow(QMainWindow): # ── Profile callbacks ───────────────────────────────────────────────── + def load_profile_path(self, path: str) -> bool: + """Load a .labui file from an explicit path — used when one is + opened from the OS (double-click / CLI argv), see main.py.""" + return self._file_btn.load_path(path) + def _profile_new(self): """Reset to a blank slate.""" # Clear devices -- cgit v1.2.3