From 9eebcf3ef098f368cb15fa4add2969e26f5ba9ef Mon Sep 17 00:00:00 2001 From: Eike Ziller Date: Tue, 1 Nov 2022 16:07:00 +0100 Subject: [PATCH] Restrict Python application wizards to desktop Fixes: QTCREATORBUG-28258 Change-Id: I9814abe093efbff0b7b15711d4773c8cbcdc8e41 Reviewed-by: Cristian Maureira-Fredes Reviewed-by: Reviewed-by: David Schulz --- .../wizards/projects/qtforpythonapplication/empty/wizard.json | 2 +- .../projects/qtforpythonapplication/mainwindow/wizard.json | 2 +- .../qtforpythonapplication/qtquickapplication/wizard.json | 2 +- .../wizards/projects/qtforpythonapplication/widget/wizard.json | 2 +- .../projects/qtforpythonapplication/widget_gen/wizard.json | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/share/qtcreator/templates/wizards/projects/qtforpythonapplication/empty/wizard.json b/share/qtcreator/templates/wizards/projects/qtforpythonapplication/empty/wizard.json index fecabd09428..2d566dc1f66 100644 --- a/share/qtcreator/templates/wizards/projects/qtforpythonapplication/empty/wizard.json +++ b/share/qtcreator/templates/wizards/projects/qtforpythonapplication/empty/wizard.json @@ -8,7 +8,7 @@ "trDisplayCategory": "Application (Qt for Python)", "icon": "icon.png", "iconKind": "Themed", - "enabled": "%{JS: value('Plugins').indexOf('Python') >= 0}", + "enabled": "%{JS: value('Plugins').indexOf('Python') >= 0 && (!value('Platform').length || ['Desktop', 'DockerDeviceType', 'GenericLinuxOsType'].includes(value('Platform')))}", "options": [ diff --git a/share/qtcreator/templates/wizards/projects/qtforpythonapplication/mainwindow/wizard.json b/share/qtcreator/templates/wizards/projects/qtforpythonapplication/mainwindow/wizard.json index d9f575ecd9b..58e9f8cd526 100644 --- a/share/qtcreator/templates/wizards/projects/qtforpythonapplication/mainwindow/wizard.json +++ b/share/qtcreator/templates/wizards/projects/qtforpythonapplication/mainwindow/wizard.json @@ -8,7 +8,7 @@ "trDisplayCategory": "Application (Qt for Python)", "icon": "../icons/icon.png", "iconKind": "Themed", - "enabled": "%{JS: value('Plugins').indexOf('Python') >= 0}", + "enabled": "%{JS: value('Plugins').indexOf('Python') >= 0 && (!value('Platform').length || ['Desktop', 'DockerDeviceType', 'GenericLinuxOsType'].includes(value('Platform')))}", "options": [ diff --git a/share/qtcreator/templates/wizards/projects/qtforpythonapplication/qtquickapplication/wizard.json b/share/qtcreator/templates/wizards/projects/qtforpythonapplication/qtquickapplication/wizard.json index 7ab73b917f4..c04407347c8 100644 --- a/share/qtcreator/templates/wizards/projects/qtforpythonapplication/qtquickapplication/wizard.json +++ b/share/qtcreator/templates/wizards/projects/qtforpythonapplication/qtquickapplication/wizard.json @@ -8,7 +8,7 @@ "trDisplayCategory": "Application (Qt for Python)", "icon": "../icons/icon.png", "iconKind": "Themed", - "enabled": "%{JS: value('Plugins').indexOf('Python') >= 0}", + "enabled": "%{JS: value('Plugins').indexOf('Python') >= 0 && (!value('Platform').length || ['Desktop', 'DockerDeviceType', 'GenericLinuxOsType'].includes(value('Platform')))}", "options": [ diff --git a/share/qtcreator/templates/wizards/projects/qtforpythonapplication/widget/wizard.json b/share/qtcreator/templates/wizards/projects/qtforpythonapplication/widget/wizard.json index b9c96c97886..1a8e1bd72cb 100644 --- a/share/qtcreator/templates/wizards/projects/qtforpythonapplication/widget/wizard.json +++ b/share/qtcreator/templates/wizards/projects/qtforpythonapplication/widget/wizard.json @@ -8,7 +8,7 @@ "trDisplayCategory": "Application (Qt for Python)", "icon": "../icons/icon.png", "iconKind": "Themed", - "enabled": "%{JS: value('Plugins').indexOf('Python') >= 0}", + "enabled": "%{JS: value('Plugins').indexOf('Python') >= 0 && (!value('Platform').length || ['Desktop', 'DockerDeviceType', 'GenericLinuxOsType'].includes(value('Platform')))}", "options": [ diff --git a/share/qtcreator/templates/wizards/projects/qtforpythonapplication/widget_gen/wizard.json b/share/qtcreator/templates/wizards/projects/qtforpythonapplication/widget_gen/wizard.json index 91572c2bdd2..3bfe3af638b 100644 --- a/share/qtcreator/templates/wizards/projects/qtforpythonapplication/widget_gen/wizard.json +++ b/share/qtcreator/templates/wizards/projects/qtforpythonapplication/widget_gen/wizard.json @@ -8,7 +8,7 @@ "trDisplayCategory": "Application (Qt for Python)", "icon": "../icons/icon.png", "iconKind": "Themed", - "enabled": "%{JS: value('Plugins').indexOf('Python') >= 0}", + "enabled": "%{JS: value('Plugins').indexOf('Python') >= 0 && (!value('Platform').length || ['Desktop', 'DockerDeviceType', 'GenericLinuxOsType'].includes(value('Platform')))}", "options": [