summaryrefslogtreecommitdiff
path: root/ui/profile_manager_ui.py
diff options
context:
space:
mode:
authorChristian Kolset <ckolset@colostate.edu>2026-08-17 10:01:59 -0600
committerChristian Kolset <ckolset@colostate.edu>2026-08-17 10:01:59 -0600
commite749cca30da2d02839aca736873e7e5ad45e191c (patch)
treeca57d9ce2ff6a6f33193a59216be17b3b159c1af /ui/profile_manager_ui.py
parent34c12b2b5b280206890cd03153b1c95116acc85e (diff)
Add .labui file association — open by double-click, cross-platform
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 <noreply@anthropic.com>
Diffstat (limited to 'ui/profile_manager_ui.py')
-rw-r--r--ui/profile_manager_ui.py8
1 files changed, 8 insertions, 0 deletions
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: