aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2022-02-24 14:42:57 +0100
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2022-02-28 16:55:11 +0100
commit5587b62fb81a95ad2fd74c6d1beb396b3503a966 (patch)
tree3408905fb2cf4facd79afa73fe775ae8c9306e85
parent1bc7d0336da951e2f8a70526c8a778548c9eb2c5 (diff)
Fix entry points for UI tools on macOS
Use the app bundle path. Amends ba96669d4ad0c31b8703231a9346218c6b92df70 and 011cad7cd2cd617427e939d737676394425bdc6b. Task-number: PYSIDE-1831 Task-number: PYSIDE-1378 Task-number: PYSIDE-1252 Change-Id: Icfe5badda3d900b8bad8f58edab6447a901d07e6 Reviewed-by: Christian Tismer <tismer@stackless.com> (cherry picked from commit 77d002b7ccf2cd8ff7844792365f317eac341c2a) Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
-rw-r--r--sources/pyside-tools/pyside_tool.py17
1 files changed, 11 insertions, 6 deletions
diff --git a/sources/pyside-tools/pyside_tool.py b/sources/pyside-tools/pyside_tool.py
index 5045c40c7..cb8394ceb 100644
--- a/sources/pyside-tools/pyside_tool.py
+++ b/sources/pyside-tools/pyside_tool.py
@@ -75,6 +75,14 @@ def qt_tool_wrapper(qt_tool, args, libexec=False):
sys.exit(proc.returncode)
+def ui_tool_binary(binary):
+ """Return the binary of a UI tool (App bundle on macOS)."""
+ if sys.platform != "darwin":
+ return binary
+ name = binary[0:1].upper() + binary[1:]
+ return f"{name}.app/Contents/MacOS/{name}"
+
+
def lrelease():
qt_tool_wrapper("lrelease", sys.argv[1:])
@@ -92,7 +100,7 @@ def rcc():
def assistant():
- qt_tool_wrapper("assistant", sys.argv[1:])
+ qt_tool_wrapper(ui_tool_binary("assistant"), sys.argv[1:])
def _append_to_path_var(var, value):
@@ -136,14 +144,11 @@ def designer():
taskmenu_dir = os.fspath(pyside_dir / 'examples' / 'designer' / 'taskmenuextension')
_append_to_path_var('PYSIDE_DESIGNER_PLUGINS', taskmenu_dir)
- if sys.platform == "darwin":
- qt_tool_wrapper("Designer.app/Contents/MacOS/Designer", sys.argv[1:])
- else:
- qt_tool_wrapper("designer", sys.argv[1:])
+ qt_tool_wrapper(ui_tool_binary("designer"), sys.argv[1:])
def linguist():
- qt_tool_wrapper("linguist", sys.argv[1:])
+ qt_tool_wrapper(ui_tool_binary("linguist"), sys.argv[1:])
def genpyi():