forked from qt-creator/qt-creator
Wizards: allows filtering of wizards based on Qt version
Every wizard now implements requiredFeatures() to define a feature set. If the feature set is not satisfied by the available Qt Versions, the wizard is not shown in the create file/project dialog. Every Qt version can define the provided feature set in availableFeatures() defined in BaseQtVersion. Change-Id: Ie9e2c210d19187b2296451948c36d274f2096623 Reviewed-by: Daniel Teske <daniel.teske@nokia.com> Reviewed-by: Alessandro Portale <alessandro.portale@nokia.com>
This commit is contained in:
@@ -37,7 +37,7 @@ the project file goes last.
|
|||||||
The "class" and "firstpage" attributes specify that it is a Qt 4 wizard and
|
The "class" and "firstpage" attributes specify that it is a Qt 4 wizard and
|
||||||
leave room for the Qt 4 target page.
|
leave room for the Qt 4 target page.
|
||||||
-->
|
-->
|
||||||
<wizard version="1" kind="project" firstpage="10" id="S.Plain C (CMake)" category="I.Projects">
|
<wizard version="1" kind="project" firstpage="10" id="S.Plain C (CMake)" category="I.Projects" featuresRequired="QtSupport.Wizards.FeatureGenericCppEntryPoint">
|
||||||
<icon>console.png</icon>
|
<icon>console.png</icon>
|
||||||
<description>Creates a plain C project using CMake, not using the Qt library.</description>
|
<description>Creates a plain C project using CMake, not using the Qt library.</description>
|
||||||
<displayname>Plain C Project (CMake Build)</displayname>;
|
<displayname>Plain C Project (CMake Build)</displayname>;
|
||||||
|
|||||||
@@ -39,7 +39,8 @@ leave room for the Qt 4 target page.
|
|||||||
-->
|
-->
|
||||||
<wizard version="1" kind="project"
|
<wizard version="1" kind="project"
|
||||||
class="qt4project" firstpage="10"
|
class="qt4project" firstpage="10"
|
||||||
id="R.Plain C" category="I.Projects">
|
id="R.Plain C" category="I.Projects"
|
||||||
|
featuresRequired="QtSupport.Wizards.FeatureGenericCppEntryPoint">
|
||||||
<icon>console.png</icon>
|
<icon>console.png</icon>
|
||||||
<description>Creates a plain C project using qmake, not using the Qt library.</description>
|
<description>Creates a plain C project using qmake, not using the Qt library.</description>
|
||||||
<displayname>Plain C Project</displayname>;
|
<displayname>Plain C Project</displayname>;
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ the project file goes last.
|
|||||||
The "class" and "firstpage" attributes specify that it is a Qt 4 wizard and
|
The "class" and "firstpage" attributes specify that it is a Qt 4 wizard and
|
||||||
leave room for the Qt 4 target page.
|
leave room for the Qt 4 target page.
|
||||||
-->
|
-->
|
||||||
<wizard version="1" kind="project" firstpage="10" id="S.Plain C++ (CMake)" category="I.Projects">
|
<wizard version="1" kind="project" firstpage="10" id="S.Plain C++ (CMake)" category="I.Projects" featuresRequired="QtSupport.Wizards.FeatureGenericCppEntryPoint">
|
||||||
<icon>console.png</icon>
|
<icon>console.png</icon>
|
||||||
<description>Creates a plain C++ project using CMake, not using the Qt library.</description>
|
<description>Creates a plain C++ project using CMake, not using the Qt library.</description>
|
||||||
<displayname>Plain C++ Project (CMake Build)</displayname>;
|
<displayname>Plain C++ Project (CMake Build)</displayname>;
|
||||||
|
|||||||
@@ -39,7 +39,8 @@ leave room for the Qt 4 target page.
|
|||||||
-->
|
-->
|
||||||
<wizard version="1" kind="project"
|
<wizard version="1" kind="project"
|
||||||
class="qt4project" firstpage="10"
|
class="qt4project" firstpage="10"
|
||||||
id="R.Plain C++" category="I.Projects">
|
id="R.Plain C++" category="I.Projects"
|
||||||
|
featuresRequired="QtSupport.Wizards.FeatureGenericCppEntryPoint">
|
||||||
<icon>console.png</icon>
|
<icon>console.png</icon>
|
||||||
<description>Creates a plain C++ project using qmake, not using the Qt library.</description>
|
<description>Creates a plain C++ project using qmake, not using the Qt library.</description>
|
||||||
<displayname>Plain C++ Project</displayname>;
|
<displayname>Plain C++ Project</displayname>;
|
||||||
|
|||||||
@@ -39,7 +39,8 @@ leave room for the Qt 4 target page.
|
|||||||
-->
|
-->
|
||||||
<wizard version="1" kind="project"
|
<wizard version="1" kind="project"
|
||||||
class="qt4project" firstpage="10"
|
class="qt4project" firstpage="10"
|
||||||
id="R.QtCreatorPlugin" category="F.QtProjects">
|
id="R.QtCreatorPlugin" category="F.QtProjects"
|
||||||
|
featuresRequired="QtSupport.Wizards.FeatureGenericCppEntryPoint,QtSupport.Wizards.FeatureQt">
|
||||||
<icon>qtcreator_logo_24.png</icon>
|
<icon>qtcreator_logo_24.png</icon>
|
||||||
<description>Creates a custom Qt Creator plugin.</description>
|
<description>Creates a custom Qt Creator plugin.</description>
|
||||||
<displayname>Qt Creator Plugin</displayname>;
|
<displayname>Qt Creator Plugin</displayname>;
|
||||||
|
|||||||
@@ -86,6 +86,7 @@ public:
|
|||||||
QString id;
|
QString id;
|
||||||
QString category;
|
QString category;
|
||||||
QString displayCategory;
|
QString displayCategory;
|
||||||
|
Core::FeatureSet requiredFeatures;
|
||||||
};
|
};
|
||||||
|
|
||||||
BaseFileWizardParameterData::BaseFileWizardParameterData(IWizard::WizardKind k) :
|
BaseFileWizardParameterData::BaseFileWizardParameterData(IWizard::WizardKind k) :
|
||||||
@@ -145,7 +146,8 @@ CORE_EXPORT QDebug operator<<(QDebug d, const BaseFileWizardParameters &p)
|
|||||||
<< " Category: " << p.category()
|
<< " Category: " << p.category()
|
||||||
<< " DisplayName: " << p.displayName()
|
<< " DisplayName: " << p.displayName()
|
||||||
<< " Description: " << p.description()
|
<< " Description: " << p.description()
|
||||||
<< " DisplayCategory: " << p.displayCategory();
|
<< " DisplayCategory: " << p.displayCategory()
|
||||||
|
<< " Required Features: " << p.requiredFeatures().toStringList();
|
||||||
return d;
|
return d;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -214,6 +216,17 @@ QString BaseFileWizardParameters::displayCategory() const
|
|||||||
return m_d->displayCategory;
|
return m_d->displayCategory;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Core::FeatureSet BaseFileWizardParameters::requiredFeatures() const
|
||||||
|
{
|
||||||
|
return m_d->requiredFeatures;
|
||||||
|
}
|
||||||
|
|
||||||
|
void BaseFileWizardParameters::setRequiredFeatures(Core::FeatureSet features)
|
||||||
|
{
|
||||||
|
|
||||||
|
m_d->requiredFeatures = features;
|
||||||
|
}
|
||||||
|
|
||||||
void BaseFileWizardParameters::setDisplayCategory(const QString &v)
|
void BaseFileWizardParameters::setDisplayCategory(const QString &v)
|
||||||
{
|
{
|
||||||
m_d->displayCategory = v;
|
m_d->displayCategory = v;
|
||||||
@@ -349,6 +362,11 @@ BaseFileWizard::BaseFileWizard(const BaseFileWizardParameters ¶meters,
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
BaseFileWizardParameters BaseFileWizard::baseFileWizardParameters() const
|
||||||
|
{
|
||||||
|
return d->m_parameters;
|
||||||
|
}
|
||||||
|
|
||||||
BaseFileWizard::~BaseFileWizard()
|
BaseFileWizard::~BaseFileWizard()
|
||||||
{
|
{
|
||||||
delete d;
|
delete d;
|
||||||
@@ -497,6 +515,12 @@ void BaseFileWizard::runWizard(const QString &path, QWidget *parent)
|
|||||||
QMessageBox::critical(0, tr("File Generation Failure"), errorMessage);
|
QMessageBox::critical(0, tr("File Generation Failure"), errorMessage);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Core::FeatureSet BaseFileWizard::requiredFeatures() const
|
||||||
|
{
|
||||||
|
return d->m_parameters.requiredFeatures();
|
||||||
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\fn virtual QWizard *Core::BaseFileWizard::createWizardDialog(QWidget *parent,
|
\fn virtual QWizard *Core::BaseFileWizard::createWizardDialog(QWidget *parent,
|
||||||
const QString &defaultPath,
|
const QString &defaultPath,
|
||||||
|
|||||||
@@ -91,6 +91,9 @@ public:
|
|||||||
QString displayCategory() const;
|
QString displayCategory() const;
|
||||||
void setDisplayCategory(const QString &trCategory);
|
void setDisplayCategory(const QString &trCategory);
|
||||||
|
|
||||||
|
Core::FeatureSet requiredFeatures() const;
|
||||||
|
void setRequiredFeatures(Core::FeatureSet features);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QSharedDataPointer<BaseFileWizardParameterData> m_d;
|
QSharedDataPointer<BaseFileWizardParameterData> m_d;
|
||||||
};
|
};
|
||||||
@@ -115,6 +118,7 @@ public:
|
|||||||
virtual QString displayCategory() const;
|
virtual QString displayCategory() const;
|
||||||
|
|
||||||
virtual void runWizard(const QString &path, QWidget *parent);
|
virtual void runWizard(const QString &path, QWidget *parent);
|
||||||
|
virtual Core::FeatureSet requiredFeatures() const;
|
||||||
|
|
||||||
static QString buildFileName(const QString &path, const QString &baseName, const QString &extension);
|
static QString buildFileName(const QString &path, const QString &baseName, const QString &extension);
|
||||||
static void setupWizard(QWizard *);
|
static void setupWizard(QWizard *);
|
||||||
@@ -125,6 +129,8 @@ protected:
|
|||||||
|
|
||||||
explicit BaseFileWizard(const BaseFileWizardParameters ¶meters, QObject *parent = 0);
|
explicit BaseFileWizard(const BaseFileWizardParameters ¶meters, QObject *parent = 0);
|
||||||
|
|
||||||
|
BaseFileWizardParameters baseFileWizardParameters() const;
|
||||||
|
|
||||||
virtual QWizard *createWizardDialog(QWidget *parent,
|
virtual QWizard *createWizardDialog(QWidget *parent,
|
||||||
const QString &defaultPath,
|
const QString &defaultPath,
|
||||||
const WizardPageList &extensionPages) const = 0;
|
const WizardPageList &extensionPages) const = 0;
|
||||||
|
|||||||
@@ -95,7 +95,8 @@ SOURCES += mainwindow.cpp \
|
|||||||
mimetypesettings.cpp \
|
mimetypesettings.cpp \
|
||||||
dialogs/promptoverwritedialog.cpp \
|
dialogs/promptoverwritedialog.cpp \
|
||||||
fileutils.cpp \
|
fileutils.cpp \
|
||||||
textfile.cpp
|
textfile.cpp \
|
||||||
|
featureprovider.cpp
|
||||||
|
|
||||||
HEADERS += mainwindow.h \
|
HEADERS += mainwindow.h \
|
||||||
editmode.h \
|
editmode.h \
|
||||||
@@ -192,7 +193,8 @@ HEADERS += mainwindow.h \
|
|||||||
fileutils.h \
|
fileutils.h \
|
||||||
externaltoolmanager.h \
|
externaltoolmanager.h \
|
||||||
textfile.h \
|
textfile.h \
|
||||||
generatedfile.h
|
generatedfile.h \
|
||||||
|
featureprovider.h
|
||||||
|
|
||||||
FORMS += dialogs/newdialog.ui \
|
FORMS += dialogs/newdialog.ui \
|
||||||
actionmanager/commandmappings.ui \
|
actionmanager/commandmappings.ui \
|
||||||
|
|||||||
@@ -35,6 +35,8 @@
|
|||||||
|
|
||||||
#include <extensionsystem/pluginmanager.h>
|
#include <extensionsystem/pluginmanager.h>
|
||||||
|
|
||||||
|
#include <QtCore/QStringList>
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\class Core::IWizard
|
\class Core::IWizard
|
||||||
\mainclass
|
\mainclass
|
||||||
@@ -178,3 +180,14 @@ QList<IWizard*> IWizard::wizardsOfKind(WizardKind kind)
|
|||||||
return findWizards(WizardKindPredicate(kind));
|
return findWizards(WizardKindPredicate(kind));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool IWizard::isAvailable() const
|
||||||
|
{
|
||||||
|
FeatureSet availableFeatures;
|
||||||
|
|
||||||
|
const QList<Core::IFeatureProvider*> featureManagers = ExtensionSystem::PluginManager::instance()->getObjects<Core::IFeatureProvider>();
|
||||||
|
|
||||||
|
foreach (const Core::IFeatureProvider *featureManager, featureManagers)
|
||||||
|
availableFeatures |= featureManager->availableFeatures();
|
||||||
|
|
||||||
|
return availableFeatures.contains(requiredFeatures());
|
||||||
|
}
|
||||||
|
|||||||
@@ -34,6 +34,8 @@
|
|||||||
#define IWIZARD_H
|
#define IWIZARD_H
|
||||||
|
|
||||||
#include <coreplugin/core_global.h>
|
#include <coreplugin/core_global.h>
|
||||||
|
#include <coreplugin/featureprovider.h>
|
||||||
|
|
||||||
#include <QtCore/QObject>
|
#include <QtCore/QObject>
|
||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
QT_BEGIN_NAMESPACE
|
||||||
@@ -66,8 +68,12 @@ public:
|
|||||||
virtual QString category() const = 0;
|
virtual QString category() const = 0;
|
||||||
virtual QString displayCategory() const = 0;
|
virtual QString displayCategory() const = 0;
|
||||||
|
|
||||||
|
virtual FeatureSet requiredFeatures() const = 0;
|
||||||
|
|
||||||
virtual void runWizard(const QString &path, QWidget *parent) = 0;
|
virtual void runWizard(const QString &path, QWidget *parent) = 0;
|
||||||
|
|
||||||
|
bool isAvailable() const;
|
||||||
|
|
||||||
// Utility to find all registered wizards
|
// Utility to find all registered wizards
|
||||||
static QList<IWizard*> allWizards();
|
static QList<IWizard*> allWizards();
|
||||||
// Utility to find all registered wizards of a certain kind
|
// Utility to find all registered wizards of a certain kind
|
||||||
|
|||||||
@@ -37,7 +37,7 @@
|
|||||||
#include <utils/stylehelper.h>
|
#include <utils/stylehelper.h>
|
||||||
|
|
||||||
#include <coreplugin/coreconstants.h>
|
#include <coreplugin/coreconstants.h>
|
||||||
#include <coreplugin/dialogs/iwizard.h>
|
#include <coreplugin/featureprovider.h>
|
||||||
|
|
||||||
#include <QtGui/QAbstractProxyModel>
|
#include <QtGui/QAbstractProxyModel>
|
||||||
#include <QtGui/QItemSelectionModel>
|
#include <QtGui/QItemSelectionModel>
|
||||||
@@ -249,6 +249,7 @@ void NewDialog::setWizards(QList<IWizard*> wizards)
|
|||||||
cit = categories.insert(categoryName, categoryItem);
|
cit = categories.insert(categoryName, categoryItem);
|
||||||
}
|
}
|
||||||
// add item
|
// add item
|
||||||
|
if (wizard->isAvailable()) {
|
||||||
QStandardItem *wizardItem = new QStandardItem(wizard->displayName());
|
QStandardItem *wizardItem = new QStandardItem(wizard->displayName());
|
||||||
QIcon wizardIcon;
|
QIcon wizardIcon;
|
||||||
|
|
||||||
@@ -263,6 +264,7 @@ void NewDialog::setWizards(QList<IWizard*> wizards)
|
|||||||
wizardItem->setFlags(Qt::ItemIsEnabled|Qt::ItemIsSelectable);
|
wizardItem->setFlags(Qt::ItemIsEnabled|Qt::ItemIsSelectable);
|
||||||
cit.value()->appendRow(wizardItem);
|
cit.value()->appendRow(wizardItem);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
if (!projectKindItem->hasChildren()) {
|
if (!projectKindItem->hasChildren()) {
|
||||||
|
|||||||
111
src/plugins/coreplugin/featureprovider.cpp
Normal file
111
src/plugins/coreplugin/featureprovider.cpp
Normal file
@@ -0,0 +1,111 @@
|
|||||||
|
/**************************************************************************
|
||||||
|
**
|
||||||
|
** This file is part of Qt Creator
|
||||||
|
**
|
||||||
|
** Copyright (c) 2011 Nokia Corporation and/or its subsidiary(-ies).
|
||||||
|
**
|
||||||
|
** Contact: Nokia Corporation (qt-info@nokia.com)
|
||||||
|
**
|
||||||
|
**
|
||||||
|
** GNU Lesser General Public License Usage
|
||||||
|
**
|
||||||
|
** This file may be used under the terms of the GNU Lesser General Public
|
||||||
|
** License version 2.1 as published by the Free Software Foundation and
|
||||||
|
** appearing in the file LICENSE.LGPL included in the packaging of this file.
|
||||||
|
** Please review the following information to ensure the GNU Lesser General
|
||||||
|
** Public License version 2.1 requirements will be met:
|
||||||
|
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
||||||
|
**
|
||||||
|
** In addition, as a special exception, Nokia gives you certain additional
|
||||||
|
** rights. These rights are described in the Nokia Qt LGPL Exception
|
||||||
|
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
|
||||||
|
**
|
||||||
|
** Other Usage
|
||||||
|
**
|
||||||
|
** Alternatively, this file may be used in accordance with the terms and
|
||||||
|
** conditions contained in a signed written agreement between you and Nokia.
|
||||||
|
**
|
||||||
|
** If you have questions regarding the use of this file, please contact
|
||||||
|
** Nokia at qt-info@nokia.com.
|
||||||
|
**
|
||||||
|
**************************************************************************/
|
||||||
|
|
||||||
|
#include "featureprovider.h"
|
||||||
|
|
||||||
|
/*!
|
||||||
|
\class Core::IFeatureProvider
|
||||||
|
\mainclass
|
||||||
|
|
||||||
|
\brief The class IFeatureProvider defines an interface to manage features for wizards
|
||||||
|
|
||||||
|
The features provided by an object in the object pool implementing IFeatureProvider
|
||||||
|
will be respected by wizards implementing IWizard.
|
||||||
|
|
||||||
|
This feature set, provided by all instances of IFeatureProvider in the object pool, is checked against IWizard::requiredFeatures()
|
||||||
|
and only if all required features are available the wizard is displayed when creating a new file or project.
|
||||||
|
|
||||||
|
Qt4VersionManager creates an instance of IFeatureProvider and provides Qt specific features for the available
|
||||||
|
versions of Qt.
|
||||||
|
|
||||||
|
\sa Core::IWizard
|
||||||
|
\sa QtSupport::QtVersionManager
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/*!
|
||||||
|
\fn IFeatureProvider::IFeatureProvider()
|
||||||
|
\internal
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*!
|
||||||
|
\fn IFeatureProvider::~IFeatureProvider()
|
||||||
|
\internal
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*!
|
||||||
|
\fn FeatureProvider::Features availableFeatures() const;
|
||||||
|
Returns available features provided by this manager.
|
||||||
|
\sa FeatureProvider::Features
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*!
|
||||||
|
\class Core::FeatureProvider::Feature
|
||||||
|
|
||||||
|
\brief This class describes a single Feature
|
||||||
|
|
||||||
|
This class describes a single Feature to be used
|
||||||
|
in Core::FeatureProvider::Features.
|
||||||
|
|
||||||
|
\sa Core::FeatureProvider::Features
|
||||||
|
\sa Core::IWizard
|
||||||
|
\sa QtSupport::QtVersionManager
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*!
|
||||||
|
\class Core::FeatureProvider::Features
|
||||||
|
|
||||||
|
\brief This class is a set of features
|
||||||
|
|
||||||
|
Features is used to describe available or
|
||||||
|
required feature sets and behaves similar to QFlags.
|
||||||
|
|
||||||
|
But instead of enums Features relies on string ids
|
||||||
|
and is therefore extendable.
|
||||||
|
|
||||||
|
\sa Core::FeatureProvider::Feature
|
||||||
|
\sa Core::IWizard
|
||||||
|
\sa QtSupport::QtVersionManager
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/*!
|
||||||
|
\fn bool Features::~contains(const Feature &feature)()
|
||||||
|
|
||||||
|
\returns true if the \param features is available.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*!
|
||||||
|
\fn bool Features::~contains(const Features &features)()
|
||||||
|
|
||||||
|
\returns true if all \param features are available.
|
||||||
|
*/
|
||||||
161
src/plugins/coreplugin/featureprovider.h
Normal file
161
src/plugins/coreplugin/featureprovider.h
Normal file
@@ -0,0 +1,161 @@
|
|||||||
|
/**************************************************************************
|
||||||
|
**
|
||||||
|
** This file is part of Qt Creator
|
||||||
|
**
|
||||||
|
** Copyright (c) 2011 Nokia Corporation and/or its subsidiary(-ies).
|
||||||
|
**
|
||||||
|
** Contact: Nokia Corporation (qt-info@nokia.com)
|
||||||
|
**
|
||||||
|
**
|
||||||
|
** GNU Lesser General Public License Usage
|
||||||
|
**
|
||||||
|
** This file may be used under the terms of the GNU Lesser General Public
|
||||||
|
** License version 2.1 as published by the Free Software Foundation and
|
||||||
|
** appearing in the file LICENSE.LGPL included in the packaging of this file.
|
||||||
|
** Please review the following information to ensure the GNU Lesser General
|
||||||
|
** Public License version 2.1 requirements will be met:
|
||||||
|
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
||||||
|
**
|
||||||
|
** In addition, as a special exception, Nokia gives you certain additional
|
||||||
|
** rights. These rights are described in the Nokia Qt LGPL Exception
|
||||||
|
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
|
||||||
|
**
|
||||||
|
** Other Usage
|
||||||
|
**
|
||||||
|
** Alternatively, this file may be used in accordance with the terms and
|
||||||
|
** conditions contained in a signed written agreement between you and Nokia.
|
||||||
|
**
|
||||||
|
** If you have questions regarding the use of this file, please contact
|
||||||
|
** Nokia at qt-info@nokia.com.
|
||||||
|
**
|
||||||
|
**************************************************************************/
|
||||||
|
|
||||||
|
#ifndef FEATUREMANAGER_H
|
||||||
|
#define FEATUREMANAGER_H
|
||||||
|
|
||||||
|
#include "core_global.h"
|
||||||
|
|
||||||
|
#include <coreplugin/id.h>
|
||||||
|
|
||||||
|
#include <QtCore/QObject>
|
||||||
|
#include <QtCore/QSet>
|
||||||
|
#include <QtCore/QStringList>
|
||||||
|
|
||||||
|
|
||||||
|
namespace Utils {
|
||||||
|
class AbstractMacroExpander;
|
||||||
|
}
|
||||||
|
|
||||||
|
namespace Core {
|
||||||
|
|
||||||
|
class CORE_EXPORT FeatureSet;
|
||||||
|
|
||||||
|
class CORE_EXPORT IFeatureProvider : public QObject
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
public:
|
||||||
|
IFeatureProvider() {}
|
||||||
|
virtual ~IFeatureProvider() {}
|
||||||
|
virtual FeatureSet availableFeatures() const = 0;
|
||||||
|
};
|
||||||
|
|
||||||
|
class CORE_EXPORT Feature : public Id
|
||||||
|
{
|
||||||
|
friend class FeatureSet;
|
||||||
|
public:
|
||||||
|
Feature(const char *name) : Id(name) {}
|
||||||
|
explicit Feature(const QString &name) : Id(name) {}
|
||||||
|
};
|
||||||
|
|
||||||
|
class CORE_EXPORT FeatureSet : private QSet<Feature>
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
FeatureSet() {}
|
||||||
|
|
||||||
|
FeatureSet(const Feature &feature)
|
||||||
|
{
|
||||||
|
if (feature.toString().isEmpty())
|
||||||
|
return;
|
||||||
|
|
||||||
|
insert(feature);
|
||||||
|
}
|
||||||
|
|
||||||
|
FeatureSet(const FeatureSet &other) : QSet<Feature>(other) {}
|
||||||
|
|
||||||
|
FeatureSet &operator=(const FeatureSet &other)
|
||||||
|
{
|
||||||
|
QSet<Feature>::operator=(other);
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool contains(const Feature &feature) const
|
||||||
|
{
|
||||||
|
return QSet<Feature>::contains(feature);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool contains(const FeatureSet &features) const
|
||||||
|
{
|
||||||
|
return QSet<Feature>::contains(features);
|
||||||
|
}
|
||||||
|
|
||||||
|
void remove(const Feature &feature)
|
||||||
|
{
|
||||||
|
QSet<Feature>::remove(feature);
|
||||||
|
}
|
||||||
|
|
||||||
|
FeatureSet operator|(const Feature &feature) const
|
||||||
|
{
|
||||||
|
FeatureSet copy = *this;
|
||||||
|
if (feature.isValid())
|
||||||
|
copy.insert(feature);
|
||||||
|
return copy;
|
||||||
|
}
|
||||||
|
|
||||||
|
FeatureSet operator|(const FeatureSet &features) const
|
||||||
|
{
|
||||||
|
FeatureSet copy = *this;
|
||||||
|
if (!features.isEmpty())
|
||||||
|
copy.unite(features);
|
||||||
|
return copy;
|
||||||
|
}
|
||||||
|
|
||||||
|
FeatureSet &operator|=(const Feature &feature)
|
||||||
|
{
|
||||||
|
if (feature.isValid())
|
||||||
|
insert(feature);
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
|
FeatureSet &operator|=(const FeatureSet &features)
|
||||||
|
{
|
||||||
|
if (!features.isEmpty())
|
||||||
|
unite(features);
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
|
QStringList toStringList() const
|
||||||
|
{
|
||||||
|
QStringList stringList;
|
||||||
|
foreach (const Feature &feature, QSet<Feature>(*this))
|
||||||
|
stringList.append(feature.toString());
|
||||||
|
return stringList;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
} // namespace Core
|
||||||
|
|
||||||
|
/*
|
||||||
|
The following operators have to be defined in the global namespace!
|
||||||
|
Otherwise "using namespace Core" would hide other | operators
|
||||||
|
defined in the global namespace (e. g. QFlags).
|
||||||
|
*/
|
||||||
|
|
||||||
|
inline Core::FeatureSet operator |(Core::Feature feature1, Core::Feature feature2)
|
||||||
|
{ return Core::FeatureSet(feature1) | feature2; }
|
||||||
|
|
||||||
|
inline Core::FeatureSet operator|(Core::Feature feature1, Core::FeatureSet feature2)
|
||||||
|
{ return feature2 | feature1; }
|
||||||
|
|
||||||
|
|
||||||
|
#endif // FEATUREANAGER_H
|
||||||
@@ -155,6 +155,11 @@ CppClassWizard::CppClassWizard(const Core::BaseFileWizardParameters ¶meters,
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Core::FeatureSet CppClassWizard::requiredFeatures() const
|
||||||
|
{
|
||||||
|
return Core::FeatureSet();
|
||||||
|
}
|
||||||
|
|
||||||
QString CppClassWizard::sourceSuffix() const
|
QString CppClassWizard::sourceSuffix() const
|
||||||
{
|
{
|
||||||
return preferredSuffix(QLatin1String(Constants::CPP_SOURCE_MIMETYPE));
|
return preferredSuffix(QLatin1String(Constants::CPP_SOURCE_MIMETYPE));
|
||||||
|
|||||||
@@ -102,6 +102,8 @@ public:
|
|||||||
explicit CppClassWizard(const Core::BaseFileWizardParameters ¶meters,
|
explicit CppClassWizard(const Core::BaseFileWizardParameters ¶meters,
|
||||||
QObject *parent = 0);
|
QObject *parent = 0);
|
||||||
|
|
||||||
|
virtual Core::FeatureSet requiredFeatures() const;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual QWizard *createWizardDialog(QWidget *parent,
|
virtual QWizard *createWizardDialog(QWidget *parent,
|
||||||
const QString &defaultPath,
|
const QString &defaultPath,
|
||||||
|
|||||||
@@ -35,6 +35,7 @@
|
|||||||
#include "designerconstants.h"
|
#include "designerconstants.h"
|
||||||
#include "formwindoweditor.h"
|
#include "formwindoweditor.h"
|
||||||
#include "qtdesignerformclasscodegenerator.h"
|
#include "qtdesignerformclasscodegenerator.h"
|
||||||
|
#include <qtsupport/qtsupportconstants.h>
|
||||||
|
|
||||||
#include <coreplugin/icore.h>
|
#include <coreplugin/icore.h>
|
||||||
#include <cppeditor/cppeditorconstants.h>
|
#include <cppeditor/cppeditorconstants.h>
|
||||||
@@ -65,6 +66,11 @@ QString FormClassWizard::formSuffix() const
|
|||||||
return preferredSuffix(QLatin1String(Constants::FORM_MIMETYPE));
|
return preferredSuffix(QLatin1String(Constants::FORM_MIMETYPE));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Core::FeatureSet FormClassWizard::requiredFeatures() const
|
||||||
|
{
|
||||||
|
return Core::Feature(QtSupport::Constants::FEATURE_QWIDGETS);
|
||||||
|
}
|
||||||
|
|
||||||
QWizard *FormClassWizard::createWizardDialog(QWidget *parent,
|
QWizard *FormClassWizard::createWizardDialog(QWidget *parent,
|
||||||
const QString &defaultPath,
|
const QString &defaultPath,
|
||||||
const WizardPageList &extensionPages) const
|
const WizardPageList &extensionPages) const
|
||||||
|
|||||||
@@ -55,6 +55,8 @@ public:
|
|||||||
QString sourceSuffix() const;
|
QString sourceSuffix() const;
|
||||||
QString formSuffix() const;
|
QString formSuffix() const;
|
||||||
|
|
||||||
|
virtual Core::FeatureSet requiredFeatures() const;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual QWizard *createWizardDialog(QWidget *parent,
|
virtual QWizard *createWizardDialog(QWidget *parent,
|
||||||
const QString &defaultPath,
|
const QString &defaultPath,
|
||||||
|
|||||||
@@ -34,6 +34,7 @@
|
|||||||
#include "formwizarddialog.h"
|
#include "formwizarddialog.h"
|
||||||
#include "formwindoweditor.h"
|
#include "formwindoweditor.h"
|
||||||
#include "designerconstants.h"
|
#include "designerconstants.h"
|
||||||
|
#include <qtsupport/qtsupportconstants.h>
|
||||||
|
|
||||||
#include <QtCore/QDebug>
|
#include <QtCore/QDebug>
|
||||||
|
|
||||||
@@ -45,6 +46,11 @@ FormWizard::FormWizard(const BaseFileWizardParameters ¶meters, QObject *pare
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Core::FeatureSet FormWizard::requiredFeatures() const
|
||||||
|
{
|
||||||
|
return Core::Feature(QtSupport::Constants::FEATURE_QWIDGETS);
|
||||||
|
}
|
||||||
|
|
||||||
QWizard *FormWizard::createWizardDialog(QWidget *parent,
|
QWizard *FormWizard::createWizardDialog(QWidget *parent,
|
||||||
const QString &defaultPath,
|
const QString &defaultPath,
|
||||||
const WizardPageList &extensionPages) const
|
const WizardPageList &extensionPages) const
|
||||||
|
|||||||
@@ -47,6 +47,8 @@ public:
|
|||||||
|
|
||||||
FormWizard(const BaseFileWizardParameters ¶meters, QObject *parent);
|
FormWizard(const BaseFileWizardParameters ¶meters, QObject *parent);
|
||||||
|
|
||||||
|
virtual Core::FeatureSet requiredFeatures() const;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual QWizard *createWizardDialog(QWidget *parent,
|
virtual QWizard *createWizardDialog(QWidget *parent,
|
||||||
const QString &defaultPath,
|
const QString &defaultPath,
|
||||||
|
|||||||
@@ -116,6 +116,11 @@ GenericProjectWizard::GenericProjectWizard()
|
|||||||
GenericProjectWizard::~GenericProjectWizard()
|
GenericProjectWizard::~GenericProjectWizard()
|
||||||
{ }
|
{ }
|
||||||
|
|
||||||
|
Core::FeatureSet GenericProjectWizard::requiredFeatures() const
|
||||||
|
{
|
||||||
|
return Core::FeatureSet();
|
||||||
|
}
|
||||||
|
|
||||||
Core::BaseFileWizardParameters GenericProjectWizard::parameters()
|
Core::BaseFileWizardParameters GenericProjectWizard::parameters()
|
||||||
{
|
{
|
||||||
Core::BaseFileWizardParameters parameters(ProjectWizard);
|
Core::BaseFileWizardParameters parameters(ProjectWizard);
|
||||||
|
|||||||
@@ -78,6 +78,7 @@ class GenericProjectWizard : public Core::BaseFileWizard
|
|||||||
public:
|
public:
|
||||||
GenericProjectWizard();
|
GenericProjectWizard();
|
||||||
virtual ~GenericProjectWizard();
|
virtual ~GenericProjectWizard();
|
||||||
|
virtual Core::FeatureSet requiredFeatures() const;
|
||||||
|
|
||||||
static Core::BaseFileWizardParameters parameters();
|
static Core::BaseFileWizardParameters parameters();
|
||||||
|
|
||||||
|
|||||||
@@ -63,6 +63,11 @@ GLSLFileWizard::GLSLFileWizard(const BaseFileWizardParameters ¶meters,
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Core::FeatureSet GLSLFileWizard::requiredFeatures() const
|
||||||
|
{
|
||||||
|
return Core::FeatureSet();
|
||||||
|
}
|
||||||
|
|
||||||
Core::GeneratedFiles GLSLFileWizard::generateFiles(const QWizard *w,
|
Core::GeneratedFiles GLSLFileWizard::generateFiles(const QWizard *w,
|
||||||
QString * /*errorMessage*/) const
|
QString * /*errorMessage*/) const
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -55,6 +55,8 @@ public:
|
|||||||
explicit GLSLFileWizard(const BaseFileWizardParameters ¶meters,
|
explicit GLSLFileWizard(const BaseFileWizardParameters ¶meters,
|
||||||
ShaderType shaderType, QObject *parent = 0);
|
ShaderType shaderType, QObject *parent = 0);
|
||||||
|
|
||||||
|
virtual Core::FeatureSet requiredFeatures() const;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
QString fileContents(const QString &baseName, ShaderType shaderType) const;
|
QString fileContents(const QString &baseName, ShaderType shaderType) const;
|
||||||
|
|
||||||
|
|||||||
@@ -176,6 +176,15 @@ QString MaemoQtVersion::osType() const
|
|||||||
return m_osType;
|
return m_osType;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Core::FeatureSet MaemoQtVersion::availableFeatures() const
|
||||||
|
{
|
||||||
|
Core::FeatureSet features = QtSupport::BaseQtVersion::availableFeatures();
|
||||||
|
if (qtVersion() >= QtSupport::QtVersionNumber(4, 7, 4)) //no reliable test for components, yet.
|
||||||
|
features |= Core::FeatureSet(QtSupport::Constants::FEATURE_QTQUICK_COMPONENTS_MEEGO);
|
||||||
|
return features;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void MaemoQtVersion::addToEnvironment(Utils::Environment &env) const
|
void MaemoQtVersion::addToEnvironment(Utils::Environment &env) const
|
||||||
{
|
{
|
||||||
const QString maddeRoot = MaemoGlobal::maddeRoot(qmakeCommand().toString());
|
const QString maddeRoot = MaemoGlobal::maddeRoot(qmakeCommand().toString());
|
||||||
|
|||||||
@@ -60,6 +60,8 @@ public:
|
|||||||
|
|
||||||
bool supportsShadowBuilds() const;
|
bool supportsShadowBuilds() const;
|
||||||
QString osType() const;
|
QString osType() const;
|
||||||
|
Core::FeatureSet availableFeatures() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
mutable QString m_systemRoot;
|
mutable QString m_systemRoot;
|
||||||
mutable QString m_osType;
|
mutable QString m_osType;
|
||||||
|
|||||||
@@ -165,8 +165,6 @@ QSet<QString> Qt4MaemoTargetFactory::targetFeatures(const QString & /*id*/) cons
|
|||||||
#ifndef Q_OS_WIN
|
#ifndef Q_OS_WIN
|
||||||
features << Qt4ProjectManager::Constants::SHADOWBUILD_TARGETFEATURE_ID;
|
features << Qt4ProjectManager::Constants::SHADOWBUILD_TARGETFEATURE_ID;
|
||||||
#endif
|
#endif
|
||||||
// how to check check whether the component set is really installed?
|
|
||||||
features << Qt4ProjectManager::Constants::QTQUICKCOMPONENTS_MEEGO_TARGETFEATURE_ID;
|
|
||||||
return features;
|
return features;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -252,6 +252,10 @@ Core::GeneratedFiles CustomWizard::generateFiles(const QWizard *dialog, QString
|
|||||||
return generateWizardFiles(errorMessage);
|
return generateWizardFiles(errorMessage);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Core::FeatureSet CustomWizard::requiredFeatures() const
|
||||||
|
{
|
||||||
|
return baseFileWizardParameters().requiredFeatures();
|
||||||
|
}
|
||||||
|
|
||||||
bool CustomWizard::writeFiles(const Core::GeneratedFiles &files, QString *errorMessage)
|
bool CustomWizard::writeFiles(const Core::GeneratedFiles &files, QString *errorMessage)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -94,6 +94,8 @@ public:
|
|||||||
|
|
||||||
virtual Core::GeneratedFiles generateFiles(const QWizard *w, QString *errorMessage) const;
|
virtual Core::GeneratedFiles generateFiles(const QWizard *w, QString *errorMessage) const;
|
||||||
|
|
||||||
|
virtual Core::FeatureSet requiredFeatures() const;
|
||||||
|
|
||||||
|
|
||||||
// Register a factory for a derived custom widget
|
// Register a factory for a derived custom widget
|
||||||
static void registerFactory(const QString &name, const ICustomWizardFactoryPtr &f);
|
static void registerFactory(const QString &name, const ICustomWizardFactoryPtr &f);
|
||||||
|
|||||||
@@ -67,6 +67,7 @@ static const char firstPageAttributeC[] = "firstpage";
|
|||||||
static const char langAttributeC[] = "xml:lang";
|
static const char langAttributeC[] = "xml:lang";
|
||||||
static const char categoryAttributeC[] = "category";
|
static const char categoryAttributeC[] = "category";
|
||||||
static const char displayCategoryElementC[] = "displaycategory";
|
static const char displayCategoryElementC[] = "displaycategory";
|
||||||
|
static const char featuresRequiredC[] = "featuresRequired";
|
||||||
static const char fieldPageTitleElementC[] = "fieldpagetitle";
|
static const char fieldPageTitleElementC[] = "fieldpagetitle";
|
||||||
static const char fieldsElementC[] = "fields";
|
static const char fieldsElementC[] = "fields";
|
||||||
static const char fieldElementC[] = "field";
|
static const char fieldElementC[] = "field";
|
||||||
@@ -486,6 +487,19 @@ static inline Core::IWizard::WizardKind kindAttribute(const QXmlStreamReader &r)
|
|||||||
return Core::IWizard::ProjectWizard;
|
return Core::IWizard::ProjectWizard;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static inline Core::FeatureSet requiredFeatures(const QXmlStreamReader &reader)
|
||||||
|
{
|
||||||
|
Core::FeatureSet r;
|
||||||
|
QString value = reader.attributes().value(QLatin1String(featuresRequiredC)).toString();
|
||||||
|
QStringList stringList = value.split(QLatin1Char(','), QString::SkipEmptyParts);
|
||||||
|
Core::FeatureSet features;
|
||||||
|
foreach (const QString &string, stringList) {
|
||||||
|
Core::Feature feature(string);
|
||||||
|
features |= feature;
|
||||||
|
}
|
||||||
|
return features;
|
||||||
|
}
|
||||||
|
|
||||||
static inline QString msgError(const QXmlStreamReader &reader,
|
static inline QString msgError(const QXmlStreamReader &reader,
|
||||||
const QString &fileName,
|
const QString &fileName,
|
||||||
const QString &what)
|
const QString &what)
|
||||||
@@ -591,6 +605,7 @@ CustomWizardParameters::ParseResult
|
|||||||
bp->setId(attributeValue(reader, idAttributeC));
|
bp->setId(attributeValue(reader, idAttributeC));
|
||||||
bp->setCategory(attributeValue(reader, categoryAttributeC));
|
bp->setCategory(attributeValue(reader, categoryAttributeC));
|
||||||
bp->setKind(kindAttribute(reader));
|
bp->setKind(kindAttribute(reader));
|
||||||
|
bp->setRequiredFeatures(requiredFeatures(reader));
|
||||||
klass = attributeValue(reader, klassAttributeC);
|
klass = attributeValue(reader, klassAttributeC);
|
||||||
firstPageId = integerAttributeValue(reader, firstPageAttributeC, -1);
|
firstPageId = integerAttributeValue(reader, firstPageAttributeC, -1);
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -98,6 +98,11 @@ JsFileWizard::JsFileWizard(const BaseFileWizardParameters ¶meters,
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Core::FeatureSet JsFileWizard::requiredFeatures() const
|
||||||
|
{
|
||||||
|
return Core::FeatureSet();
|
||||||
|
}
|
||||||
|
|
||||||
Core::GeneratedFiles JsFileWizard::generateFiles(const QWizard *w,
|
Core::GeneratedFiles JsFileWizard::generateFiles(const QWizard *w,
|
||||||
QString * /*errorMessage*/) const
|
QString * /*errorMessage*/) const
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -47,6 +47,8 @@ public:
|
|||||||
explicit JsFileWizard(const BaseFileWizardParameters ¶meters,
|
explicit JsFileWizard(const BaseFileWizardParameters ¶meters,
|
||||||
QObject *parent = 0);
|
QObject *parent = 0);
|
||||||
|
|
||||||
|
virtual Core::FeatureSet requiredFeatures() const;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
QString fileContents(const QString &baseName, bool statelessLibrary) const;
|
QString fileContents(const QString &baseName, bool statelessLibrary) const;
|
||||||
|
|
||||||
|
|||||||
@@ -64,6 +64,11 @@ QmlProjectApplicationWizard::QmlProjectApplicationWizard()
|
|||||||
QmlProjectApplicationWizard::~QmlProjectApplicationWizard()
|
QmlProjectApplicationWizard::~QmlProjectApplicationWizard()
|
||||||
{ }
|
{ }
|
||||||
|
|
||||||
|
Core::FeatureSet QmlProjectApplicationWizard::requiredFeatures() const
|
||||||
|
{
|
||||||
|
return Core::Feature(QtSupport::Constants::FEATURE_QT_QUICK);
|
||||||
|
}
|
||||||
|
|
||||||
Core::BaseFileWizardParameters QmlProjectApplicationWizard::parameters()
|
Core::BaseFileWizardParameters QmlProjectApplicationWizard::parameters()
|
||||||
{
|
{
|
||||||
Core::BaseFileWizardParameters parameters(ProjectWizard);
|
Core::BaseFileWizardParameters parameters(ProjectWizard);
|
||||||
|
|||||||
@@ -53,6 +53,7 @@ class QmlProjectApplicationWizard : public Core::BaseFileWizard
|
|||||||
public:
|
public:
|
||||||
QmlProjectApplicationWizard();
|
QmlProjectApplicationWizard();
|
||||||
virtual ~QmlProjectApplicationWizard();
|
virtual ~QmlProjectApplicationWizard();
|
||||||
|
virtual Core::FeatureSet requiredFeatures() const;
|
||||||
|
|
||||||
static Core::BaseFileWizardParameters parameters();
|
static Core::BaseFileWizardParameters parameters();
|
||||||
|
|
||||||
|
|||||||
@@ -34,6 +34,7 @@
|
|||||||
#define BUILDCONFIGURATIONINFO_H
|
#define BUILDCONFIGURATIONINFO_H
|
||||||
|
|
||||||
#include "qt4projectmanager_global.h"
|
#include "qt4projectmanager_global.h"
|
||||||
|
#include <coreplugin/featureprovider.h>
|
||||||
#include <qtsupport/baseqtversion.h>
|
#include <qtsupport/baseqtversion.h>
|
||||||
|
|
||||||
namespace Qt4ProjectManager {
|
namespace Qt4ProjectManager {
|
||||||
@@ -72,6 +73,7 @@ struct QT4PROJECTMANAGER_EXPORT BuildConfigurationInfo {
|
|||||||
static QList<BuildConfigurationInfo> importBuildConfigurations(const QString &proFilePath);
|
static QList<BuildConfigurationInfo> importBuildConfigurations(const QString &proFilePath);
|
||||||
static QList<BuildConfigurationInfo> checkForBuild(const QString &directory, const QString &proFilePath);
|
static QList<BuildConfigurationInfo> checkForBuild(const QString &directory, const QString &proFilePath);
|
||||||
static QList<BuildConfigurationInfo> filterBuildConfigurationInfos(const QList<BuildConfigurationInfo> &infos, const QString &id);
|
static QList<BuildConfigurationInfo> filterBuildConfigurationInfos(const QList<BuildConfigurationInfo> &infos, const QString &id);
|
||||||
|
static QList<BuildConfigurationInfo> filterBuildConfigurationInfos(const QList<BuildConfigurationInfo> &infos, Core::FeatureSet features);
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace Qt4ProjectManager
|
} // namespace Qt4ProjectManager
|
||||||
|
|||||||
@@ -38,6 +38,8 @@
|
|||||||
|
|
||||||
#include <projectexplorer/projectexplorerconstants.h>
|
#include <projectexplorer/projectexplorerconstants.h>
|
||||||
|
|
||||||
|
#include <qtsupport/qtsupportconstants.h>
|
||||||
|
|
||||||
#include <QtGui/QIcon>
|
#include <QtGui/QIcon>
|
||||||
|
|
||||||
namespace Qt4ProjectManager {
|
namespace Qt4ProjectManager {
|
||||||
@@ -53,6 +55,11 @@ CustomWidgetWizard::CustomWidgetWizard() :
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Core::FeatureSet CustomWidgetWizard::requiredFeatures() const
|
||||||
|
{
|
||||||
|
return Core::Feature(QtSupport::Constants::FEATURE_QWIDGETS);
|
||||||
|
}
|
||||||
|
|
||||||
QWizard *CustomWidgetWizard::createWizardDialog(QWidget *parent,
|
QWizard *CustomWidgetWizard::createWizardDialog(QWidget *parent,
|
||||||
const QString &defaultPath,
|
const QString &defaultPath,
|
||||||
const WizardPageList &extensionPages) const
|
const WizardPageList &extensionPages) const
|
||||||
|
|||||||
@@ -44,6 +44,7 @@ class CustomWidgetWizard : public QtWizard
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
CustomWidgetWizard();
|
CustomWidgetWizard();
|
||||||
|
virtual Core::FeatureSet requiredFeatures() const;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual QWizard *createWizardDialog(QWidget *parent,
|
virtual QWizard *createWizardDialog(QWidget *parent,
|
||||||
|
|||||||
@@ -99,3 +99,12 @@ QString DesktopQtVersion::description() const
|
|||||||
{
|
{
|
||||||
return QCoreApplication::translate("QtVersion", "Desktop", "Qt Version is meant for the desktop");
|
return QCoreApplication::translate("QtVersion", "Desktop", "Qt Version is meant for the desktop");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Core::FeatureSet DesktopQtVersion::availableFeatures() const
|
||||||
|
{
|
||||||
|
Core::FeatureSet features = QtSupport::BaseQtVersion::availableFeatures();
|
||||||
|
if (qtVersion() >= QtSupport::QtVersionNumber(4, 7, 4)) //no reliable test for components, yet.
|
||||||
|
features |= Core::FeatureSet(QtSupport::Constants::FEATURE_QTQUICK_COMPONENTS_MEEGO)
|
||||||
|
| Core::FeatureSet(QtSupport::Constants::FEATURE_QTQUICK_COMPONENTS_SYMBIAN);
|
||||||
|
return features;
|
||||||
|
}
|
||||||
|
|||||||
@@ -57,6 +57,8 @@ public:
|
|||||||
QSet<QString> supportedTargetIds() const;
|
QSet<QString> supportedTargetIds() const;
|
||||||
|
|
||||||
QString description() const;
|
QString description() const;
|
||||||
|
|
||||||
|
Core::FeatureSet availableFeatures() const;
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -164,11 +164,9 @@ ProjectExplorer::Target *Qt4DesktopTargetFactory::create(ProjectExplorer::Projec
|
|||||||
QSet<QString> Qt4DesktopTargetFactory::targetFeatures(const QString & /*id*/) const
|
QSet<QString> Qt4DesktopTargetFactory::targetFeatures(const QString & /*id*/) const
|
||||||
{
|
{
|
||||||
QSet<QString> features;
|
QSet<QString> features;
|
||||||
features << QLatin1String(Constants::DESKTOP_TARGETFEATURE_ID)
|
features << QLatin1String(Constants::DESKTOP_TARGETFEATURE_ID);
|
||||||
<< QLatin1String(Constants::SHADOWBUILD_TARGETFEATURE_ID)
|
features << QLatin1String(Constants::SHADOWBUILD_TARGETFEATURE_ID);
|
||||||
// how to check check whether they component set is really installed?
|
|
||||||
<< QLatin1String(Constants::QTQUICKCOMPONENTS_SYMBIAN_TARGETFEATURE_ID)
|
|
||||||
<< QLatin1String(Constants::QTQUICKCOMPONENTS_MEEGO_TARGETFEATURE_ID);
|
|
||||||
return features;
|
return features;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -129,10 +129,8 @@ QSet<QString> Qt4SimulatorTargetFactory::targetFeatures(const QString & /*id*/)
|
|||||||
QSet<QString> features;
|
QSet<QString> features;
|
||||||
|
|
||||||
features << QLatin1String(Constants::MOBILE_TARGETFEATURE_ID)
|
features << QLatin1String(Constants::MOBILE_TARGETFEATURE_ID)
|
||||||
<< QLatin1String(Constants::SHADOWBUILD_TARGETFEATURE_ID)
|
<< QLatin1String(Constants::SHADOWBUILD_TARGETFEATURE_ID);
|
||||||
// how to check check whether the component set is really installed?
|
|
||||||
<< QLatin1String(Constants::QTQUICKCOMPONENTS_SYMBIAN_TARGETFEATURE_ID)
|
|
||||||
<< QLatin1String(Constants::QTQUICKCOMPONENTS_MEEGO_TARGETFEATURE_ID);
|
|
||||||
return features;
|
return features;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -190,9 +190,8 @@ bool Qt4SymbianTargetFactory::selectByDefault(const QString &id) const
|
|||||||
QSet<QString> Qt4SymbianTargetFactory::targetFeatures(const QString & /*id*/) const
|
QSet<QString> Qt4SymbianTargetFactory::targetFeatures(const QString & /*id*/) const
|
||||||
{
|
{
|
||||||
QSet<QString> features;
|
QSet<QString> features;
|
||||||
features << QLatin1String(Constants::MOBILE_TARGETFEATURE_ID)
|
features << QLatin1String(Constants::MOBILE_TARGETFEATURE_ID);
|
||||||
// ideally we should check whether they're really installed
|
|
||||||
<< QLatin1String(Constants::QTQUICKCOMPONENTS_SYMBIAN_TARGETFEATURE_ID);
|
|
||||||
return features;
|
return features;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -364,6 +364,16 @@ void SymbianQtVersion::setSystemRoot(const QString &root)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Core::FeatureSet SymbianQtVersion::availableFeatures() const
|
||||||
|
{
|
||||||
|
Core::FeatureSet features = QtSupport::BaseQtVersion::availableFeatures();
|
||||||
|
if (qtVersion() >= QtSupport::QtVersionNumber(4, 7, 4)) //no reliable test for components, yet.
|
||||||
|
features |= Core::FeatureSet(QtSupport::Constants::FEATURE_QTQUICK_COMPONENTS_SYMBIAN);
|
||||||
|
features.remove(Core::Feature(QtSupport::Constants::FEATURE_QT_CONSOLE));
|
||||||
|
|
||||||
|
return features;
|
||||||
|
}
|
||||||
|
|
||||||
QString SymbianQtVersion::systemRoot() const
|
QString SymbianQtVersion::systemRoot() const
|
||||||
{
|
{
|
||||||
return m_systemRoot;
|
return m_systemRoot;
|
||||||
|
|||||||
@@ -83,6 +83,8 @@ public:
|
|||||||
|
|
||||||
QtSupport::QtConfigWidget *createConfigurationWidget() const;
|
QtSupport::QtConfigWidget *createConfigurationWidget() const;
|
||||||
|
|
||||||
|
Core::FeatureSet availableFeatures() const;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
QList<ProjectExplorer::Task> reportIssuesImpl(const QString &proFile, const QString &buildDir);
|
QList<ProjectExplorer::Task> reportIssuesImpl(const QString &proFile, const QString &buildDir);
|
||||||
void parseMkSpec(ProFileEvaluator *) const;
|
void parseMkSpec(ProFileEvaluator *) const;
|
||||||
|
|||||||
@@ -85,11 +85,6 @@ const char QT_SIMULATOR_TARGET_ID[] = "Qt4ProjectManager.Target.QtSimulatorTarge
|
|||||||
const char MOBILE_TARGETFEATURE_ID[] = "Qt4ProjectManager.TargetFeature.Mobile";
|
const char MOBILE_TARGETFEATURE_ID[] = "Qt4ProjectManager.TargetFeature.Mobile";
|
||||||
const char DESKTOP_TARGETFEATURE_ID[] = "Qt4ProjectManager.TargetFeature.Desktop";
|
const char DESKTOP_TARGETFEATURE_ID[] = "Qt4ProjectManager.TargetFeature.Desktop";
|
||||||
const char SHADOWBUILD_TARGETFEATURE_ID[] = "Qt4ProjectManager.TargetFeature.ShadowBuild";
|
const char SHADOWBUILD_TARGETFEATURE_ID[] = "Qt4ProjectManager.TargetFeature.ShadowBuild";
|
||||||
const char QTQUICKCOMPONENTS_SYMBIAN_TARGETFEATURE_ID[]
|
|
||||||
= "Qt4ProjectManager.TargetFeature.QtQuickComponentsSymbian";
|
|
||||||
const char QTQUICKCOMPONENTS_MEEGO_TARGETFEATURE_ID[]
|
|
||||||
= "Qt4ProjectManager.TargetFeature.QtQuickComponentsMeego";
|
|
||||||
|
|
||||||
|
|
||||||
// Tool chains:
|
// Tool chains:
|
||||||
const char GCCE_TOOLCHAIN_ID[] = "Qt4ProjectManager.ToolChain.GCCE";
|
const char GCCE_TOOLCHAIN_ID[] = "Qt4ProjectManager.ToolChain.GCCE";
|
||||||
|
|||||||
@@ -1176,6 +1176,15 @@ QList<BuildConfigurationInfo> BuildConfigurationInfo::filterBuildConfigurationIn
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QList<BuildConfigurationInfo> BuildConfigurationInfo::filterBuildConfigurationInfos(const QList<BuildConfigurationInfo> &infos, Core::FeatureSet features)
|
||||||
|
{
|
||||||
|
QList<BuildConfigurationInfo> result;
|
||||||
|
foreach (const BuildConfigurationInfo &info, infos)
|
||||||
|
if (info.version->availableFeatures().contains(features))
|
||||||
|
result.append(info);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
QList<BuildConfigurationInfo> BuildConfigurationInfo::importBuildConfigurations(const QString &proFilePath)
|
QList<BuildConfigurationInfo> BuildConfigurationInfo::importBuildConfigurations(const QString &proFilePath)
|
||||||
{
|
{
|
||||||
QList<BuildConfigurationInfo> result;
|
QList<BuildConfigurationInfo> result;
|
||||||
|
|||||||
@@ -37,6 +37,7 @@
|
|||||||
|
|
||||||
#include <projectexplorer/projectexplorerconstants.h>
|
#include <projectexplorer/projectexplorerconstants.h>
|
||||||
#include <cpptools/abstracteditorsupport.h>
|
#include <cpptools/abstracteditorsupport.h>
|
||||||
|
#include <qtsupport/qtsupportconstants.h>
|
||||||
|
|
||||||
#include <QtGui/QIcon>
|
#include <QtGui/QIcon>
|
||||||
#include <QtCore/QFileInfo>
|
#include <QtCore/QFileInfo>
|
||||||
@@ -107,5 +108,10 @@ Core::GeneratedFiles
|
|||||||
return Core::GeneratedFiles() << source << profile;
|
return Core::GeneratedFiles() << source << profile;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Core::FeatureSet ConsoleAppWizard::requiredFeatures() const
|
||||||
|
{
|
||||||
|
return Core::Feature(QtSupport::Constants::FEATURE_GENERIC_CPP_ENTRY_POINT);
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace Internal
|
} // namespace Internal
|
||||||
} // namespace Qt4ProjectManager
|
} // namespace Qt4ProjectManager
|
||||||
|
|||||||
@@ -54,6 +54,8 @@ protected:
|
|||||||
|
|
||||||
virtual Core::GeneratedFiles generateFiles(const QWizard *w,
|
virtual Core::GeneratedFiles generateFiles(const QWizard *w,
|
||||||
QString *errorMessage) const;
|
QString *errorMessage) const;
|
||||||
|
|
||||||
|
virtual Core::FeatureSet requiredFeatures() const;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace Internal
|
} // namespace Internal
|
||||||
|
|||||||
@@ -52,6 +52,11 @@ EmptyProjectWizard::EmptyProjectWizard()
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Core::FeatureSet EmptyProjectWizard::requiredFeatures() const
|
||||||
|
{
|
||||||
|
return Core::FeatureSet();
|
||||||
|
}
|
||||||
|
|
||||||
QWizard *EmptyProjectWizard::createWizardDialog(QWidget *parent,
|
QWizard *EmptyProjectWizard::createWizardDialog(QWidget *parent,
|
||||||
const QString &defaultPath,
|
const QString &defaultPath,
|
||||||
const WizardPageList &extensionPages) const
|
const WizardPageList &extensionPages) const
|
||||||
|
|||||||
@@ -44,6 +44,7 @@ class EmptyProjectWizard : public QtWizard
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
EmptyProjectWizard();
|
EmptyProjectWizard();
|
||||||
|
virtual Core::FeatureSet requiredFeatures() const;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual QWizard *createWizardDialog(QWidget *parent,
|
virtual QWizard *createWizardDialog(QWidget *parent,
|
||||||
|
|||||||
@@ -40,6 +40,7 @@
|
|||||||
#include <coreplugin/icore.h>
|
#include <coreplugin/icore.h>
|
||||||
#include <extensionsystem/pluginmanager.h>
|
#include <extensionsystem/pluginmanager.h>
|
||||||
#include <extensionsystem/invoker.h>
|
#include <extensionsystem/invoker.h>
|
||||||
|
#include <qtsupport/qtsupportconstants.h>
|
||||||
|
|
||||||
#include <utils/fileutils.h>
|
#include <utils/fileutils.h>
|
||||||
|
|
||||||
@@ -95,6 +96,11 @@ GuiAppWizard::GuiAppWizard()
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Core::FeatureSet GuiAppWizard::requiredFeatures() const
|
||||||
|
{
|
||||||
|
return Core::Feature(QtSupport::Constants::FEATURE_QWIDGETS);
|
||||||
|
}
|
||||||
|
|
||||||
GuiAppWizard::GuiAppWizard(const QString &id,
|
GuiAppWizard::GuiAppWizard(const QString &id,
|
||||||
const QString &category,
|
const QString &category,
|
||||||
const QString &displayCategory,
|
const QString &displayCategory,
|
||||||
|
|||||||
@@ -46,6 +46,7 @@ class GuiAppWizard : public QtWizard
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
GuiAppWizard();
|
GuiAppWizard();
|
||||||
|
virtual Core::FeatureSet requiredFeatures() const;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
GuiAppWizard(const QString &id,
|
GuiAppWizard(const QString &id,
|
||||||
|
|||||||
@@ -39,6 +39,7 @@
|
|||||||
#include "qt4projectmanagerconstants.h"
|
#include "qt4projectmanagerconstants.h"
|
||||||
|
|
||||||
#include <projectexplorer/projectexplorerconstants.h>
|
#include <projectexplorer/projectexplorerconstants.h>
|
||||||
|
#include <qtsupport/qtsupportconstants.h>
|
||||||
#include <limits>
|
#include <limits>
|
||||||
|
|
||||||
#include <QtCore/QCoreApplication>
|
#include <QtCore/QCoreApplication>
|
||||||
@@ -93,6 +94,11 @@ Html5AppWizard::~Html5AppWizard()
|
|||||||
delete d;
|
delete d;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Core::FeatureSet Html5AppWizard::requiredFeatures() const
|
||||||
|
{
|
||||||
|
return Core::Feature(QtSupport::Constants::FEATURE_GENERIC_CPP_ENTRY_POINT);
|
||||||
|
}
|
||||||
|
|
||||||
Core::BaseFileWizardParameters Html5AppWizard::parameters()
|
Core::BaseFileWizardParameters Html5AppWizard::parameters()
|
||||||
{
|
{
|
||||||
Core::BaseFileWizardParameters parameters(ProjectWizard);
|
Core::BaseFileWizardParameters parameters(ProjectWizard);
|
||||||
|
|||||||
@@ -45,6 +45,7 @@ class Html5AppWizard : public AbstractMobileAppWizard
|
|||||||
public:
|
public:
|
||||||
Html5AppWizard();
|
Html5AppWizard();
|
||||||
virtual ~Html5AppWizard();
|
virtual ~Html5AppWizard();
|
||||||
|
virtual Core::FeatureSet requiredFeatures() const;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
QString fileToOpenPostGeneration() const;
|
QString fileToOpenPostGeneration() const;
|
||||||
|
|||||||
@@ -143,5 +143,10 @@ Core::GeneratedFiles LibraryWizard::generateFiles(const QWizard *w,
|
|||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Core::FeatureSet LibraryWizard::requiredFeatures() const
|
||||||
|
{
|
||||||
|
return Core::FeatureSet();
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace Internal
|
} // namespace Internal
|
||||||
} // namespace Qt4ProjectManager
|
} // namespace Qt4ProjectManager
|
||||||
|
|||||||
@@ -56,6 +56,7 @@ protected:
|
|||||||
|
|
||||||
virtual Core::GeneratedFiles generateFiles(const QWizard *w,
|
virtual Core::GeneratedFiles generateFiles(const QWizard *w,
|
||||||
QString *errorMessage) const;
|
QString *errorMessage) const;
|
||||||
|
virtual Core::FeatureSet requiredFeatures() const;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace Internal
|
} // namespace Internal
|
||||||
|
|||||||
@@ -40,6 +40,8 @@
|
|||||||
#include <projectexplorer/projectexplorerconstants.h>
|
#include <projectexplorer/projectexplorerconstants.h>
|
||||||
#include <projectexplorer/task.h>
|
#include <projectexplorer/task.h>
|
||||||
|
|
||||||
|
#include <qtsupport/qtsupportconstants.h>
|
||||||
|
|
||||||
#include <QtCore/QCoreApplication>
|
#include <QtCore/QCoreApplication>
|
||||||
#include <QtGui/QIcon>
|
#include <QtGui/QIcon>
|
||||||
|
|
||||||
@@ -89,6 +91,12 @@ MobileAppWizard::~MobileAppWizard()
|
|||||||
delete d;
|
delete d;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Core::FeatureSet MobileAppWizard::requiredFeatures() const
|
||||||
|
{
|
||||||
|
return Core::Feature(QtSupport::Constants::FEATURE_GENERIC_CPP_ENTRY_POINT)
|
||||||
|
| Core::Feature(QtSupport::Constants::FEATURE_QWIDGETS);
|
||||||
|
}
|
||||||
|
|
||||||
Core::BaseFileWizardParameters MobileAppWizard::parameters()
|
Core::BaseFileWizardParameters MobileAppWizard::parameters()
|
||||||
{
|
{
|
||||||
Core::BaseFileWizardParameters parameters(ProjectWizard);
|
Core::BaseFileWizardParameters parameters(ProjectWizard);
|
||||||
|
|||||||
@@ -45,6 +45,7 @@ class MobileAppWizard : public AbstractMobileAppWizard
|
|||||||
public:
|
public:
|
||||||
MobileAppWizard();
|
MobileAppWizard();
|
||||||
virtual ~MobileAppWizard();
|
virtual ~MobileAppWizard();
|
||||||
|
virtual Core::FeatureSet requiredFeatures() const;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
QString fileToOpenPostGeneration() const;
|
QString fileToOpenPostGeneration() const;
|
||||||
|
|||||||
@@ -39,6 +39,7 @@
|
|||||||
#include "qt4projectmanagerconstants.h"
|
#include "qt4projectmanagerconstants.h"
|
||||||
|
|
||||||
#include <qtsupport/qtsupportconstants.h>
|
#include <qtsupport/qtsupportconstants.h>
|
||||||
|
#include <coreplugin/dialogs/iwizard.h>
|
||||||
|
|
||||||
#include <QtCore/QCoreApplication>
|
#include <QtCore/QCoreApplication>
|
||||||
#include <QtGui/QIcon>
|
#include <QtGui/QIcon>
|
||||||
@@ -87,19 +88,12 @@ bool QtQuickAppWizardDialog::validateCurrentPage()
|
|||||||
setIgnoreGenericOptionsPage(false);
|
setIgnoreGenericOptionsPage(false);
|
||||||
if (m_componentOptionsPage->componentSet() == QtQuickApp::Symbian11Components) {
|
if (m_componentOptionsPage->componentSet() == QtQuickApp::Symbian11Components) {
|
||||||
setIgnoreGenericOptionsPage(true);
|
setIgnoreGenericOptionsPage(true);
|
||||||
targetsPage()->setMinimumQtVersion(QtSupport::QtVersionNumber(4, 7, 4));
|
targetsPage()->setRequiredQtFeatures(Core::FeatureSet(QtSupport::Constants::FEATURE_QTQUICK_COMPONENTS_MEEGO));
|
||||||
QSet<QString> requiredFeatures;
|
|
||||||
requiredFeatures << QLatin1String(Constants::QTQUICKCOMPONENTS_SYMBIAN_TARGETFEATURE_ID);
|
|
||||||
targetsPage()->setRequiredFeatures(requiredFeatures);
|
|
||||||
} else if (m_componentOptionsPage->componentSet() == QtQuickApp::Meego10Components) {
|
} else if (m_componentOptionsPage->componentSet() == QtQuickApp::Meego10Components) {
|
||||||
targetsPage()->setMinimumQtVersion(QtSupport::QtVersionNumber(4, 7, 4));
|
targetsPage()->setRequiredQtFeatures(Core::FeatureSet(QtSupport::Constants::FEATURE_QTQUICK_COMPONENTS_MEEGO));
|
||||||
QSet<QString> requiredFeatures;
|
|
||||||
requiredFeatures << QLatin1String(Constants::QTQUICKCOMPONENTS_MEEGO_TARGETFEATURE_ID);
|
|
||||||
targetsPage()->setRequiredFeatures(requiredFeatures);
|
|
||||||
} else {
|
} else {
|
||||||
targetsPage()->setMinimumQtVersion(QtSupport::QtVersionNumber(4, 7, 0));
|
targetsPage()->setMinimumQtVersion(QtSupport::QtVersionNumber(4, 7, 0));
|
||||||
QSet<QString> requiredFeatures;
|
targetsPage()->setRequiredQtFeatures(Core::FeatureSet());
|
||||||
targetsPage()->setRequiredFeatures(requiredFeatures);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return AbstractMobileAppWizardDialog::validateCurrentPage();
|
return AbstractMobileAppWizardDialog::validateCurrentPage();
|
||||||
@@ -126,6 +120,13 @@ QtQuickAppWizard::~QtQuickAppWizard()
|
|||||||
delete d;
|
delete d;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Core::FeatureSet QtQuickAppWizard::requiredFeatures() const
|
||||||
|
{
|
||||||
|
return Core::Feature(QtSupport::Constants::FEATURE_GENERIC_CPP_ENTRY_POINT) |
|
||||||
|
Core::Feature(QtSupport::Constants::FEATURE_QT_QUICK);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
Core::BaseFileWizardParameters QtQuickAppWizard::parameters()
|
Core::BaseFileWizardParameters QtQuickAppWizard::parameters()
|
||||||
{
|
{
|
||||||
Core::BaseFileWizardParameters parameters(ProjectWizard);
|
Core::BaseFileWizardParameters parameters(ProjectWizard);
|
||||||
|
|||||||
@@ -45,6 +45,7 @@ class QtQuickAppWizard : public AbstractMobileAppWizard
|
|||||||
public:
|
public:
|
||||||
QtQuickAppWizard();
|
QtQuickAppWizard();
|
||||||
virtual ~QtQuickAppWizard();
|
virtual ~QtQuickAppWizard();
|
||||||
|
virtual Core::FeatureSet requiredFeatures() const;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
QString fileToOpenPostGeneration() const;
|
QString fileToOpenPostGeneration() const;
|
||||||
|
|||||||
@@ -93,5 +93,10 @@ bool SubdirsProjectWizard::postGenerateFiles(const QWizard *w, const Core::Gener
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Core::FeatureSet SubdirsProjectWizard::requiredFeatures() const
|
||||||
|
{
|
||||||
|
return Core::FeatureSet();
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace Internal
|
} // namespace Internal
|
||||||
} // namespace Qt4ProjectManager
|
} // namespace Qt4ProjectManager
|
||||||
|
|||||||
@@ -53,6 +53,7 @@ protected:
|
|||||||
virtual Core::GeneratedFiles generateFiles(const QWizard *w,
|
virtual Core::GeneratedFiles generateFiles(const QWizard *w,
|
||||||
QString *errorMessage) const;
|
QString *errorMessage) const;
|
||||||
virtual bool postGenerateFiles(const QWizard *, const Core::GeneratedFiles &l, QString *errorMessage);
|
virtual bool postGenerateFiles(const QWizard *, const Core::GeneratedFiles &l, QString *errorMessage);
|
||||||
|
virtual Core::FeatureSet requiredFeatures() const;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace Internal
|
} // namespace Internal
|
||||||
|
|||||||
@@ -103,9 +103,14 @@ void TargetSetupPage::setPreferredFeatures(const QSet<QString> &featureIds)
|
|||||||
m_preferredFeatures = featureIds;
|
m_preferredFeatures = featureIds;
|
||||||
}
|
}
|
||||||
|
|
||||||
void TargetSetupPage::setRequiredFeatures(const QSet<QString> &featureIds)
|
void TargetSetupPage::setRequiredTargetFeatures(const QSet<QString> &featureIds)
|
||||||
{
|
{
|
||||||
m_requiredFeatures = featureIds;
|
m_requiredTargetFeatures = featureIds;
|
||||||
|
}
|
||||||
|
|
||||||
|
void TargetSetupPage::setRequiredQtFeatures(const Core::FeatureSet &features)
|
||||||
|
{
|
||||||
|
m_requiredQtFeatures = features;
|
||||||
}
|
}
|
||||||
|
|
||||||
void TargetSetupPage::setMinimumQtVersion(const QtSupport::QtVersionNumber &number)
|
void TargetSetupPage::setMinimumQtVersion(const QtSupport::QtVersionNumber &number)
|
||||||
@@ -130,10 +135,12 @@ void TargetSetupPage::setupWidgets()
|
|||||||
foreach (Qt4BaseTargetFactory *factory, factories) {
|
foreach (Qt4BaseTargetFactory *factory, factories) {
|
||||||
QStringList ids = factory->supportedTargetIds(0);
|
QStringList ids = factory->supportedTargetIds(0);
|
||||||
foreach (const QString &id, ids) {
|
foreach (const QString &id, ids) {
|
||||||
if (!factory->targetFeatures(id).contains(m_requiredFeatures))
|
if (!factory->targetFeatures(id).contains(m_requiredTargetFeatures))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
QList<BuildConfigurationInfo> infos = BuildConfigurationInfo::filterBuildConfigurationInfos(m_importInfos, id);
|
QList<BuildConfigurationInfo> infos = BuildConfigurationInfo::filterBuildConfigurationInfos(m_importInfos, id);
|
||||||
|
infos = BuildConfigurationInfo::filterBuildConfigurationInfos(infos, m_requiredQtFeatures);
|
||||||
|
|
||||||
Qt4TargetSetupWidget *widget =
|
Qt4TargetSetupWidget *widget =
|
||||||
factory->createTargetSetupWidget(id, m_proFilePath,
|
factory->createTargetSetupWidget(id, m_proFilePath,
|
||||||
m_minimumQtVersionNumber, m_maximumQtVersionNumber,
|
m_minimumQtVersionNumber, m_maximumQtVersionNumber,
|
||||||
|
|||||||
@@ -36,6 +36,7 @@
|
|||||||
#include "../qt4target.h"
|
#include "../qt4target.h"
|
||||||
#include "../qt4projectmanager_global.h"
|
#include "../qt4projectmanager_global.h"
|
||||||
#include <qtsupport/qtversionmanager.h>
|
#include <qtsupport/qtversionmanager.h>
|
||||||
|
#include <coreplugin/featureprovider.h>
|
||||||
|
|
||||||
#include <QtCore/QString>
|
#include <QtCore/QString>
|
||||||
#include <QtGui/QWizard>
|
#include <QtGui/QWizard>
|
||||||
@@ -77,7 +78,10 @@ public:
|
|||||||
void setPreferredFeatures(const QSet<QString> &featureIds);
|
void setPreferredFeatures(const QSet<QString> &featureIds);
|
||||||
/// Sets the features a target must support
|
/// Sets the features a target must support
|
||||||
/// call this before \sa initializePage()
|
/// call this before \sa initializePage()
|
||||||
void setRequiredFeatures(const QSet<QString> &featureIds);
|
void setRequiredTargetFeatures(const QSet<QString> &featureIds);
|
||||||
|
/// Sets the features a qt version must support
|
||||||
|
/// call this before \sa initializePage()
|
||||||
|
void setRequiredQtFeatures(const Core::FeatureSet &features);
|
||||||
/// Sets the minimum qt version
|
/// Sets the minimum qt version
|
||||||
/// calls this before \sa initializePage()
|
/// calls this before \sa initializePage()
|
||||||
void setMinimumQtVersion(const QtSupport::QtVersionNumber &number);
|
void setMinimumQtVersion(const QtSupport::QtVersionNumber &number);
|
||||||
@@ -102,7 +106,8 @@ private:
|
|||||||
void deleteWidgets();
|
void deleteWidgets();
|
||||||
|
|
||||||
QSet<QString> m_preferredFeatures;
|
QSet<QString> m_preferredFeatures;
|
||||||
QSet<QString> m_requiredFeatures;
|
QSet<QString> m_requiredTargetFeatures;
|
||||||
|
Core::FeatureSet m_requiredQtFeatures;
|
||||||
bool m_importSearch;
|
bool m_importSearch;
|
||||||
QtSupport::QtVersionNumber m_minimumQtVersionNumber;
|
QtSupport::QtVersionNumber m_minimumQtVersionNumber;
|
||||||
QtSupport::QtVersionNumber m_maximumQtVersionNumber;
|
QtSupport::QtVersionNumber m_maximumQtVersionNumber;
|
||||||
|
|||||||
@@ -35,6 +35,7 @@
|
|||||||
|
|
||||||
#include <cpptools/abstracteditorsupport.h>
|
#include <cpptools/abstracteditorsupport.h>
|
||||||
#include <projectexplorer/projectexplorerconstants.h>
|
#include <projectexplorer/projectexplorerconstants.h>
|
||||||
|
#include <qtsupport/qtsupportconstants.h>
|
||||||
|
|
||||||
#include <utils/qtcassert.h>
|
#include <utils/qtcassert.h>
|
||||||
|
|
||||||
@@ -186,5 +187,11 @@ Core::GeneratedFiles TestWizard::generateFiles(const QWizard *w, QString *errorM
|
|||||||
return Core::GeneratedFiles() << source << profile;
|
return Core::GeneratedFiles() << source << profile;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Core::FeatureSet TestWizard::requiredFeatures() const
|
||||||
|
{
|
||||||
|
return Core::Feature(QtSupport::Constants::FEATURE_GENERIC_CPP_ENTRY_POINT) |
|
||||||
|
Core::Feature(QtSupport::Constants::FEATURE_QT);
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace Internal
|
} // namespace Internal
|
||||||
} // namespace Qt4ProjectManager
|
} // namespace Qt4ProjectManager
|
||||||
|
|||||||
@@ -44,6 +44,7 @@ class TestWizard : public QtWizard
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
TestWizard();
|
TestWizard();
|
||||||
|
virtual Core::FeatureSet requiredFeatures() const;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual QWizard *createWizardDialog(QWidget *parent,
|
virtual QWizard *createWizardDialog(QWidget *parent,
|
||||||
|
|||||||
@@ -44,6 +44,7 @@
|
|||||||
#include <projectexplorer/projectexplorer.h>
|
#include <projectexplorer/projectexplorer.h>
|
||||||
#include <projectexplorer/projectexplorerconstants.h>
|
#include <projectexplorer/projectexplorerconstants.h>
|
||||||
#include <projectexplorer/toolchainmanager.h>
|
#include <projectexplorer/toolchainmanager.h>
|
||||||
|
#include <qtsupport/qtsupportconstants.h>
|
||||||
|
|
||||||
#include <utils/persistentsettings.h>
|
#include <utils/persistentsettings.h>
|
||||||
#include <utils/environment.h>
|
#include <utils/environment.h>
|
||||||
@@ -252,6 +253,20 @@ QString BaseQtVersion::defaultDisplayName(const QString &versionString, const Ut
|
|||||||
QCoreApplication::translate("QtVersion", "Qt %1 (%2)").arg(versionString, location);
|
QCoreApplication::translate("QtVersion", "Qt %1 (%2)").arg(versionString, location);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Core::FeatureSet BaseQtVersion::availableFeatures() const
|
||||||
|
{
|
||||||
|
Core::FeatureSet features = Core::FeatureSet(QtSupport::Constants::FEATURE_GENERIC_CPP_ENTRY_POINT) |
|
||||||
|
Core::FeatureSet(QtSupport::Constants::FEATURE_QWIDGETS)
|
||||||
|
| Core::FeatureSet(QtSupport::Constants::FEATURE_QT)
|
||||||
|
| Core::FeatureSet(QtSupport::Constants::FEATURE_QT_WEBKIT)
|
||||||
|
| Core::FeatureSet(QtSupport::Constants::FEATURE_QT_CONSOLE);
|
||||||
|
|
||||||
|
if (qtVersion() >= QtSupport::QtVersionNumber(4, 7, 0))
|
||||||
|
features |= Core::FeatureSet(QtSupport::Constants::FEATURE_QT_QUICK);
|
||||||
|
|
||||||
|
return features;
|
||||||
|
}
|
||||||
|
|
||||||
void BaseQtVersion::setId(int id)
|
void BaseQtVersion::setId(int id)
|
||||||
{
|
{
|
||||||
m_id = id;
|
m_id = id;
|
||||||
|
|||||||
@@ -40,6 +40,7 @@
|
|||||||
#include <projectexplorer/abi.h>
|
#include <projectexplorer/abi.h>
|
||||||
#include <projectexplorer/headerpath.h>
|
#include <projectexplorer/headerpath.h>
|
||||||
#include <projectexplorer/task.h>
|
#include <projectexplorer/task.h>
|
||||||
|
#include <coreplugin/featureprovider.h>
|
||||||
|
|
||||||
#include <QtCore/QVariantMap>
|
#include <QtCore/QVariantMap>
|
||||||
#include <QtGui/QWidget>
|
#include <QtGui/QWidget>
|
||||||
@@ -214,6 +215,8 @@ public:
|
|||||||
const Utils::FileName &qmakePath,
|
const Utils::FileName &qmakePath,
|
||||||
bool fromPath = false);
|
bool fromPath = false);
|
||||||
|
|
||||||
|
virtual Core::FeatureSet availableFeatures() const;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
BaseQtVersion();
|
BaseQtVersion();
|
||||||
BaseQtVersion(const Utils::FileName &path, bool isAutodetected = false, const QString &autodetectionSource = QString());
|
BaseQtVersion(const Utils::FileName &path, bool isAutodetected = false, const QString &autodetectionSource = QString());
|
||||||
|
|||||||
@@ -47,6 +47,17 @@ const char DESKTOPQT[] = "Qt4ProjectManager.QtVersion.Desktop";
|
|||||||
const char SIMULATORQT[] = "Qt4ProjectManager.QtVersion.Simulator";
|
const char SIMULATORQT[] = "Qt4ProjectManager.QtVersion.Simulator";
|
||||||
const char WINCEQT[] = "Qt4ProjectManager.QtVersion.WinCE";
|
const char WINCEQT[] = "Qt4ProjectManager.QtVersion.WinCE";
|
||||||
|
|
||||||
|
//Qt Features
|
||||||
|
const char FEATURE_QT[] = "QtSupport.Wizards.FeatureQt";
|
||||||
|
const char FEATURE_QWIDGETS[] = "QtSupport.Wizards.FeatureQWidgets";
|
||||||
|
const char FEATURE_QT_QUICK[] = "QtSupport.Wizards.FeatureQtQuick";
|
||||||
|
const char FEATURE_QT_WEBKIT[] = "QtSupport.Wizards.FeatureQtWebkit";
|
||||||
|
const char FEATURE_QT_CONSOLE[] = "QtSupport.Wizards.FeatureQtConsole";
|
||||||
|
const char FEATURE_GENERIC_CPP_ENTRY_POINT[] ="QtSupport.Wizards.FeatureGenericCppEntryPoint";
|
||||||
|
const char FEATURE_QTQUICK_COMPONENTS_SYMBIAN[] = "QtSupport.Wizards.FeatureQtQuickComponentsSymbian";
|
||||||
|
const char FEATURE_QTQUICK_COMPONENTS_MEEGO[] = "QtSupport.Wizards.FeatureQtQuickComponentsMeego";
|
||||||
|
|
||||||
|
|
||||||
// QML wizard categories
|
// QML wizard categories
|
||||||
// both the qt4projectmanager and the qmlprojectmanager do have qt quick wizards
|
// both the qt4projectmanager and the qmlprojectmanager do have qt quick wizards
|
||||||
// so we define the category here
|
// so we define the category here
|
||||||
|
|||||||
@@ -57,6 +57,10 @@ bool QtSupportPlugin::initialize(const QStringList &arguments, QString *errorMes
|
|||||||
|
|
||||||
QtVersionManager *mgr = new QtVersionManager;
|
QtVersionManager *mgr = new QtVersionManager;
|
||||||
addAutoReleasedObject(mgr);
|
addAutoReleasedObject(mgr);
|
||||||
|
|
||||||
|
QtFeatureProvider *featureMgr = new QtFeatureProvider;
|
||||||
|
addAutoReleasedObject(featureMgr);
|
||||||
|
|
||||||
addAutoReleasedObject(new QtOptionsPage);
|
addAutoReleasedObject(new QtOptionsPage);
|
||||||
|
|
||||||
ExamplesWelcomePage *welcomePage;
|
ExamplesWelcomePage *welcomePage;
|
||||||
|
|||||||
@@ -34,6 +34,8 @@
|
|||||||
|
|
||||||
#include "qtversionfactory.h"
|
#include "qtversionfactory.h"
|
||||||
|
|
||||||
|
#include "qtsupportconstants.h"
|
||||||
|
|
||||||
#include <projectexplorer/debugginghelper.h>
|
#include <projectexplorer/debugginghelper.h>
|
||||||
// only for legay restore
|
// only for legay restore
|
||||||
#include <projectexplorer/projectexplorerconstants.h>
|
#include <projectexplorer/projectexplorerconstants.h>
|
||||||
@@ -600,6 +602,18 @@ QString QtVersionManager::popPendingGcceUpdate()
|
|||||||
return m_pendingGcceUpdates.takeFirst();
|
return m_pendingGcceUpdates.takeFirst();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Core::FeatureSet QtVersionManager::availableFeatures() const
|
||||||
|
{
|
||||||
|
Core::FeatureSet features;
|
||||||
|
foreach (BaseQtVersion *const qtVersion, validVersions()) {
|
||||||
|
if (qtVersion->isValid())
|
||||||
|
features |= qtVersion->availableFeatures();
|
||||||
|
}
|
||||||
|
if (validVersions().empty())
|
||||||
|
features |= Constants::FEATURE_GENERIC_CPP_ENTRY_POINT;
|
||||||
|
return features;
|
||||||
|
}
|
||||||
|
|
||||||
BaseQtVersion *QtVersionManager::version(int id) const
|
BaseQtVersion *QtVersionManager::version(int id) const
|
||||||
{
|
{
|
||||||
QMap<int, BaseQtVersion *>::const_iterator it = m_versions.find(id);
|
QMap<int, BaseQtVersion *>::const_iterator it = m_versions.find(id);
|
||||||
@@ -919,3 +933,8 @@ BaseQtVersion::QmakeBuildConfigs QtVersionManager::qmakeBuildConfigFromCmdArgs(Q
|
|||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Core::FeatureSet QtFeatureProvider::availableFeatures() const
|
||||||
|
{
|
||||||
|
return QtVersionManager::instance()->availableFeatures();
|
||||||
|
}
|
||||||
|
|||||||
@@ -111,6 +111,9 @@ public:
|
|||||||
// Compatibility with pre-2.2:
|
// Compatibility with pre-2.2:
|
||||||
QString popPendingMwcUpdate();
|
QString popPendingMwcUpdate();
|
||||||
QString popPendingGcceUpdate();
|
QString popPendingGcceUpdate();
|
||||||
|
|
||||||
|
Core::FeatureSet availableFeatures() const;
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
// content of BaseQtVersion objects with qmake path might have changed
|
// content of BaseQtVersion objects with qmake path might have changed
|
||||||
void dumpUpdatedFor(const Utils::FileName &qmakeCommand);
|
void dumpUpdatedFor(const Utils::FileName &qmakeCommand);
|
||||||
@@ -159,6 +162,19 @@ private:
|
|||||||
QStringList m_pendingGcceUpdates;
|
QStringList m_pendingGcceUpdates;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
namespace Internal {
|
||||||
|
|
||||||
|
class QTSUPPORT_EXPORT QtFeatureProvider : public Core::IFeatureProvider
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
public:
|
||||||
|
QtFeatureProvider() {}
|
||||||
|
virtual Core::FeatureSet availableFeatures() const;
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace Qt4ProjectManager
|
} // namespace Qt4ProjectManager
|
||||||
|
|
||||||
#endif // QTVERSIONMANAGER_H
|
#endif // QTVERSIONMANAGER_H
|
||||||
|
|||||||
@@ -147,6 +147,11 @@ void BaseCheckoutWizard::runWizard(const QString &path, QWidget *parent)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Core::FeatureSet BaseCheckoutWizard::requiredFeatures() const
|
||||||
|
{
|
||||||
|
return Core::FeatureSet();
|
||||||
|
}
|
||||||
|
|
||||||
static inline QString msgNoProjectFiles(const QDir &dir, const QStringList &patterns)
|
static inline QString msgNoProjectFiles(const QDir &dir, const QStringList &patterns)
|
||||||
{
|
{
|
||||||
return BaseCheckoutWizard::tr("Could not find any project files matching (%1) in the directory '%2'.").arg(patterns.join(QLatin1String(", ")), QDir::toNativeSeparators(dir.absolutePath()));
|
return BaseCheckoutWizard::tr("Could not find any project files matching (%1) in the directory '%2'.").arg(patterns.join(QLatin1String(", ")), QDir::toNativeSeparators(dir.absolutePath()));
|
||||||
|
|||||||
@@ -66,6 +66,8 @@ public:
|
|||||||
|
|
||||||
virtual void runWizard(const QString &path, QWidget *parent);
|
virtual void runWizard(const QString &path, QWidget *parent);
|
||||||
|
|
||||||
|
virtual Core::FeatureSet requiredFeatures() const;
|
||||||
|
|
||||||
static QString openProject(const QString &path, QString *errorMessage);
|
static QString openProject(const QString &path, QString *errorMessage);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|||||||
Reference in New Issue
Block a user