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/profile_manager_ui.py | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'ui/profile_manager_ui.py') diff --git a/ui/profile_manager_ui.py b/ui/profile_manager_ui.py index 446e867..79f333e 100644 --- a/ui/profile_manager_ui.py +++ b/ui/profile_manager_ui.py @@ -85,13 +85,21 @@ class ProfileButton(QPushButton): ) if not path: return + self.load_path(path) + + def load_path(self, path: str) -> bool: + """Load a profile from an explicit path — shared by the file dialog + above and by opening a .labui file from the OS (double-click / CLI + argv), see main.py.""" try: profile = Profile.load(path) self._apply_profile(profile) self._current_path = path self._update_title(profile.name) + return True except Exception as e: QMessageBox.critical(self, "Load Failed", str(e)) + return False def _do_save(self): if not self._current_path: -- cgit v1.2.3