From f1f2475d3e7ef2870775282992c4ba22b6264e7c Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Wed, 27 May 2015 15:45:07 +0200 Subject: [PATCH] JsonWizard: split plugins and features when considering enabled state Now that we have the infrastructure to handle both separately it makes no more sense to merge them. Change-Id: Ia2694eef60c0fe17b025e4d6766c7a8f775513f5 Reviewed-by: Alessandro Portale --- share/qtcreator/templates/wizards/classes/cpp/wizard.json | 2 +- .../templates/wizards/classes/python/wizard.json | 2 +- .../templates/wizards/classes/qtquickui/wizard.json | 3 ++- .../templates/wizards/files/cppheader/wizard.json | 2 +- .../templates/wizards/files/cppsource/wizard.json | 2 +- share/qtcreator/templates/wizards/files/form/wizard.json | 2 +- .../templates/wizards/files/glsl/gl/fragment/wizard.json | 2 +- .../templates/wizards/files/glsl/gl/vertex/wizard.json | 2 +- .../wizards/files/glsl/gles/fragment/wizard.json | 2 +- .../templates/wizards/files/glsl/gles/vertex/wizard.json | 2 +- share/qtcreator/templates/wizards/files/java/wizard.json | 2 +- share/qtcreator/templates/wizards/files/js/wizard.json | 2 +- .../qtcreator/templates/wizards/files/python/wizard.json | 2 +- share/qtcreator/templates/wizards/files/qrc/wizard.json | 2 +- .../templates/wizards/files/qtquick1/wizard.json | 2 +- .../templates/wizards/files/qtquick2/wizard.json | 2 +- .../qtcreator/templates/wizards/files/scratch/wizard.json | 2 +- share/qtcreator/templates/wizards/files/text/wizard.json | 2 +- .../wizards/projects/qmake/consoleapp/wizard.json | 3 ++- .../templates/wizards/projects/qmake/empty/wizard.json | 4 ++-- .../wizards/projects/qmake/qtquickapplication/wizard.json | 3 ++- .../projects/qmake/qtquickcontrolsapplication/wizard.json | 3 ++- .../projects/qmlproject/qtquickapplication/wizard.json | 1 + .../qmlproject/qtquickcontrolsapplication/wizard.json | 1 + .../templates/wizards/projects/vcs/bazaar/wizard.json | 2 +- .../templates/wizards/projects/vcs/cvs/wizard.json | 2 +- .../templates/wizards/projects/vcs/git/wizard.json | 2 +- .../templates/wizards/projects/vcs/mercurial/wizard.json | 2 +- .../templates/wizards/projects/vcs/subversion/wizard.json | 2 +- src/plugins/coreplugin/iwizardfactory.cpp | 2 +- .../projectexplorer/jsonwizard/jsonwizardfactory.cpp | 8 ++++++++ 31 files changed, 43 insertions(+), 29 deletions(-) diff --git a/share/qtcreator/templates/wizards/classes/cpp/wizard.json b/share/qtcreator/templates/wizards/classes/cpp/wizard.json index 06de05eb1c7..c909dbba5a5 100644 --- a/share/qtcreator/templates/wizards/classes/cpp/wizard.json +++ b/share/qtcreator/templates/wizards/classes/cpp/wizard.json @@ -7,7 +7,7 @@ "trDisplayName": "C++ Class", "trDisplayCategory": "C++", "icon": "../../global/genericfilewizard.png", - "featuresRequired": [ "Plugin.CppEditor" ], + "enabled": "%{JS: [ %{Plugins} ].indexOf('CppEditor') >= 0}", "options": [ diff --git a/share/qtcreator/templates/wizards/classes/python/wizard.json b/share/qtcreator/templates/wizards/classes/python/wizard.json index 682958abd51..9ab16fccc03 100644 --- a/share/qtcreator/templates/wizards/classes/python/wizard.json +++ b/share/qtcreator/templates/wizards/classes/python/wizard.json @@ -7,7 +7,7 @@ "trDisplayName": "Python Class", "trDisplayCategory": "Python", "icon": "../../global/genericfilewizard.png", - "featuresRequired": [ "Plugin.PythonEditor" ], + "enabled": "%{JS: [ %{Plugins} ].indexOf('PythonEditor') >= 0}", "options": [ diff --git a/share/qtcreator/templates/wizards/classes/qtquickui/wizard.json b/share/qtcreator/templates/wizards/classes/qtquickui/wizard.json index 208106e3df8..cad99dafc19 100644 --- a/share/qtcreator/templates/wizards/classes/qtquickui/wizard.json +++ b/share/qtcreator/templates/wizards/classes/qtquickui/wizard.json @@ -7,7 +7,8 @@ "trDisplayName": "QtQuick UI File", "trDisplayCategory": "Qt", "icon": "../../global/genericfilewizard.png", - "featuresRequired": [ "Plugin.QmlJSEditor", "QtSupport.Wizards.FeatureQtQuick.UiFiles" ], + "featuresRequired": [ "QtSupport.Wizards.FeatureQtQuick.UiFiles" ], + "enabled": "%{JS: [ %{Plugins} ].indexOf('QmlJSEditor') >= 0}", "options" : [ { "key": "QmlFile", "value": "%{Class}.%{JS: Util.preferredSuffix('text/x-qml')}" }, diff --git a/share/qtcreator/templates/wizards/files/cppheader/wizard.json b/share/qtcreator/templates/wizards/files/cppheader/wizard.json index a46c2c153b6..f0b93641a90 100644 --- a/share/qtcreator/templates/wizards/files/cppheader/wizard.json +++ b/share/qtcreator/templates/wizards/files/cppheader/wizard.json @@ -7,7 +7,7 @@ "trDisplayName": "C++ Header File", "trDisplayCategory": "C++", "icon": "../../global/genericfilewizard.png", - "featuresRequired": [ "Plugin.CppEditor" ], + "enabled": "%{JS: [ %{Plugins} ].indexOf('CppEditor') >= 0}", "pages" : [ diff --git a/share/qtcreator/templates/wizards/files/cppsource/wizard.json b/share/qtcreator/templates/wizards/files/cppsource/wizard.json index 8d98e97e4eb..6a0dbbb9f84 100644 --- a/share/qtcreator/templates/wizards/files/cppsource/wizard.json +++ b/share/qtcreator/templates/wizards/files/cppsource/wizard.json @@ -7,7 +7,7 @@ "trDisplayName": "C++ Source File", "trDisplayCategory": "C++", "icon": "../../global/genericfilewizard.png", - "featuresRequired": [ "Plugin.CppEditor" ], + "enabled": "%{JS: [ %{Plugins} ].indexOf('CppEditor') >= 0}", "pages" : [ diff --git a/share/qtcreator/templates/wizards/files/form/wizard.json b/share/qtcreator/templates/wizards/files/form/wizard.json index 835ccf8ffbb..0f40ee2f326 100644 --- a/share/qtcreator/templates/wizards/files/form/wizard.json +++ b/share/qtcreator/templates/wizards/files/form/wizard.json @@ -7,7 +7,7 @@ "trDisplayName": "Qt Designer Form", "trDisplayCategory": "Qt", "icon": "../../global/genericfilewizard.png", - "featuresRequired": [ "Plugin.Designer" ], + "enabled": "%{JS: [ %{Plugins} ].indexOf('Designer') >= 0}", "options": [ { "key": "UiClass", "value": "%{JS: QtSupport.uiClassName([ %{FormContents} ].join('\\n'))}" }, diff --git a/share/qtcreator/templates/wizards/files/glsl/gl/fragment/wizard.json b/share/qtcreator/templates/wizards/files/glsl/gl/fragment/wizard.json index 9267576373c..4eb13b98834 100644 --- a/share/qtcreator/templates/wizards/files/glsl/gl/fragment/wizard.json +++ b/share/qtcreator/templates/wizards/files/glsl/gl/fragment/wizard.json @@ -8,7 +8,7 @@ "trDisplayCategory": "GLSL", "icon": "../../../../global/genericfilewizard.png", "platformIndependent": true, - "featuresRequired": [ "Plugin.GLSLEditor" ], + "enabled": "%{JS: [ %{Plugins} ].indexOf('GLSLEditor') >= 0}", "pages" : [ diff --git a/share/qtcreator/templates/wizards/files/glsl/gl/vertex/wizard.json b/share/qtcreator/templates/wizards/files/glsl/gl/vertex/wizard.json index 4734d8fc84c..c9ba67bfac0 100644 --- a/share/qtcreator/templates/wizards/files/glsl/gl/vertex/wizard.json +++ b/share/qtcreator/templates/wizards/files/glsl/gl/vertex/wizard.json @@ -8,7 +8,7 @@ "trDisplayCategory": "GLSL", "icon": "../../../../global/genericfilewizard.png", "platformIndependent": true, - "featuresRequired": [ "Plugin.GLSLEditor" ], + "enabled": "%{JS: [ %{Plugins} ].indexOf('GLSLEditor') >= 0}", "pages" : [ diff --git a/share/qtcreator/templates/wizards/files/glsl/gles/fragment/wizard.json b/share/qtcreator/templates/wizards/files/glsl/gles/fragment/wizard.json index d5b66c7b927..52574060070 100644 --- a/share/qtcreator/templates/wizards/files/glsl/gles/fragment/wizard.json +++ b/share/qtcreator/templates/wizards/files/glsl/gles/fragment/wizard.json @@ -8,7 +8,7 @@ "trDisplayCategory": "GLSL", "icon": "../../../../global/genericfilewizard.png", "platformIndependent": true, - "featuresRequired": [ "Plugin.GLSLEditor" ], + "enabled": "%{JS: [ %{Plugins} ].indexOf('GLSLEditor') >= 0}", "pages" : [ diff --git a/share/qtcreator/templates/wizards/files/glsl/gles/vertex/wizard.json b/share/qtcreator/templates/wizards/files/glsl/gles/vertex/wizard.json index ffc6de9c736..ddd8ec1d2e3 100644 --- a/share/qtcreator/templates/wizards/files/glsl/gles/vertex/wizard.json +++ b/share/qtcreator/templates/wizards/files/glsl/gles/vertex/wizard.json @@ -8,7 +8,7 @@ "trDisplayCategory": "GLSL", "icon": "../../../../global/genericfilewizard.png", "platformIndependent": true, - "featuresRequired": [ "Plugin.GLSLEditor" ], + "enabled": "%{JS: [ %{Plugins} ].indexOf('GLSLEditor') >= 0}", "pages" : [ diff --git a/share/qtcreator/templates/wizards/files/java/wizard.json b/share/qtcreator/templates/wizards/files/java/wizard.json index c6126341037..56ca56f0ea9 100644 --- a/share/qtcreator/templates/wizards/files/java/wizard.json +++ b/share/qtcreator/templates/wizards/files/java/wizard.json @@ -7,7 +7,7 @@ "trDisplayName": "Java File", "trDisplayCategory": "Java", "icon": "../../global/genericfilewizard.png", - "featuresRequired": [ "Plugin.Android" ], + "enabled": "%{JS: [ %{Plugins} ].indexOf('Android') >= 0}", "options": [ { "key": "ClassName", "value": "%{JS: '%{FileName}'.charAt(0).toUpperCase() + '%{FileName}'.substr(1)}" } ], diff --git a/share/qtcreator/templates/wizards/files/js/wizard.json b/share/qtcreator/templates/wizards/files/js/wizard.json index cb48515842f..80165502e1f 100644 --- a/share/qtcreator/templates/wizards/files/js/wizard.json +++ b/share/qtcreator/templates/wizards/files/js/wizard.json @@ -7,7 +7,7 @@ "trDisplayName": "JS File", "trDisplayCategory": "Qt", "icon": "../../global/genericfilewizard.png", - "featuresRequired": [ "Plugin.QmlJSEditor" ], + "enabled": "%{JS: [ %{Plugins} ].indexOf('QmlJSEditor') >= 0}", "pages" : [ diff --git a/share/qtcreator/templates/wizards/files/python/wizard.json b/share/qtcreator/templates/wizards/files/python/wizard.json index aff038318aa..827454a6672 100644 --- a/share/qtcreator/templates/wizards/files/python/wizard.json +++ b/share/qtcreator/templates/wizards/files/python/wizard.json @@ -7,7 +7,7 @@ "trDisplayName": "Python File", "trDisplayCategory": "Python", "icon": "../../global/genericfilewizard.png", - "featuresRequired": [ "Plugin.PythonEditor" ], + "enabled": "%{JS: [ %{Plugins} ].indexOf('PythonEditor') >= 0}", "pages" : [ diff --git a/share/qtcreator/templates/wizards/files/qrc/wizard.json b/share/qtcreator/templates/wizards/files/qrc/wizard.json index 9a565515261..6c79dad122c 100644 --- a/share/qtcreator/templates/wizards/files/qrc/wizard.json +++ b/share/qtcreator/templates/wizards/files/qrc/wizard.json @@ -7,7 +7,7 @@ "trDisplayName": "Qt Resource File", "trDisplayCategory": "Qt", "icon": "../../global/genericfilewizard.png", - "featuresRequired": [ "Plugin.ResourceEditor" ], + "enabled": "%{JS: [ %{Plugins} ].indexOf('ResourceEditor') >= 0}", "pages" : [ diff --git a/share/qtcreator/templates/wizards/files/qtquick1/wizard.json b/share/qtcreator/templates/wizards/files/qtquick1/wizard.json index 2c4fed3e84c..b54b83a765c 100644 --- a/share/qtcreator/templates/wizards/files/qtquick1/wizard.json +++ b/share/qtcreator/templates/wizards/files/qtquick1/wizard.json @@ -7,7 +7,7 @@ "trDisplayName": "QML File (Qt Quick 1)", "trDisplayCategory": "Qt", "icon": "../../global/genericfilewizard.png", - "featuresRequired": [ "Plugin.QmlJSEditor" ], + "enabled": "%{JS: [ %{Plugins} ].indexOf('QmlJSEditor') >= 0}", "pages" : [ diff --git a/share/qtcreator/templates/wizards/files/qtquick2/wizard.json b/share/qtcreator/templates/wizards/files/qtquick2/wizard.json index a627143a5ed..4227247406e 100644 --- a/share/qtcreator/templates/wizards/files/qtquick2/wizard.json +++ b/share/qtcreator/templates/wizards/files/qtquick2/wizard.json @@ -7,7 +7,7 @@ "trDisplayName": "QML File (Qt Quick 2)", "trDisplayCategory": "Qt", "icon": "../../global/genericfilewizard.png", - "featuresRequired": [ "Plugin.QmlJSEditor" ], + "enabled": "%{JS: [ %{Plugins} ].indexOf('QmlJSEditor') >= 0}", "pages" : [ diff --git a/share/qtcreator/templates/wizards/files/scratch/wizard.json b/share/qtcreator/templates/wizards/files/scratch/wizard.json index 7516925d09b..136fb75496a 100644 --- a/share/qtcreator/templates/wizards/files/scratch/wizard.json +++ b/share/qtcreator/templates/wizards/files/scratch/wizard.json @@ -8,7 +8,7 @@ "trDisplayCategory": "General", "icon": "../../global/genericfilewizard.png", "platformIndependent": true, - "featuresRequired": [ "Plugin.TextEditor" ], + "enabled": "%{JS: [ %{Plugins} ].indexOf('TextEditor') >= 0}", "options": [ { "key": "TargetPath", "value": "%{JS: Util.mktemp('scratch-XXXXXX.txt')}" } ], diff --git a/share/qtcreator/templates/wizards/files/text/wizard.json b/share/qtcreator/templates/wizards/files/text/wizard.json index 0db3f5df1b2..da595874ba2 100644 --- a/share/qtcreator/templates/wizards/files/text/wizard.json +++ b/share/qtcreator/templates/wizards/files/text/wizard.json @@ -8,7 +8,7 @@ "trDisplayCategory": "General", "icon": "../../global/genericfilewizard.png", "platformIndependent": true, - "featuresRequired": [ "Plugin.TextEditor" ], + "enabled": "%{JS: [ %{Plugins} ].indexOf('TextEditor') >= 0}", "pages" : [ diff --git a/share/qtcreator/templates/wizards/projects/qmake/consoleapp/wizard.json b/share/qtcreator/templates/wizards/projects/qmake/consoleapp/wizard.json index 5b716e85a6c..b74efb1582e 100644 --- a/share/qtcreator/templates/wizards/projects/qmake/consoleapp/wizard.json +++ b/share/qtcreator/templates/wizards/projects/qmake/consoleapp/wizard.json @@ -7,7 +7,8 @@ "trDisplayName": "Qt Console Application", "trDisplayCategory": "Application", "icon": "../../../global/consoleapplication.png", - "featuresRequired": [ "Plugin.QmakeProjectManager", "QtSupport.Wizards.FeatureQt" ], + "featuresRequired": [ "QtSupport.Wizards.FeatureQt" ], + "enabled": "%{JS: [ %{Plugins} ].indexOf('QmakeProjectManager') >= 0}", "options": [ diff --git a/share/qtcreator/templates/wizards/projects/qmake/empty/wizard.json b/share/qtcreator/templates/wizards/projects/qmake/empty/wizard.json index d033d2a81f5..5f4bd4abeac 100644 --- a/share/qtcreator/templates/wizards/projects/qmake/empty/wizard.json +++ b/share/qtcreator/templates/wizards/projects/qmake/empty/wizard.json @@ -7,8 +7,8 @@ "trDisplayName": "Empty qmake Project", "trDisplayCategory": "Other Project", "icon": "../../../global/guiapplication.png", - "featuresRequired": [ "Plugin.QmakeProjectManager", "QtSupport.Wizards.FeatureQt" ], - + "featuresRequired": [ "QtSupport.Wizards.FeatureQt" ], + "enabled": "%{JS: [ %{Plugins} ].indexOf('QmakeProjectManager') >= 0}", "options": [ { "key": "ProFileName", "value": "%{JS: Util.fileName('%{ProjectDirectory}/%{ProjectName}', 'pro')}" }, diff --git a/share/qtcreator/templates/wizards/projects/qmake/qtquickapplication/wizard.json b/share/qtcreator/templates/wizards/projects/qmake/qtquickapplication/wizard.json index 2c84b9383af..25c22b68c55 100644 --- a/share/qtcreator/templates/wizards/projects/qmake/qtquickapplication/wizard.json +++ b/share/qtcreator/templates/wizards/projects/qmake/qtquickapplication/wizard.json @@ -7,7 +7,8 @@ "trDisplayName": "Qt Quick Application", "trDisplayCategory": "Application", "icon": "qml_wizard.png", - "featuresRequired": [ "QtSupport.Wizards.FeatureQtQuick.2.4", "Plugin.QmakeProjectManager", "QtSupport.Wizards.FeatureQt" ], + "featuresRequired": [ "QtSupport.Wizards.FeatureQtQuick.2.4", "QtSupport.Wizards.FeatureQt" ], + "enabled": "${JS: [ %{Plugins} ].indexOf('QmakeProjectManager') >= 0}", "options": [ diff --git a/share/qtcreator/templates/wizards/projects/qmake/qtquickcontrolsapplication/wizard.json b/share/qtcreator/templates/wizards/projects/qmake/qtquickcontrolsapplication/wizard.json index 66b29eef78d..7d3cec48578 100644 --- a/share/qtcreator/templates/wizards/projects/qmake/qtquickcontrolsapplication/wizard.json +++ b/share/qtcreator/templates/wizards/projects/qmake/qtquickcontrolsapplication/wizard.json @@ -7,7 +7,8 @@ "trDisplayName": "Qt Quick Controls Application", "trDisplayCategory": "Application", "icon": "../qtquickapplication/qml_wizard.png", - "featuresRequired": [ "QtSupport.Wizards.FeatureQtQuick.Controls.1.3", "Plugin.QmakeProjectManager", "QtSupport.Wizards.FeatureQt" ], + "featuresRequired": [ "QtSupport.Wizards.FeatureQtQuick.Controls.1.3", "QtSupport.Wizards.FeatureQt" ], + "enabled": "%{JS: [ %{Plugins} ].indexOf('QmakeProjectManager') >= 0}", "options": [ diff --git a/share/qtcreator/templates/wizards/projects/qmlproject/qtquickapplication/wizard.json b/share/qtcreator/templates/wizards/projects/qmlproject/qtquickapplication/wizard.json index 5fc6f2a049c..48a06a902e8 100644 --- a/share/qtcreator/templates/wizards/projects/qmlproject/qtquickapplication/wizard.json +++ b/share/qtcreator/templates/wizards/projects/qmlproject/qtquickapplication/wizard.json @@ -7,6 +7,7 @@ "trDisplayName": "Qt Quick UI", "trDisplayCategory": "Application", "icon": "../../qmake/qtquickapplication/qml_wizard.png", + "enabled": "%{JS: [ %{Plugins} ].indexOf('QmlProjectManager') >= 0}", "featuresRequired": [ "QtSupport.Wizards.FeatureQtQuick.Controls.1.3", "QtSupport.Wizards.FeatureQtQuickProject", "QtSupport.Wizards.FeatureQt" ], "options": diff --git a/share/qtcreator/templates/wizards/projects/qmlproject/qtquickcontrolsapplication/wizard.json b/share/qtcreator/templates/wizards/projects/qmlproject/qtquickcontrolsapplication/wizard.json index 65ecefc71fb..dfa8a6822c5 100644 --- a/share/qtcreator/templates/wizards/projects/qmlproject/qtquickcontrolsapplication/wizard.json +++ b/share/qtcreator/templates/wizards/projects/qmlproject/qtquickcontrolsapplication/wizard.json @@ -7,6 +7,7 @@ "trDisplayName": "Qt Quick Controls UI", "trDisplayCategory": "Application", "icon": "../../qmake/qtquickapplication/qml_wizard.png", + "enabled": "%{JS: [ %{Plugins} ].indexOf('QmlProjectManager') >= 0}", "featuresRequired": [ "QtSupport.Wizards.FeatureQtQuick.Controls.1.3", "QtSupport.Wizards.FeatureQtQuickProject", "QtSupport.Wizards.FeatureQt" ], "options": diff --git a/share/qtcreator/templates/wizards/projects/vcs/bazaar/wizard.json b/share/qtcreator/templates/wizards/projects/vcs/bazaar/wizard.json index 86d3ea03631..897a4133175 100644 --- a/share/qtcreator/templates/wizards/projects/vcs/bazaar/wizard.json +++ b/share/qtcreator/templates/wizards/projects/vcs/bazaar/wizard.json @@ -7,7 +7,7 @@ "trDisplayName": "Bazaar Clone (Or Branch)", "trDisplayCategory": "Import Project", "icon": "icon.png", - "featuresRequired": [ "Plugin.Bazaar" ], + "enabled": "%{JS: [ %{Plugins} ].indexOf('Bazaar') >= 0}", "options": [ diff --git a/share/qtcreator/templates/wizards/projects/vcs/cvs/wizard.json b/share/qtcreator/templates/wizards/projects/vcs/cvs/wizard.json index 987ef98c3c8..01b2ef7ec4e 100644 --- a/share/qtcreator/templates/wizards/projects/vcs/cvs/wizard.json +++ b/share/qtcreator/templates/wizards/projects/vcs/cvs/wizard.json @@ -7,7 +7,7 @@ "trDisplayName": "CVS Checkout", "trDisplayCategory": "Import Project", "icon": "icon.png", - "featuresRequired": [ "Plugin.CVS" ], + "enabled": "%{JS: [ %{Plugins} ].indexOf('CVS') >= 0}", "options": [ diff --git a/share/qtcreator/templates/wizards/projects/vcs/git/wizard.json b/share/qtcreator/templates/wizards/projects/vcs/git/wizard.json index 76e30f75b98..3e68a4d8776 100644 --- a/share/qtcreator/templates/wizards/projects/vcs/git/wizard.json +++ b/share/qtcreator/templates/wizards/projects/vcs/git/wizard.json @@ -7,7 +7,7 @@ "trDisplayName": "Git Clone", "trDisplayCategory": "Import Project", "icon": "icon.png", - "featuresRequired": [ "Plugin.Git" ], + "enabled": "%{JS: [ %{Plugins} ].indexOf('Git') >= 0}", "options": [ diff --git a/share/qtcreator/templates/wizards/projects/vcs/mercurial/wizard.json b/share/qtcreator/templates/wizards/projects/vcs/mercurial/wizard.json index c3fd5c2f463..51d0223d209 100644 --- a/share/qtcreator/templates/wizards/projects/vcs/mercurial/wizard.json +++ b/share/qtcreator/templates/wizards/projects/vcs/mercurial/wizard.json @@ -7,7 +7,7 @@ "trDisplayName": "Mercurial Clone", "trDisplayCategory": "Import Project", "icon": "icon.png", - "featuresRequired": [ "Plugin.Mercurial" ], + "enabled": "%{JS: [ %{Plugins} ].indexOf('Mercurial') >= 0}", "options": [ diff --git a/share/qtcreator/templates/wizards/projects/vcs/subversion/wizard.json b/share/qtcreator/templates/wizards/projects/vcs/subversion/wizard.json index 3fc18ef8c44..ac55889c612 100644 --- a/share/qtcreator/templates/wizards/projects/vcs/subversion/wizard.json +++ b/share/qtcreator/templates/wizards/projects/vcs/subversion/wizard.json @@ -7,7 +7,7 @@ "trDisplayName": "Subversion Checkout", "trDisplayCategory": "Import Project", "icon": "icon.png", - "featuresRequired": [ "Plugin.Subversion" ], + "enabled": "%{JS: [ %{Plugins} ].indexOf('Subversion') >= 0}", "options": [ diff --git a/src/plugins/coreplugin/iwizardfactory.cpp b/src/plugins/coreplugin/iwizardfactory.cpp index 876a6d2a952..1c254f55a1c 100644 --- a/src/plugins/coreplugin/iwizardfactory.cpp +++ b/src/plugins/coreplugin/iwizardfactory.cpp @@ -326,7 +326,7 @@ FeatureSet IWizardFactory::pluginFeatures() const // Implicitly create a feature for each plugin loaded: foreach (ExtensionSystem::PluginSpec *s, ExtensionSystem::PluginManager::plugins()) { if (s->state() == ExtensionSystem::PluginSpec::Running) - list.append(QString::fromLatin1("Plugin.") + s->name()); + list.append(s->name()); } plugins = FeatureSet::fromStringList(list); } diff --git a/src/plugins/projectexplorer/jsonwizard/jsonwizardfactory.cpp b/src/plugins/projectexplorer/jsonwizard/jsonwizardfactory.cpp index 6fc23ca5748..a80f7404b76 100644 --- a/src/plugins/projectexplorer/jsonwizard/jsonwizardfactory.cpp +++ b/src/plugins/projectexplorer/jsonwizard/jsonwizardfactory.cpp @@ -371,6 +371,9 @@ void JsonWizardFactory::runWizard(const QString &path, QWidget *parent, const QS tmp.remove(pluginFeatures()); wizard.setValue(QStringLiteral("PreferredFeatures"), tmp.toStringList()); + wizard.setValue(QStringLiteral("Features"), availableFeatures(platform).toStringList()); + wizard.setValue(QStringLiteral("Plugins"), pluginFeatures().toStringList()); + // Add data to wizard: for (auto i = variables.constBegin(); i != variables.constEnd(); ++i) wizard.setProperty(i.key().toUtf8(), i.value()); @@ -477,8 +480,13 @@ bool JsonWizardFactory::isAvailable(const QString &platformName) const return false; Utils::MacroExpander expander; + Utils::MacroExpander *e = &expander; expander.registerVariable("Platform", tr("The platform selected for the wizard."), [platformName]() { return platformName; }); + expander.registerVariable("Features", tr("The features available to this wizard."), + [this, e, platformName]() { return JsonWizard::stringListToArrayString(availableFeatures(platformName).toStringList(), e); }); + expander.registerVariable("Plugins", tr("The plugins loaded."), + [this, e]() { return JsonWizard::stringListToArrayString(pluginFeatures().toStringList(), e); }); return JsonWizard::boolFromVariant(m_enabledExpression, &expander); }