forked from qt-creator/qt-creator
Do not offer CMake-specific wizards if that plugin is not enabled.
Rationale: a) For people not interested in CMake, the wizards unnecessarily clutter the UI. If unhandled, this problem would get worse the more build systems we support. b) If such a wizard is actually used in the absence of the plugin, nothing visible will happen after it has finished, which is guaranteed to confuse users. Change-Id: I070409d3185b11d2e04e33927a97843e60c657ff Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com> Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
This commit is contained in:
@@ -28,13 +28,9 @@
|
||||
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
Custom project wizard configuration example file. Note that by convention,
|
||||
the project file goes last.
|
||||
The "class" and "firstpage" attributes specify that it is a Qt 4 wizard and
|
||||
leave room for the Qt 4 target page.
|
||||
-->
|
||||
<wizard version="1" kind="project" firstpage="10" id="S.Plain C (CMake)" category="I.Projects" platformIndependent="true">
|
||||
<wizard version="1" kind="project" firstpage="10" id="S.Plain C (CMake)" category="I.Projects"
|
||||
platformIndependent="true" featuresRequired="CMake.CMakeSupport">
|
||||
<icon>console.png</icon>
|
||||
<description>Creates a plain C project using CMake, not using the Qt library.</description>
|
||||
<displayname>Plain C Project (CMake Build)</displayname>;
|
||||
|
@@ -28,13 +28,9 @@
|
||||
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
Custom project wizard configuration example file. Note that by convention,
|
||||
the project file goes last.
|
||||
The "class" and "firstpage" attributes specify that it is a Qt 4 wizard and
|
||||
leave room for the Qt 4 target page.
|
||||
-->
|
||||
<wizard version="1" kind="project" firstpage="10" id="S.Plain C++ (CMake)" category="I.Projects" platformIndependent="true">
|
||||
<wizard version="1" kind="project" firstpage="10" id="S.Plain C++ (CMake)" category="I.Projects"
|
||||
platformIndependent="true" featuresRequired="CMake.CMakeSupport">
|
||||
<icon>console.png</icon>
|
||||
<description>Creates a plain C++ project using CMake, not using the Qt library.</description>
|
||||
<displayname>Plain C++ Project (CMake Build)</displayname>;
|
||||
|
@@ -40,6 +40,7 @@ const char CMAKE_EDITOR_DISPLAY_NAME[] = "CMake Editor";
|
||||
const char C_CMAKEEDITOR[] = "CMakeProject.Context.CMakeEditor";
|
||||
const char RUNCMAKE[] = "CMakeProject.RunCMake";
|
||||
const char RUNCMAKECONTEXTMENU[] = "CMakeProject.RunCMakeContextMenu";
|
||||
const char CMAKE_SUPPORT_FEATURE[] = "CMake.CMakeSupport";
|
||||
|
||||
// Project
|
||||
const char CMAKEPROJECT_ID[] = "CMakeProjectManager.CMakeProject";
|
||||
|
@@ -37,6 +37,7 @@
|
||||
#include "cmakelocatorfilter.h"
|
||||
#include "cmakefilecompletionassist.h"
|
||||
|
||||
#include <coreplugin/featureprovider.h>
|
||||
#include <coreplugin/icore.h>
|
||||
#include <coreplugin/mimedatabase.h>
|
||||
#include <texteditor/texteditoractionhandler.h>
|
||||
@@ -47,6 +48,16 @@
|
||||
|
||||
using namespace CMakeProjectManager::Internal;
|
||||
|
||||
class CMakeFeatureProvider : public Core::IFeatureProvider
|
||||
{
|
||||
Core::FeatureSet availableFeatures(const QString & /* platform */) const {
|
||||
return Core::FeatureSet(Core::Id(CMakeProjectManager::Constants::CMAKE_SUPPORT_FEATURE));
|
||||
}
|
||||
|
||||
QStringList availablePlatforms() const { return QStringList(); }
|
||||
QString displayNameForPlatform(const QString & /* platform */) const { return QString(); }
|
||||
};
|
||||
|
||||
CMakeProjectPlugin::CMakeProjectPlugin()
|
||||
{
|
||||
}
|
||||
@@ -70,6 +81,7 @@ bool CMakeProjectPlugin::initialize(const QStringList & /*arguments*/, QString *
|
||||
addAutoReleasedObject(new CMakeEditorFactory(manager));
|
||||
addAutoReleasedObject(new CMakeLocatorFilter);
|
||||
addAutoReleasedObject(new CMakeFileCompletionAssistProvider(cmp));
|
||||
addAutoReleasedObject(new CMakeFeatureProvider);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user