summaryrefslogtreecommitdiff
path: root/labui.spec
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 /labui.spec
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 'labui.spec')
-rw-r--r--labui.spec21
1 files changed, 21 insertions, 0 deletions
diff --git a/labui.spec b/labui.spec
index 71d50dd..0fdbedc 100644
--- a/labui.spec
+++ b/labui.spec
@@ -81,3 +81,24 @@ coll = COLLECT(
upx_exclude=[],
name="LabUI",
)
+
+# macOS: wrap the onedir output in a real .app bundle. Required for both a
+# double-clickable Finder app AND file association — CFBundleDocumentTypes
+# here is what tells Finder/LaunchServices that LabUI opens .labui files
+# (core/file_association.py doesn't need to do anything at runtime on this
+# platform, unlike Windows/Linux, because of this).
+if sys.platform == "darwin":
+ app = BUNDLE(
+ coll,
+ name="LabUI.app",
+ bundle_identifier="org.labui.LabUI", # placeholder — swap for a real reverse-DNS id
+ info_plist={
+ "CFBundleDocumentTypes": [{
+ "CFBundleTypeName": "LabUI Profile",
+ "CFBundleTypeExtensions": ["labui"],
+ "CFBundleTypeRole": "Editor",
+ "LSHandlerRank": "Owner",
+ }],
+ "NSHighResolutionCapable": True,
+ },
+ )