From 95a028e835206b573c1115d395ff8f360f121e35 Mon Sep 17 00:00:00 2001 From: Thomas Hartmann <Thomas.Hartmann@nokia.com> Date: Wed, 8 Feb 2012 17:25:35 +0100 Subject: [PATCH] Wizards: changes the structure of Wizards This patch introduces platforms as a top level topic when choosing a wizard. Also I changed the categories and priorities. Details: 1. I did change the way the dialog/view is structured in newdialog.cpp 2. I added platformName() and supportsPlatform() to BaseQtVersion. I needed two functions because the Simulator does not provide a platform and therefore has no platformName but supports two platforms. I still have to turn the platform names into proper constants. 3. I changed the categories and priorities to get the layout that was discussed. (I had to touch quite alot of files but this is mostly trivial) 4. I added a combobox that allows filtering for platforms. 5. I added flags() to IWizard to indicate that a wizard is platform independent. Change-Id: I86c7ad628a431ad06505c76580885c6e6c3ddc23 Reviewed-by: Alessandro Portale <alessandro.portale@nokia.com> --- .../wizards/plaincapp-cmake/wizard.xml | 2 +- .../templates/wizards/plaincapp/wizard.xml | 4 +- .../wizards/plaincppapp-cmake/wizard.xml | 2 +- .../templates/wizards/plaincppapp/wizard.xml | 4 +- .../wizards/qml-extension/wizard.xml | 4 +- .../wizards/qtcreatorplugin/wizard.xml | 6 +- src/plugins/coreplugin/basefilewizard.cpp | 26 +- src/plugins/coreplugin/basefilewizard.h | 5 +- src/plugins/coreplugin/dialogs/iwizard.cpp | 42 +++- src/plugins/coreplugin/dialogs/iwizard.h | 13 +- src/plugins/coreplugin/dialogs/newdialog.cpp | 225 +++++++++++++----- src/plugins/coreplugin/dialogs/newdialog.h | 12 +- src/plugins/coreplugin/dialogs/newdialog.ui | 106 ++++++--- src/plugins/coreplugin/featureprovider.h | 4 +- src/plugins/coreplugin/mainwindow.cpp | 4 +- .../genericprojectwizard.cpp | 1 + src/plugins/glsleditor/glslfilewizard.cpp | 5 + src/plugins/glsleditor/glslfilewizard.h | 1 + src/plugins/madde/maemoqtversion.cpp | 10 + src/plugins/madde/maemoqtversion.h | 2 + .../baseprojectwizarddialog.cpp | 31 ++- .../projectexplorer/baseprojectwizarddialog.h | 6 + .../customwizard/customwizardparameters.cpp | 13 + .../projectexplorerconstants.h | 12 +- .../qmljseditor/qmljseditorconstants.h | 3 - src/plugins/qmljseditor/qmljseditorplugin.cpp | 8 +- .../qmlprojectapplicationwizard.cpp | 6 +- .../buildconfigurationinfo.h | 1 + .../qt-desktop/desktopqtversion.cpp | 11 + .../qt-desktop/desktopqtversion.h | 2 + .../qt-desktop/qt4desktoptargetfactory.cpp | 7 +- .../qt-desktop/qt4desktoptargetfactory.h | 2 + .../qt-desktop/simulatorqtversion.cpp | 7 + .../qt-desktop/simulatorqtversion.h | 2 + .../qt-s60/qt4symbiantargetfactory.cpp | 5 +- .../qt-s60/qt4symbiantargetfactory.h | 3 +- .../qt-s60/symbianqtversion.cpp | 11 + .../qt-s60/symbianqtversion.h | 2 + .../qt4projectmanager/qt4basetargetfactory.h | 8 +- src/plugins/qt4projectmanager/qt4target.cpp | 33 ++- .../qt4projectmanager/winceqtversion.cpp | 10 + .../qt4projectmanager/winceqtversion.h | 3 + .../wizards/abstractmobileappwizard.cpp | 2 + .../wizards/consoleappwizard.cpp | 4 +- .../wizards/guiappwizard.cpp | 4 +- .../wizards/html5appwizard.cpp | 4 +- .../wizards/librarywizard.cpp | 4 +- .../wizards/mobileappwizard.cpp | 5 +- .../wizards/qtquickappwizard.cpp | 6 +- .../qt4projectmanager/wizards/qtwizard.cpp | 2 + .../wizards/subdirsprojectwizard.cpp | 4 +- .../wizards/targetsetuppage.cpp | 22 +- .../wizards/targetsetuppage.h | 3 + src/plugins/qtsupport/baseqtversion.cpp | 17 ++ src/plugins/qtsupport/baseqtversion.h | 3 + src/plugins/qtsupport/qtsupportconstants.h | 22 +- src/plugins/qtsupport/qtversionmanager.cpp | 38 ++- src/plugins/qtsupport/qtversionmanager.h | 8 +- .../remotelinux/embeddedlinuxqtversion.cpp | 12 + .../remotelinux/embeddedlinuxqtversion.h | 3 + src/plugins/texteditor/texteditorplugin.cpp | 1 + src/plugins/vcsbase/basecheckoutwizard.cpp | 7 +- src/plugins/vcsbase/basecheckoutwizard.h | 4 +- 63 files changed, 667 insertions(+), 172 deletions(-) diff --git a/share/qtcreator/templates/wizards/plaincapp-cmake/wizard.xml b/share/qtcreator/templates/wizards/plaincapp-cmake/wizard.xml index bc49fa07b40..e84b03d3e06 100644 --- a/share/qtcreator/templates/wizards/plaincapp-cmake/wizard.xml +++ b/share/qtcreator/templates/wizards/plaincapp-cmake/wizard.xml @@ -37,7 +37,7 @@ 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" featuresRequired="QtSupport.Wizards.FeatureGenericCppEntryPoint"> +<wizard version="1" kind="project" firstpage="10" id="S.Plain C (CMake)" category="I.Projects" featuresRequired="QtSupport.Wizards.FeatureGenericCppEntryPoint" platformIndependent="true"> <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>; diff --git a/share/qtcreator/templates/wizards/plaincapp/wizard.xml b/share/qtcreator/templates/wizards/plaincapp/wizard.xml index 0e2d0fe4346..3dc4fe94b72 100644 --- a/share/qtcreator/templates/wizards/plaincapp/wizard.xml +++ b/share/qtcreator/templates/wizards/plaincapp/wizard.xml @@ -39,12 +39,12 @@ leave room for the Qt 4 target page. --> <wizard version="1" kind="project" class="qt4project" firstpage="10" - id="R.Plain C" category="I.Projects" + id="R.Plain C" category="H.QtProjects" featuresRequired="QtSupport.Wizards.FeatureGenericCppEntryPoint"> <icon>console.png</icon> <description>Creates a plain C project using qmake, not using the Qt library.</description> <displayname>Plain C Project</displayname>; - <displaycategory>Non-Qt Project</displaycategory> + <displaycategory>Other Projects</displaycategory> <files> <file source="main.c" openeditor="true"/> <file source="project.pro" target="%ProjectName%.pro" openproject="true"/> diff --git a/share/qtcreator/templates/wizards/plaincppapp-cmake/wizard.xml b/share/qtcreator/templates/wizards/plaincppapp-cmake/wizard.xml index 0cfd85350fe..b5c96e09a65 100644 --- a/share/qtcreator/templates/wizards/plaincppapp-cmake/wizard.xml +++ b/share/qtcreator/templates/wizards/plaincppapp-cmake/wizard.xml @@ -37,7 +37,7 @@ 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" featuresRequired="QtSupport.Wizards.FeatureGenericCppEntryPoint"> +<wizard version="1" kind="project" firstpage="10" id="S.Plain C++ (CMake)" category="I.Projects" featuresRequired="QtSupport.Wizards.FeatureGenericCppEntryPoint" platformIndependent="true"> <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>; diff --git a/share/qtcreator/templates/wizards/plaincppapp/wizard.xml b/share/qtcreator/templates/wizards/plaincppapp/wizard.xml index a246479a4d8..89a1b6d09a0 100644 --- a/share/qtcreator/templates/wizards/plaincppapp/wizard.xml +++ b/share/qtcreator/templates/wizards/plaincppapp/wizard.xml @@ -39,12 +39,12 @@ leave room for the Qt 4 target page. --> <wizard version="1" kind="project" class="qt4project" firstpage="10" - id="R.Plain C++" category="I.Projects" + id="R.Plain C++" category="H.QtProjects" featuresRequired="QtSupport.Wizards.FeatureGenericCppEntryPoint"> <icon>console.png</icon> <description>Creates a plain C++ project using qmake, not using the Qt library.</description> <displayname>Plain C++ Project</displayname>; - <displaycategory>Non-Qt Project</displaycategory> + <displaycategory>Other Projects</displaycategory> <files> <file source="main.cpp" openeditor="true"/> <file source="project.pro" target="%ProjectName%.pro" openproject="true"/> diff --git a/share/qtcreator/templates/wizards/qml-extension/wizard.xml b/share/qtcreator/templates/wizards/qml-extension/wizard.xml index bce853250f2..5ef91371e3b 100644 --- a/share/qtcreator/templates/wizards/qml-extension/wizard.xml +++ b/share/qtcreator/templates/wizards/qml-extension/wizard.xml @@ -39,12 +39,12 @@ leave room for the Qt 4 target page. --> <wizard version="1" kind="project" class="qt4project" firstpage="10" - id="QmlExtensionPlugin" category="C.Projects" + id="QmlExtensionPlugin" category="G.Libraries" featuresRequired="QtSupport.Wizards.FeatureQtQuick,QtSupport.Wizards.FeatureQtQuick.1"> <icon>lib.png</icon> <description>Creates a C++ plugin that makes it possible to offer extensions that can be loaded dynamically into applications using the QDeclarativeEngine class.</description> <displayname>Custom QML Extension Plugin</displayname> - <displaycategory>QML Extension Plugin</displaycategory> + <displaycategory>Libraries</displaycategory> <files> <file source="qmldir" target="qmldir"/> <file source="plugin.h" target="%ProjectName:l%_plugin.%CppHeaderSuffix%"/> diff --git a/share/qtcreator/templates/wizards/qtcreatorplugin/wizard.xml b/share/qtcreator/templates/wizards/qtcreatorplugin/wizard.xml index 0efe6ff1b6a..880a302440b 100644 --- a/share/qtcreator/templates/wizards/qtcreatorplugin/wizard.xml +++ b/share/qtcreator/templates/wizards/qtcreatorplugin/wizard.xml @@ -39,12 +39,12 @@ leave room for the Qt 4 target page. --> <wizard version="1" kind="project" class="qt4project" firstpage="10" - id="R.QtCreatorPlugin" category="F.QtProjects" - featuresRequired="QtSupport.Wizards.FeatureGenericCppEntryPoint,QtSupport.Wizards.FeatureQt"> + id="R.QtCreatorPlugin" category="G.Libraries" + featuresRequired="QtSupport.Wizards.FeatureGenericCppEntryPoint,QtSupport.Wizards.FeatureQt,QtSupport.Wizards.FeatureDesktop"> <icon>qtcreator_logo_24.png</icon> <description>Creates a custom Qt Creator plugin.</description> <displayname>Qt Creator Plugin</displayname>; - <displaycategory>Other Qt Project</displaycategory> + <displaycategory>Libraries</displaycategory> <files> <file source="myplugin.pro" target="%PluginName:l%.pro" openproject="true"/> <file source="MyPlugin.pluginspec.in" target="%PluginName%.pluginspec.in" openeditor="true"/> diff --git a/src/plugins/coreplugin/basefilewizard.cpp b/src/plugins/coreplugin/basefilewizard.cpp index 980d3981cd6..b04a4ef0fb4 100644 --- a/src/plugins/coreplugin/basefilewizard.cpp +++ b/src/plugins/coreplugin/basefilewizard.cpp @@ -87,6 +87,7 @@ public: QString category; QString displayCategory; Core::FeatureSet requiredFeatures; + Core::IWizard::WizardFlags flags; }; BaseFileWizardParameterData::BaseFileWizardParameterData(IWizard::WizardKind k) : @@ -232,6 +233,15 @@ void BaseFileWizardParameters::setDisplayCategory(const QString &v) m_d->displayCategory = v; } +Core::IWizard::WizardFlags BaseFileWizardParameters::flags() const +{ + return m_d->flags; +} + +void BaseFileWizardParameters::setFlags(Core::IWizard::WizardFlags flags) +{ + m_d->flags = flags; +} /*! \class Core::Internal::WizardEventLoop \brief Special event loop that runs a QWizard and terminates if the page changes. @@ -407,7 +417,7 @@ QString BaseFileWizard::displayCategory() const return d->m_parameters.displayCategory(); } -void BaseFileWizard::runWizard(const QString &path, QWidget *parent) +void BaseFileWizard::runWizard(const QString &path, QWidget *parent, const QString &platform) { QTC_ASSERT(!path.isEmpty(), return); @@ -437,11 +447,10 @@ void BaseFileWizard::runWizard(const QString &path, QWidget *parent) // Create dialog and run it. Ensure that the dialog is deleted when // leaving the func, but not before the IFileWizardExtension::process // has been called - const QScopedPointer<QWizard> wizard(createWizardDialog(parent, - WizardDialogParameters(path, - allExtensionPages, - QString(), - requiredFeatures()))); + const QScopedPointer<QWizard> wizard(createWizardDialog(parent, WizardDialogParameters(path, + allExtensionPages, + platform, + requiredFeatures()))); QTC_ASSERT(!wizard.isNull(), return); GeneratedFiles files; @@ -525,6 +534,11 @@ Core::FeatureSet BaseFileWizard::requiredFeatures() const return d->m_parameters.requiredFeatures(); } +Core::IWizard::WizardFlags BaseFileWizard::flags() const +{ + return d->m_parameters.flags(); +} + /*! \fn virtual QWizard *Core::BaseFileWizard::createWizardDialog(QWidget *parent, const QString &defaultPath, diff --git a/src/plugins/coreplugin/basefilewizard.h b/src/plugins/coreplugin/basefilewizard.h index 6a511c15b69..fb07b2da21a 100644 --- a/src/plugins/coreplugin/basefilewizard.h +++ b/src/plugins/coreplugin/basefilewizard.h @@ -94,6 +94,8 @@ public: Core::FeatureSet requiredFeatures() const; void setRequiredFeatures(Core::FeatureSet features); + Core::IWizard::WizardFlags flags() const; + void setFlags(Core::IWizard::WizardFlags flags); private: QSharedDataPointer<BaseFileWizardParameterData> m_d; }; @@ -148,8 +150,9 @@ public: virtual QString category() const; virtual QString displayCategory() const; - virtual void runWizard(const QString &path, QWidget *parent); + virtual void runWizard(const QString &path, QWidget *parent, const QString &platform); virtual Core::FeatureSet requiredFeatures() const; + virtual WizardFlags flags() const; static QString buildFileName(const QString &path, const QString &baseName, const QString &extension); static void setupWizard(QWizard *); diff --git a/src/plugins/coreplugin/dialogs/iwizard.cpp b/src/plugins/coreplugin/dialogs/iwizard.cpp index 17340fbed78..b246353731d 100644 --- a/src/plugins/coreplugin/dialogs/iwizard.cpp +++ b/src/plugins/coreplugin/dialogs/iwizard.cpp @@ -178,14 +178,52 @@ QList<IWizard*> IWizard::wizardsOfKind(WizardKind kind) return findWizards(WizardKindPredicate(kind)); } -bool IWizard::isAvailable() const +bool IWizard::isAvailable(const QString &platformName) const { FeatureSet availableFeatures; const QList<Core::IFeatureProvider*> featureManagers = ExtensionSystem::PluginManager::instance()->getObjects<Core::IFeatureProvider>(); foreach (const Core::IFeatureProvider *featureManager, featureManagers) - availableFeatures |= featureManager->availableFeatures(); + availableFeatures |= featureManager->availableFeatures(platformName); return availableFeatures.contains(requiredFeatures()); } + +QStringList IWizard::supportedPlatforms() const +{ + QStringList stringList; + + foreach (const QString &platform, allAvailablePlatforms()) { + if (isAvailable(platform)) + stringList.append(platform); + } + + return stringList; +} + +QStringList IWizard::allAvailablePlatforms() +{ + QStringList platforms; + + const QList<Core::IFeatureProvider*> featureManagers = + ExtensionSystem::PluginManager::instance()->getObjects<Core::IFeatureProvider>(); + + foreach (const Core::IFeatureProvider *featureManager, featureManagers) + platforms.append(featureManager->availablePlatforms()); + + return platforms; +} + +QString IWizard::displayNameForPlatform(const QString &string) +{ + const QList<Core::IFeatureProvider*> featureManagers = + ExtensionSystem::PluginManager::instance()->getObjects<Core::IFeatureProvider>(); + + foreach (const Core::IFeatureProvider *featureManager, featureManagers) { + QString displayName = featureManager->displayNameForPlatform(string); + if (!displayName.isEmpty()) + return displayName; + } + return QString(); +} diff --git a/src/plugins/coreplugin/dialogs/iwizard.h b/src/plugins/coreplugin/dialogs/iwizard.h index 93a4b044733..b6e0a4e79a8 100644 --- a/src/plugins/coreplugin/dialogs/iwizard.h +++ b/src/plugins/coreplugin/dialogs/iwizard.h @@ -55,6 +55,10 @@ public: ProjectWizard = 0x04 }; Q_DECLARE_FLAGS(WizardKinds, WizardKind) + enum WizardFlag { + PlatformIndependent = 0x01 + }; + Q_DECLARE_FLAGS(WizardFlags, WizardFlag) IWizard(QObject *parent = 0) : QObject(parent) {} virtual ~IWizard() {} @@ -69,19 +73,24 @@ public: virtual QString displayCategory() const = 0; virtual FeatureSet requiredFeatures() const = 0; + virtual WizardFlags flags() const = 0; - virtual void runWizard(const QString &path, QWidget *parent) = 0; + virtual void runWizard(const QString &path, QWidget *parent, const QString &platform) = 0; - bool isAvailable() const; + bool isAvailable(const QString &platformName) const; + QStringList supportedPlatforms() const; // Utility to find all registered wizards static QList<IWizard*> allWizards(); // Utility to find all registered wizards of a certain kind static QList<IWizard*> wizardsOfKind(WizardKind kind); + static QStringList allAvailablePlatforms(); + static QString displayNameForPlatform(const QString &string); }; } // namespace Core Q_DECLARE_OPERATORS_FOR_FLAGS(Core::IWizard::WizardKinds) +Q_DECLARE_OPERATORS_FOR_FLAGS(Core::IWizard::WizardFlags) #endif // IWIZARD_H diff --git a/src/plugins/coreplugin/dialogs/newdialog.cpp b/src/plugins/coreplugin/dialogs/newdialog.cpp index 3b30cfec9d8..0aa80c11dee 100644 --- a/src/plugins/coreplugin/dialogs/newdialog.cpp +++ b/src/plugins/coreplugin/dialogs/newdialog.cpp @@ -40,6 +40,7 @@ #include <coreplugin/featureprovider.h> #include <QtGui/QAbstractProxyModel> +#include <QtGui/QSortFilterProxyModel> #include <QtGui/QItemSelectionModel> #include <QtGui/QHeaderView> #include <QtGui/QPushButton> @@ -55,6 +56,49 @@ namespace { const int ICON_SIZE = 22; +struct WizardContainer +{ + WizardContainer() : wizard(0), wizardOption(0) {} + WizardContainer(Core::IWizard *w, int i): wizard(w), wizardOption(i) {} + Core::IWizard *wizard; + int wizardOption; +}; + +inline Core::IWizard *wizardOfItem(const QStandardItem *item = 0) +{ + if (!item) + return 0; + return item->data(Qt::UserRole).value<WizardContainer>().wizard; +} + +class PlatformFilterProxyModel : public QSortFilterProxyModel +{ +// Q_OBJECT +public: + PlatformFilterProxyModel(QObject *parent = 0): QSortFilterProxyModel(parent) {} + + void setPlatform(const QString& platform) + { + m_platform = platform; + invalidateFilter(); + } + + bool filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const + { + if (!sourceParent.isValid()) + return true; + + QModelIndex sourceIndex = sourceModel()->index(sourceRow, 0, sourceParent); + Core::IWizard *wizard = wizardOfItem(qobject_cast<QStandardItemModel*>(sourceModel())->itemFromIndex(sourceIndex)); + if (wizard) + return wizard->isAvailable(m_platform); + + return true; + } +private: + QString m_platform; +}; + class TwoLevelProxyModel : public QAbstractProxyModel { // Q_OBJECT @@ -139,15 +183,9 @@ public: } }; - -inline Core::IWizard *wizardOfItem(const QStandardItem *item = 0) -{ - if (!item) - return 0; - return item->data(Qt::UserRole).value<Core::IWizard*>(); } -} +Q_DECLARE_METATYPE(WizardContainer) using namespace Core; using namespace Core::Internal; @@ -166,9 +204,12 @@ NewDialog::NewDialog(QWidget *parent) : m_okButton->setText(tr("&Choose...")); m_model = new QStandardItemModel(this); - m_proxyModel = new TwoLevelProxyModel(this); - m_proxyModel->setSourceModel(m_model); - m_ui->templateCategoryView->setModel(m_proxyModel); + m_twoLevelProxyModel = new TwoLevelProxyModel(this); + m_twoLevelProxyModel->setSourceModel(m_model); + m_filterProxyModel = new PlatformFilterProxyModel(this); + m_filterProxyModel->setSourceModel(m_model); + + m_ui->templateCategoryView->setModel(m_twoLevelProxyModel); m_ui->templateCategoryView->setEditTriggers(QAbstractItemView::NoEditTriggers); m_ui->templateCategoryView->setItemDelegate(new FancyTopLevelDelegate); @@ -188,6 +229,8 @@ NewDialog::NewDialog(QWidget *parent) : connect(m_okButton, SIGNAL(clicked()), this, SLOT(okButtonClicked())); connect(m_ui->buttonBox, SIGNAL(rejected()), this, SLOT(reject())); + + connect(m_ui->comboBox, SIGNAL(currentIndexChanged(QString)), this, SLOT(setSelectedPlatform(QString))); } // Sort by category. id @@ -204,32 +247,44 @@ void NewDialog::setWizards(QList<IWizard*> wizards) qStableSort(wizards.begin(), wizards.end(), wizardLessThan); - - CategoryItemMap categories; + CategoryItemMap platformMap; m_model->clear(); + QStandardItem *parentItem = m_model->invisibleRootItem(); + QStandardItem *projectKindItem = new QStandardItem(tr("Projects")); projectKindItem->setData(IWizard::ProjectWizard, Qt::UserRole); projectKindItem->setFlags(0); // disable item to prevent focus QStandardItem *filesClassesKindItem = new QStandardItem(tr("Files and Classes")); filesClassesKindItem->setData(IWizard::FileWizard, Qt::UserRole); filesClassesKindItem->setFlags(0); // disable item to prevent focus - QStandardItem *parentItem = m_model->invisibleRootItem(); + parentItem->appendRow(projectKindItem); parentItem->appendRow(filesClassesKindItem); if (m_dummyIcon.isNull()) { - m_dummyIcon = QPixmap(ICON_SIZE, ICON_SIZE); - m_dummyIcon.fill(Qt::transparent); + m_dummyIcon = QIcon(QLatin1String(Core::Constants::ICON_NEWFILE)); } - foreach (IWizard *wizard, wizards) { - // ensure category root - const QString categoryName = wizard->category(); + QStringList availablePlatforms = IWizard::allAvailablePlatforms(); - CategoryItemMap::iterator cit = categories.find(categoryName); - if (cit == categories.end()) { - QStandardItem *categoryItem = new QStandardItem(); + if (availablePlatforms.count() > 1) { + m_ui->comboBox->addItem(tr("All templates"), QString()); + foreach (const QString &platform, availablePlatforms) { + m_ui->comboBox->addItem(tr("%1 templates").arg(platform), platform); + } + } else { + if (availablePlatforms.isEmpty()) { + m_ui->comboBox->addItem(tr("All templates"), QString()); + } else { + const QString platform = availablePlatforms.first(); + m_ui->comboBox->addItem(tr("%1 templates").arg(platform), platform); + } + m_ui->comboBox->setDisabled(true); + } + + foreach (IWizard *wizard, wizards) { + if (wizard->isAvailable(selectedPlatform())) { QStandardItem *kindItem; switch (wizard->kind()) { case IWizard::ProjectWizard: @@ -241,39 +296,8 @@ void NewDialog::setWizards(QList<IWizard*> wizards) kindItem = filesClassesKindItem; break; } - kindItem->appendRow(categoryItem); - m_categoryItems.append(categoryItem); - categoryItem->setFlags(Qt::ItemIsEnabled | Qt::ItemIsSelectable); - categoryItem->setText(wizard->displayCategory()); - categoryItem->setData(wizard->category(), Qt::UserRole); - cit = categories.insert(categoryName, categoryItem); + addItem(kindItem, wizard); } - // add item - if (wizard->isAvailable()) { - QStandardItem *wizardItem = new QStandardItem(wizard->displayName()); - QIcon wizardIcon; - - // spacing hack. Add proper icons instead - if (wizard->icon().isNull()) { - wizardIcon = m_dummyIcon; - } else { - wizardIcon = wizard->icon(); - } - wizardItem->setIcon(wizardIcon); - wizardItem->setData(QVariant::fromValue(wizard), Qt::UserRole); - wizardItem->setFlags(Qt::ItemIsEnabled|Qt::ItemIsSelectable); - cit.value()->appendRow(wizardItem); - } - } - - - if (!projectKindItem->hasChildren()) { - QModelIndex idx = projectKindItem->index(); - m_model->removeRow(idx.row()); - } - if (!filesClassesKindItem->hasChildren()) { - QModelIndex idx = filesClassesKindItem->index(); - m_model->removeRow(idx.row()); } } @@ -285,19 +309,19 @@ Core::IWizard *NewDialog::showDialog() if (!lastCategory.isEmpty()) foreach(QStandardItem* item, m_categoryItems) { if (item->data(Qt::UserRole) == lastCategory) { - idx = m_proxyModel->mapToSource(m_model->indexFromItem(item)); + idx = m_twoLevelProxyModel->mapToSource(m_model->indexFromItem(item)); } } if (!idx.isValid()) - idx = m_proxyModel->index(0,0, m_proxyModel->index(0,0)); + idx = m_twoLevelProxyModel->index(0,0, m_twoLevelProxyModel->index(0,0)); m_ui->templateCategoryView->setCurrentIndex(idx); // We need to set ensure that the category has default focus m_ui->templateCategoryView->setFocus(Qt::NoFocusReason); - for (int row = 0; row < m_proxyModel->rowCount(); ++row) - m_ui->templateCategoryView->setExpanded(m_proxyModel->index(row, 0), true); + for (int row = 0; row < m_twoLevelProxyModel->rowCount(); ++row) + m_ui->templateCategoryView->setExpanded(m_twoLevelProxyModel->index(row, 0), true); // Ensure that item description is visible on first show currentItemChanged(m_ui->templatesView->rootIndex().child(0,0)); @@ -307,7 +331,7 @@ Core::IWizard *NewDialog::showDialog() const int retVal = exec(); idx = m_ui->templateCategoryView->currentIndex(); - lastCategory = m_model->itemFromIndex(m_proxyModel->mapToSource(idx))->data(Qt::UserRole).toString(); + lastCategory = m_model->itemFromIndex(m_twoLevelProxyModel->mapToSource(idx))->data(Qt::UserRole).toString(); if (retVal != Accepted) return 0; @@ -315,6 +339,19 @@ Core::IWizard *NewDialog::showDialog() return currentWizard(); } +QString NewDialog::selectedPlatform() const +{ + int index = m_ui->comboBox->currentIndex(); + + return m_ui->comboBox->itemData(index).toString(); +} + +int NewDialog::selectedWizardOption() const +{ + QStandardItem *item = m_model->itemFromIndex(m_ui->templatesView->currentIndex()); + return item->data(Qt::UserRole).value<WizardContainer>().wizardOption; +} + NewDialog::~NewDialog() { delete m_ui; @@ -322,15 +359,50 @@ NewDialog::~NewDialog() IWizard *NewDialog::currentWizard() const { - return wizardOfItem(m_model->itemFromIndex(m_ui->templatesView->currentIndex())); + QModelIndex index = m_filterProxyModel->mapToSource(m_ui->templatesView->currentIndex()); + return wizardOfItem(m_model->itemFromIndex(index)); +} + +void NewDialog::addItem(QStandardItem *topLEvelCategoryItem, IWizard *wizard) +{ + const QString categoryName = wizard->category(); + QStandardItem *categoryItem = 0; + for (int i = 0; i < topLEvelCategoryItem->rowCount(); i++) { + if (topLEvelCategoryItem->child(i, 0)->data(Qt::UserRole) == categoryName) + categoryItem = topLEvelCategoryItem->child(i, 0); + } + if (!categoryItem) { + categoryItem = new QStandardItem(); + topLEvelCategoryItem->appendRow(categoryItem); + m_categoryItems.append(categoryItem); + categoryItem->setFlags(Qt::ItemIsEnabled | Qt::ItemIsSelectable); + categoryItem->setText(QLatin1String(" ") + wizard->displayCategory()); + categoryItem->setData(wizard->category(), Qt::UserRole); + } + + QStandardItem *wizardItem = new QStandardItem(wizard->displayName()); + QIcon wizardIcon; + + // spacing hack. Add proper icons instead + if (wizard->icon().isNull()) { + wizardIcon = m_dummyIcon; + } else { + wizardIcon = wizard->icon(); + } + wizardItem->setIcon(wizardIcon); + wizardItem->setData(QVariant::fromValue(WizardContainer(wizard, 0)), Qt::UserRole); + wizardItem->setFlags(Qt::ItemIsEnabled|Qt::ItemIsSelectable); + categoryItem->appendRow(wizardItem); + } void NewDialog::currentCategoryChanged(const QModelIndex &index) { if (index.parent() != m_model->invisibleRootItem()->index()) { - m_ui->templatesView->setModel(m_model); - m_ui->templatesView->setRootIndex(m_proxyModel->mapToSource(index)); - + m_ui->templatesView->setModel(m_filterProxyModel); + QModelIndex sourceIndex = m_twoLevelProxyModel->mapToSource(index); + sourceIndex = m_filterProxyModel->mapFromSource(sourceIndex); + m_ui->templatesView->setRootIndex(sourceIndex); // Focus the first item by default m_ui->templatesView->setCurrentIndex(m_ui->templatesView->rootIndex().child(0,0)); @@ -342,11 +414,26 @@ void NewDialog::currentCategoryChanged(const QModelIndex &index) void NewDialog::currentItemChanged(const QModelIndex &index) { - QStandardItem* cat = m_model->itemFromIndex(index); - if (const IWizard *wizard = wizardOfItem(cat)) - m_ui->templateDescription->setText(wizard->description()); - else + QModelIndex sourceIndex = m_filterProxyModel->mapToSource(index); + QStandardItem* cat = (m_model->itemFromIndex(sourceIndex)); + if (const IWizard *wizard = wizardOfItem(cat)) { + QString desciption = wizard->description(); + if (!Qt::mightBeRichText(desciption)) + desciption.replace(QLatin1Char('\n'), QLatin1String("<br>")); + desciption += QLatin1String("<br><br><b>"); + if (wizard->flags().testFlag(IWizard::PlatformIndependent)) + desciption += tr("Platform independent") + QLatin1String("</b>"); + else + desciption += tr("Supported Platforms") + + QLatin1String("</b>: <tt>") + + wizard->supportedPlatforms().join(QLatin1String(" ")) + + QLatin1String("</tt>"); + + m_ui->templateDescription->setHtml(desciption); + + } else { m_ui->templateDescription->setText(QString()); + } updateOkButton(); } @@ -360,3 +447,9 @@ void NewDialog::updateOkButton() { m_okButton->setEnabled(currentWizard() != 0); } + +void NewDialog::setSelectedPlatform(const QString & /*platform*/) +{ + //The static cast allows us to keep PlatformFilterProxyModel anonymous + static_cast<PlatformFilterProxyModel*>(m_filterProxyModel)->setPlatform(selectedPlatform()); +} diff --git a/src/plugins/coreplugin/dialogs/newdialog.h b/src/plugins/coreplugin/dialogs/newdialog.h index 94bd3817c44..ff6b9d529c6 100644 --- a/src/plugins/coreplugin/dialogs/newdialog.h +++ b/src/plugins/coreplugin/dialogs/newdialog.h @@ -36,11 +36,13 @@ #include "iwizard.h" #include <QtGui/QDialog> +#include <QtGui/QIcon> #include <QtCore/QList> #include <QtCore/QModelIndex> QT_BEGIN_NAMESPACE class QAbstractProxyModel; +class QSortFilterProxyModel; class QPushButton; class QStandardItem; class QStandardItemModel; @@ -66,20 +68,26 @@ public: void setWizards(QList<IWizard*> wizards); Core::IWizard *showDialog(); + QString selectedPlatform() const; + int selectedWizardOption() const; private slots: void currentCategoryChanged(const QModelIndex &); void currentItemChanged(const QModelIndex &); void okButtonClicked(); void updateOkButton(); + void setSelectedPlatform(const QString &platform); + private: Core::IWizard *currentWizard() const; + void addItem(QStandardItem *topLEvelCategoryItem, IWizard *wizard); Ui::NewDialog *m_ui; QStandardItemModel *m_model; - QAbstractProxyModel *m_proxyModel; + QAbstractProxyModel *m_twoLevelProxyModel; + QSortFilterProxyModel *m_filterProxyModel; QPushButton *m_okButton; - QPixmap m_dummyIcon; + QIcon m_dummyIcon; QList<QStandardItem*> m_categoryItems; }; diff --git a/src/plugins/coreplugin/dialogs/newdialog.ui b/src/plugins/coreplugin/dialogs/newdialog.ui index 90f105d906e..536c9f6eb60 100644 --- a/src/plugins/coreplugin/dialogs/newdialog.ui +++ b/src/plugins/coreplugin/dialogs/newdialog.ui @@ -6,8 +6,8 @@ <rect> <x>0</x> <y>0</y> - <width>554</width> - <height>412</height> + <width>880</width> + <height>520</height> </rect> </property> <property name="sizePolicy"> @@ -26,9 +26,6 @@ <string>New Project</string> </property> <layout class="QGridLayout" name="gridLayout"> - <property name="sizeConstraint"> - <enum>QLayout::SetDefaultConstraint</enum> - </property> <item row="0" column="0"> <widget class="QLabel" name="label"> <property name="text"> @@ -36,7 +33,43 @@ </property> </widget> </item> - <item row="1" column="0" rowspan="3"> + <item row="1" column="2"> + <widget class="QTextBrowser" name="templateDescription"> + <property name="sizePolicy"> + <sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="focusPolicy"> + <enum>Qt::NoFocus</enum> + </property> + </widget> + </item> + <item row="0" column="1" colspan="2"> + <layout class="QHBoxLayout" name="horizontalLayout"> + <item> + <spacer name="horizontalSpacer"> + <property name="orientation"> + <enum>Qt::Horizontal</enum> + </property> + <property name="sizeType"> + <enum>QSizePolicy::MinimumExpanding</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>0</width> + <height>0</height> + </size> + </property> + </spacer> + </item> + <item> + <widget class="QComboBox" name="comboBox"/> + </item> + </layout> + </item> + <item row="1" column="0"> <widget class="QTreeView" name="templateCategoryView"> <property name="sizePolicy"> <sizepolicy hsizetype="Expanding" vsizetype="MinimumExpanding"> @@ -46,10 +79,47 @@ </property> <property name="maximumSize"> <size> - <width>225</width> + <width>1000</width> <height>16777215</height> </size> </property> + <property name="palette"> + <palette> + <active> + <colorrole role="WindowText"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>97</red> + <green>97</green> + <blue>97</blue> + </color> + </brush> + </colorrole> + </active> + <inactive> + <colorrole role="WindowText"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>97</red> + <green>97</green> + <blue>97</blue> + </color> + </brush> + </colorrole> + </inactive> + <disabled> + <colorrole role="WindowText"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>120</red> + <green>120</green> + <blue>120</blue> + </color> + </brush> + </colorrole> + </disabled> + </palette> + </property> <property name="focusPolicy"> <enum>Qt::StrongFocus</enum> </property> @@ -75,7 +145,7 @@ </attribute> </widget> </item> - <item row="1" column="1" rowspan="2"> + <item row="1" column="1"> <widget class="QListView" name="templatesView"> <property name="sizePolicy"> <sizepolicy hsizetype="MinimumExpanding" vsizetype="Expanding"> @@ -100,20 +170,7 @@ </property> </widget> </item> - <item row="3" column="1"> - <widget class="QTextBrowser" name="templateDescription"> - <property name="sizePolicy"> - <sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="focusPolicy"> - <enum>Qt::NoFocus</enum> - </property> - </widget> - </item> - <item row="4" column="0" colspan="2"> + <item row="2" column="1" colspan="2"> <widget class="QDialogButtonBox" name="buttonBox"> <property name="orientation"> <enum>Qt::Horizontal</enum> @@ -125,11 +182,6 @@ </item> </layout> </widget> - <tabstops> - <tabstop>templateCategoryView</tabstop> - <tabstop>templatesView</tabstop> - <tabstop>buttonBox</tabstop> - </tabstops> <resources/> <connections/> </ui> diff --git a/src/plugins/coreplugin/featureprovider.h b/src/plugins/coreplugin/featureprovider.h index e5735b61d13..9d0bb20d559 100644 --- a/src/plugins/coreplugin/featureprovider.h +++ b/src/plugins/coreplugin/featureprovider.h @@ -57,7 +57,9 @@ class CORE_EXPORT IFeatureProvider : public QObject public: IFeatureProvider() {} virtual ~IFeatureProvider() {} - virtual FeatureSet availableFeatures() const = 0; + virtual FeatureSet availableFeatures(const QString &platform) const = 0; + virtual QStringList availablePlatforms() const = 0; + virtual QString displayNameForPlatform(const QString &string) const = 0; }; class CORE_EXPORT Feature : public Id diff --git a/src/plugins/coreplugin/mainwindow.cpp b/src/plugins/coreplugin/mainwindow.cpp index 72fc5f6f3cc..e753d0e5397 100644 --- a/src/plugins/coreplugin/mainwindow.cpp +++ b/src/plugins/coreplugin/mainwindow.cpp @@ -942,6 +942,7 @@ void MainWindow::showNewItemDialog(const QString &title, // Scan for wizards matching the filter and pick one. Don't show // dialog if there is only one. IWizard *wizard = 0; + QString selectedPlatform; switch (wizards.size()) { case 0: break; @@ -953,6 +954,7 @@ void MainWindow::showNewItemDialog(const QString &title, dlg.setWizards(wizards); dlg.setWindowTitle(title); wizard = dlg.showDialog(); + selectedPlatform = dlg.selectedPlatform(); } break; } @@ -976,7 +978,7 @@ void MainWindow::showNewItemDialog(const QString &title, break; } } - wizard->runWizard(path, this); + wizard->runWizard(path, this, selectedPlatform); } bool MainWindow::showOptionsDialog(const QString &category, diff --git a/src/plugins/genericprojectmanager/genericprojectwizard.cpp b/src/plugins/genericprojectmanager/genericprojectwizard.cpp index 08c95d332a4..24509999c7e 100644 --- a/src/plugins/genericprojectmanager/genericprojectwizard.cpp +++ b/src/plugins/genericprojectmanager/genericprojectwizard.cpp @@ -138,6 +138,7 @@ Core::BaseFileWizardParameters GenericProjectWizard::parameters() "This allows you to use Qt Creator as a code editor.")); parameters.setCategory(QLatin1String(ProjectExplorer::Constants::IMPORT_WIZARD_CATEGORY)); parameters.setDisplayCategory(QLatin1String(ProjectExplorer::Constants::IMPORT_WIZARD_CATEGORY_DISPLAY)); + parameters.setFlags(Core::IWizard::PlatformIndependent); return parameters; } diff --git a/src/plugins/glsleditor/glslfilewizard.cpp b/src/plugins/glsleditor/glslfilewizard.cpp index 8a6cfd2194d..49dd40304cc 100644 --- a/src/plugins/glsleditor/glslfilewizard.cpp +++ b/src/plugins/glsleditor/glslfilewizard.cpp @@ -68,6 +68,11 @@ Core::FeatureSet GLSLFileWizard::requiredFeatures() const return Core::FeatureSet(); } +Core::IWizard::WizardFlags GLSLFileWizard::flags() const +{ + return Core::IWizard::PlatformIndependent; +} + Core::GeneratedFiles GLSLFileWizard::generateFiles(const QWizard *w, QString * /*errorMessage*/) const { diff --git a/src/plugins/glsleditor/glslfilewizard.h b/src/plugins/glsleditor/glslfilewizard.h index 6e76a72f45d..9d11fb25cd7 100644 --- a/src/plugins/glsleditor/glslfilewizard.h +++ b/src/plugins/glsleditor/glslfilewizard.h @@ -56,6 +56,7 @@ public: ShaderType shaderType, QObject *parent = 0); virtual Core::FeatureSet requiredFeatures() const; + virtual WizardFlags flags() const; protected: QString fileContents(const QString &baseName, ShaderType shaderType) const; diff --git a/src/plugins/madde/maemoqtversion.cpp b/src/plugins/madde/maemoqtversion.cpp index 6178e9d2124..7fa9e18d158 100644 --- a/src/plugins/madde/maemoqtversion.cpp +++ b/src/plugins/madde/maemoqtversion.cpp @@ -190,9 +190,19 @@ 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); + features |= Core::FeatureSet(QtSupport::Constants::FEATURE_MOBILE); return features; } +QString MaemoQtVersion::platformName() const +{ + return QLatin1String(QtSupport::Constants::MEEGO_HARMATTAN_PLATFORM); +} + +QString MaemoQtVersion::platformDisplayName() const +{ + return QLatin1String(QtSupport::Constants::MEEGO_HARMATTAN_PLATFORM_TR); +} void MaemoQtVersion::addToEnvironment(Utils::Environment &env) const { diff --git a/src/plugins/madde/maemoqtversion.h b/src/plugins/madde/maemoqtversion.h index 20696fbda37..2b55c2cee8f 100644 --- a/src/plugins/madde/maemoqtversion.h +++ b/src/plugins/madde/maemoqtversion.h @@ -61,6 +61,8 @@ public: bool supportsShadowBuilds() const; QString osType() const; Core::FeatureSet availableFeatures() const; + QString platformName() const; + QString platformDisplayName() const; private: mutable QString m_systemRoot; diff --git a/src/plugins/projectexplorer/baseprojectwizarddialog.cpp b/src/plugins/projectexplorer/baseprojectwizarddialog.cpp index 8086787ffe3..63e10ffe351 100644 --- a/src/plugins/projectexplorer/baseprojectwizarddialog.cpp +++ b/src/plugins/projectexplorer/baseprojectwizarddialog.cpp @@ -56,6 +56,8 @@ struct BaseProjectWizardDialogPrivate { const int desiredIntroPageId; Utils::ProjectIntroPage *introPage; int introPageId; + QString selectedPlatform; + Core::FeatureSet requiredFeatureSet; }; BaseProjectWizardDialogPrivate::BaseProjectWizardDialogPrivate(Utils::ProjectIntroPage *page, int id) : @@ -66,20 +68,24 @@ BaseProjectWizardDialogPrivate::BaseProjectWizardDialogPrivate(Utils::ProjectInt } BaseProjectWizardDialog::BaseProjectWizardDialog(QWidget *parent, - const Core::WizardDialogParameters & /*parameters*/) : + const Core::WizardDialogParameters ¶meters) : Utils::Wizard(parent), d(new BaseProjectWizardDialogPrivate(new Utils::ProjectIntroPage)) { + setSelectedPlatform(parameters.selectedPlatform()); + setRequiredFeatures(parameters.requiredFeatures()); init(); } BaseProjectWizardDialog::BaseProjectWizardDialog(Utils::ProjectIntroPage *introPage, int introId, QWidget *parent, - const Core::WizardDialogParameters & /*parameters*/) : + const Core::WizardDialogParameters ¶meters) : Utils::Wizard(parent), d(new BaseProjectWizardDialogPrivate(introPage, introId)) { + setSelectedPlatform(parameters.selectedPlatform()); + setRequiredFeatures(parameters.requiredFeatures()); init(); } @@ -164,4 +170,25 @@ QString BaseProjectWizardDialog::uniqueProjectName(const QString &path) } return prefix; } + +QString BaseProjectWizardDialog::selectedPlatform() const +{ + return d->selectedPlatform; +} + +void BaseProjectWizardDialog::setSelectedPlatform(const QString &platform) +{ + d->selectedPlatform = platform; +} + +Core::FeatureSet BaseProjectWizardDialog::requiredFeatures() const +{ + return d->requiredFeatureSet; +} + +void BaseProjectWizardDialog::setRequiredFeatures(const Core::FeatureSet &featureSet) +{ + d->requiredFeatureSet = featureSet; +} + } // namespace ProjectExplorer diff --git a/src/plugins/projectexplorer/baseprojectwizarddialog.h b/src/plugins/projectexplorer/baseprojectwizarddialog.h index c9b7f93356e..a5f580bbcb8 100644 --- a/src/plugins/projectexplorer/baseprojectwizarddialog.h +++ b/src/plugins/projectexplorer/baseprojectwizarddialog.h @@ -34,6 +34,7 @@ #define BASEPROJECTWIZARDDIALOG_H #include "projectexplorer_export.h" +#include <coreplugin/featureprovider.h> #include <coreplugin/basefilewizard.h> #include <utils/wizard.h> @@ -78,6 +79,11 @@ signals: protected: Utils::ProjectIntroPage *introPage() const; + QString selectedPlatform() const; + void setSelectedPlatform(const QString &platform); + + Core::FeatureSet requiredFeatures() const; + void setRequiredFeatures(const Core::FeatureSet &featureSet); private slots: void slotAccepted(); diff --git a/src/plugins/projectexplorer/customwizard/customwizardparameters.cpp b/src/plugins/projectexplorer/customwizard/customwizardparameters.cpp index 6d8c3a88905..f9795cfd12a 100644 --- a/src/plugins/projectexplorer/customwizard/customwizardparameters.cpp +++ b/src/plugins/projectexplorer/customwizard/customwizardparameters.cpp @@ -68,6 +68,7 @@ static const char langAttributeC[] = "xml:lang"; static const char categoryAttributeC[] = "category"; static const char displayCategoryElementC[] = "displaycategory"; static const char featuresRequiredC[] = "featuresRequired"; +static const char platformIndependentC[] = "platformIndependent"; static const char fieldPageTitleElementC[] = "fieldpagetitle"; static const char fieldsElementC[] = "fields"; static const char fieldElementC[] = "field"; @@ -500,6 +501,17 @@ static inline Core::FeatureSet requiredFeatures(const QXmlStreamReader &reader) return features; } +static inline Core::IWizard::WizardFlags wizardFlags(const QXmlStreamReader &reader) +{ + Core::IWizard::WizardFlags flags; + QString value = reader.attributes().value(QLatin1String(platformIndependentC)).toString(); + + if (!value.isEmpty() && value == QLatin1String("true")) + flags |= Core::IWizard::PlatformIndependent; + + return flags; +} + static inline QString msgError(const QXmlStreamReader &reader, const QString &fileName, const QString &what) @@ -606,6 +618,7 @@ CustomWizardParameters::ParseResult bp->setCategory(attributeValue(reader, categoryAttributeC)); bp->setKind(kindAttribute(reader)); bp->setRequiredFeatures(requiredFeatures(reader)); + bp->setFlags(wizardFlags(reader)); klass = attributeValue(reader, klassAttributeC); firstPageId = integerAttributeValue(reader, firstPageAttributeC, -1); break; diff --git a/src/plugins/projectexplorer/projectexplorerconstants.h b/src/plugins/projectexplorer/projectexplorerconstants.h index c61ea68d89a..506bf5ddc46 100644 --- a/src/plugins/projectexplorer/projectexplorerconstants.h +++ b/src/plugins/projectexplorer/projectexplorerconstants.h @@ -190,13 +190,19 @@ const char TASK_CATEGORY_COMPILE[] = "Task.Category.Compile"; const char TASK_CATEGORY_BUILDSYSTEM[] = "Task.Category.Buildsystem"; // Wizard categories -const char QT_PROJECT_WIZARD_CATEGORY[] = "F.QtProjects"; -const char QT_PROJECT_WIZARD_CATEGORY_DISPLAY[] = QT_TRANSLATE_NOOP("ProjectExplorer", "Other Qt Project"); +const char QT_PROJECT_WIZARD_CATEGORY[] = "H.QtProjects"; +const char QT_PROJECT_WIZARD_CATEGORY_DISPLAY[] = QT_TRANSLATE_NOOP("ProjectExplorer", "Other Project"); + +const char QT_APPLICATION_WIZARD_CATEGORY[] = "F.QtApplications"; +const char QT_APPLICATION_WIZARD_CATEGORY_DISPLAY[] = QT_TRANSLATE_NOOP("ProjectExplorer", "Applications"); + +const char LIBRARIES_WIZARD_CATEGORY[] = "G.Libraries"; +const char LIBRARIES_WIZARD_CATEGORY_DISPLAY[] = QT_TRANSLATE_NOOP("ProjectExplorer", "Libraries"); const char PROJECT_WIZARD_CATEGORY[] = "I.Projects"; // (after Qt) const char PROJECT_WIZARD_CATEGORY_DISPLAY[] = QT_TRANSLATE_NOOP("ProjectExplorer", "Non-Qt Project"); -const char IMPORT_WIZARD_CATEGORY[] = "J.Import"; +const char IMPORT_WIZARD_CATEGORY[] = "T.Import"; const char IMPORT_WIZARD_CATEGORY_DISPLAY[] = QT_TRANSLATE_NOOP("ProjectExplorer", "Import Project"); // Build step lists ids: diff --git a/src/plugins/qmljseditor/qmljseditorconstants.h b/src/plugins/qmljseditor/qmljseditorconstants.h index ab9ff3edee6..dbbda7df55b 100644 --- a/src/plugins/qmljseditor/qmljseditorconstants.h +++ b/src/plugins/qmljseditor/qmljseditorconstants.h @@ -61,9 +61,6 @@ const char SHOW_QT_QUICK_HELPER[] = "QmlJSEditor.ShowQtQuickHelper"; const char TASK_CATEGORY_QML[] = "Task.Category.Qml"; const char TASK_CATEGORY_QML_ANALYSIS[] = "Task.Category.QmlAnalysis"; -const char WIZARD_CATEGORY_QML[] = "S.Qml"; -const char WIZARD_TR_CATEGORY_QML[] = QT_TRANSLATE_NOOP("QmlJsEditor", "QML"); - const char QML_SNIPPETS_GROUP_ID[] = "QML"; } // namespace Constants diff --git a/src/plugins/qmljseditor/qmljseditorplugin.cpp b/src/plugins/qmljseditor/qmljseditorplugin.cpp index 8a52237cfd3..5e8a3804a8d 100644 --- a/src/plugins/qmljseditor/qmljseditorplugin.cpp +++ b/src/plugins/qmljseditor/qmljseditorplugin.cpp @@ -155,16 +155,16 @@ bool QmlJSEditorPlugin::initialize(const QStringList & /*arguments*/, QString *e QObject *core = Core::ICore::instance(); Core::BaseFileWizardParameters qmlWizardParameters(Core::IWizard::FileWizard); - qmlWizardParameters.setCategory(QLatin1String(Constants::WIZARD_CATEGORY_QML)); - qmlWizardParameters.setDisplayCategory(QCoreApplication::translate("QmlJsEditor", Constants::WIZARD_TR_CATEGORY_QML)); + qmlWizardParameters.setCategory(QLatin1String(Core::Constants::WIZARD_CATEGORY_QT)); + qmlWizardParameters.setDisplayCategory(QCoreApplication::translate("QmlJsEditor", Core::Constants::WIZARD_TR_CATEGORY_QT)); qmlWizardParameters.setDescription(tr("Creates a QML file.")); qmlWizardParameters.setDisplayName(tr("QML File")); qmlWizardParameters.setId(QLatin1String("Q.Qml")); addAutoReleasedObject(new QmlFileWizard(qmlWizardParameters, core)); Core::BaseFileWizardParameters jsWizardParameters(Core::IWizard::FileWizard); - jsWizardParameters.setCategory(QLatin1String(Constants::WIZARD_CATEGORY_QML)); - jsWizardParameters.setDisplayCategory(QCoreApplication::translate("QmlJsEditor", Constants::WIZARD_TR_CATEGORY_QML)); + jsWizardParameters.setCategory(QLatin1String(Core::Constants::WIZARD_CATEGORY_QT)); + jsWizardParameters.setDisplayCategory(QCoreApplication::translate("QmlJsEditor", Core::Constants::WIZARD_TR_CATEGORY_QT)); jsWizardParameters.setDescription(tr("Creates a JavaScript file.")); jsWizardParameters.setDisplayName(tr("JS File")); jsWizardParameters.setId(QLatin1String("Z.Js")); diff --git a/src/plugins/qmlprojectmanager/qmlprojectapplicationwizard.cpp b/src/plugins/qmlprojectmanager/qmlprojectapplicationwizard.cpp index 26dab3b0972..f2f27e9aa4a 100644 --- a/src/plugins/qmlprojectmanager/qmlprojectapplicationwizard.cpp +++ b/src/plugins/qmlprojectmanager/qmlprojectapplicationwizard.cpp @@ -36,6 +36,7 @@ #include <app/app_version.h> #include <projectexplorer/customwizard/customwizard.h> +#include <projectexplorer/projectexplorerconstants.h> #include <qtsupport/qtsupportconstants.h> #include <QtGui/QIcon> @@ -82,9 +83,8 @@ Core::BaseFileWizardParameters QmlProjectApplicationWizard::parameters() "You can review Qt Quick UI projects in the QML Viewer and you need not build them. " "You do not need to have the development environment installed " "on your computer to create and run this type of projects.")); - parameters.setCategory(QLatin1String(QtSupport::Constants::QML_WIZARD_CATEGORY)); - parameters.setDisplayCategory(QCoreApplication::translate(QtSupport::Constants::QML_WIZARD_TR_SCOPE, - QtSupport::Constants::QML_WIZARD_TR_CATEGORY)); + parameters.setCategory(QLatin1String(ProjectExplorer::Constants::QT_APPLICATION_WIZARD_CATEGORY)); + parameters.setDisplayCategory(QT_TRANSLATE_NOOP("ProjectExplorer", "Qt Application")); return parameters; } diff --git a/src/plugins/qt4projectmanager/buildconfigurationinfo.h b/src/plugins/qt4projectmanager/buildconfigurationinfo.h index 0e525a65bbe..c37e5c1a8ec 100644 --- a/src/plugins/qt4projectmanager/buildconfigurationinfo.h +++ b/src/plugins/qt4projectmanager/buildconfigurationinfo.h @@ -74,6 +74,7 @@ struct QT4PROJECTMANAGER_EXPORT BuildConfigurationInfo { 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, Core::FeatureSet features); + static QList<BuildConfigurationInfo> filterBuildConfigurationInfosByPlatform(const QList<BuildConfigurationInfo> &infos, const QString &platform); }; } // namespace Qt4ProjectManager diff --git a/src/plugins/qt4projectmanager/qt-desktop/desktopqtversion.cpp b/src/plugins/qt4projectmanager/qt-desktop/desktopqtversion.cpp index d12acc74029..5e34cf3b444 100644 --- a/src/plugins/qt4projectmanager/qt-desktop/desktopqtversion.cpp +++ b/src/plugins/qt4projectmanager/qt-desktop/desktopqtversion.cpp @@ -106,5 +106,16 @@ Core::FeatureSet DesktopQtVersion::availableFeatures() const 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); + features |= Core::FeatureSet(QtSupport::Constants::FEATURE_DESKTOP); return features; } + +QString DesktopQtVersion::platformName() const +{ + return QLatin1String(QtSupport::Constants::DESKTOP_PLATFORM); +} + +QString DesktopQtVersion::platformDisplayName() const +{ + return QLatin1String(QtSupport::Constants::DESKTOP_PLATFORM_TR); +} diff --git a/src/plugins/qt4projectmanager/qt-desktop/desktopqtversion.h b/src/plugins/qt4projectmanager/qt-desktop/desktopqtversion.h index ab15e25565d..491ebcd7178 100644 --- a/src/plugins/qt4projectmanager/qt-desktop/desktopqtversion.h +++ b/src/plugins/qt4projectmanager/qt-desktop/desktopqtversion.h @@ -59,6 +59,8 @@ public: QString description() const; Core::FeatureSet availableFeatures() const; + QString platformName() const; + QString platformDisplayName() const; }; } diff --git a/src/plugins/qt4projectmanager/qt-desktop/qt4desktoptargetfactory.cpp b/src/plugins/qt4projectmanager/qt-desktop/qt4desktoptargetfactory.cpp index 8ded3005aa7..283e0becf4d 100644 --- a/src/plugins/qt4projectmanager/qt-desktop/qt4desktoptargetfactory.cpp +++ b/src/plugins/qt4projectmanager/qt-desktop/qt4desktoptargetfactory.cpp @@ -128,10 +128,15 @@ ProjectExplorer::Target *Qt4DesktopTargetFactory::restore(ProjectExplorer::Proj Qt4TargetSetupWidget *Qt4DesktopTargetFactory::createTargetSetupWidget(const QString &id, const QString &proFilePath, const QtSupport::QtVersionNumber &minimumQtVersion, const QtSupport::QtVersionNumber &maximumQtVersion, + const Core::FeatureSet &requiredFeatures, + const QString &selectedPlatform, bool importEnabled, QList<BuildConfigurationInfo> importInfos) { - QList<BuildConfigurationInfo> infos = this->availableBuildConfigurations(id, proFilePath, minimumQtVersion, maximumQtVersion); + QList<BuildConfigurationInfo> infos = this->availableBuildConfigurations(id, proFilePath, + minimumQtVersion, + maximumQtVersion, + requiredFeatures); if (infos.isEmpty()) return 0; Qt4DefaultTargetSetupWidget *widget = new Qt4DefaultTargetSetupWidget(this, id, proFilePath, infos, diff --git a/src/plugins/qt4projectmanager/qt-desktop/qt4desktoptargetfactory.h b/src/plugins/qt4projectmanager/qt-desktop/qt4desktoptargetfactory.h index 4f9dfbb8438..ed814f10ac2 100644 --- a/src/plugins/qt4projectmanager/qt-desktop/qt4desktoptargetfactory.h +++ b/src/plugins/qt4projectmanager/qt-desktop/qt4desktoptargetfactory.h @@ -57,6 +57,8 @@ public: Qt4TargetSetupWidget *createTargetSetupWidget(const QString &id, const QString &proFilePath, const QtSupport::QtVersionNumber &minimumQtVersion, const QtSupport::QtVersionNumber &maximumQtVersion, + const Core::FeatureSet &requiredFeatures, + const QString &selectedPlatform, bool importEnabled, QList<BuildConfigurationInfo> importInfos); QString buildNameForId(const QString &id) const; QSet<QString> targetFeatures(const QString &id) const; diff --git a/src/plugins/qt4projectmanager/qt-desktop/simulatorqtversion.cpp b/src/plugins/qt4projectmanager/qt-desktop/simulatorqtversion.cpp index df636351d6f..b76530449f4 100644 --- a/src/plugins/qt4projectmanager/qt-desktop/simulatorqtversion.cpp +++ b/src/plugins/qt4projectmanager/qt-desktop/simulatorqtversion.cpp @@ -99,3 +99,10 @@ QString SimulatorQtVersion::description() const { return QCoreApplication::translate("QtVersion", "Qt Simulator", "Qt Version is meant for Qt Simulator"); } + +bool SimulatorQtVersion::supportsPlatform(const QString &platformName) const +{ + return (platformName == QtSupport::Constants::SYMBIAN_PLATFORM + || platformName == QtSupport::Constants::MEEGO_HARMATTAN_PLATFORM + || platformName.isEmpty()); +} diff --git a/src/plugins/qt4projectmanager/qt-desktop/simulatorqtversion.h b/src/plugins/qt4projectmanager/qt-desktop/simulatorqtversion.h index ac9a79ac3fb..87cba50d570 100644 --- a/src/plugins/qt4projectmanager/qt-desktop/simulatorqtversion.h +++ b/src/plugins/qt4projectmanager/qt-desktop/simulatorqtversion.h @@ -57,6 +57,8 @@ public: QSet<QString> supportedTargetIds() const; QString description() const; + + bool supportsPlatform(const QString &platformName) const; }; } diff --git a/src/plugins/qt4projectmanager/qt-s60/qt4symbiantargetfactory.cpp b/src/plugins/qt4projectmanager/qt-s60/qt4symbiantargetfactory.cpp index 8c4446103e5..57a7abdf59d 100644 --- a/src/plugins/qt4projectmanager/qt-s60/qt4symbiantargetfactory.cpp +++ b/src/plugins/qt4projectmanager/qt-s60/qt4symbiantargetfactory.cpp @@ -168,10 +168,11 @@ QList<ProjectExplorer::Task> Qt4SymbianTargetFactory::reportIssues(const QString QList<BuildConfigurationInfo> Qt4SymbianTargetFactory::availableBuildConfigurations(const QString &id, const QString &proFilePath, const QtSupport::QtVersionNumber &minimumQtVersion, - const QtSupport::QtVersionNumber &maximumQtVersion) + const QtSupport::QtVersionNumber &maximumQtVersion, + const Core::FeatureSet &requiredFeatures) { QList<BuildConfigurationInfo> infos - = Qt4BaseTargetFactory::availableBuildConfigurations(id, proFilePath, minimumQtVersion, maximumQtVersion); + = Qt4BaseTargetFactory::availableBuildConfigurations(id, proFilePath, minimumQtVersion, maximumQtVersion, requiredFeatures); if (id != QLatin1String(Constants::S60_EMULATOR_TARGET_ID)) return infos; // For emulator filter out all non debug builds diff --git a/src/plugins/qt4projectmanager/qt-s60/qt4symbiantargetfactory.h b/src/plugins/qt4projectmanager/qt-s60/qt4symbiantargetfactory.h index bf7058ac3f2..fc6c42c36f8 100644 --- a/src/plugins/qt4projectmanager/qt-s60/qt4symbiantargetfactory.h +++ b/src/plugins/qt4projectmanager/qt-s60/qt4symbiantargetfactory.h @@ -61,7 +61,8 @@ public: QList<ProjectExplorer::Task> reportIssues(const QString &proFile); QList<BuildConfigurationInfo> availableBuildConfigurations(const QString &id, const QString &proFilePath, const QtSupport::QtVersionNumber &minimumQtVersion, - const QtSupport::QtVersionNumber &maximumQtVersion); + const QtSupport::QtVersionNumber &maximumQtVersion, + const Core::FeatureSet &requiredFeatures); bool selectByDefault(const QString &id) const; QSet<QString> targetFeatures(const QString &id) const; diff --git a/src/plugins/qt4projectmanager/qt-s60/symbianqtversion.cpp b/src/plugins/qt4projectmanager/qt-s60/symbianqtversion.cpp index 1af9843cee8..6b408c2d60b 100644 --- a/src/plugins/qt4projectmanager/qt-s60/symbianqtversion.cpp +++ b/src/plugins/qt4projectmanager/qt-s60/symbianqtversion.cpp @@ -370,10 +370,21 @@ Core::FeatureSet SymbianQtVersion::availableFeatures() const 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)); + features |= Core::FeatureSet(QtSupport::Constants::FEATURE_MOBILE); return features; } +QString SymbianQtVersion::platformName() const +{ + return QLatin1String(QtSupport::Constants::SYMBIAN_PLATFORM); +} + +QString SymbianQtVersion::platformDisplayName() const +{ + return QLatin1String(QtSupport::Constants::SYMBIAN_PLATFORM_TR); +} + QString SymbianQtVersion::systemRoot() const { return m_systemRoot; diff --git a/src/plugins/qt4projectmanager/qt-s60/symbianqtversion.h b/src/plugins/qt4projectmanager/qt-s60/symbianqtversion.h index 14a63807863..f9eb410040a 100644 --- a/src/plugins/qt4projectmanager/qt-s60/symbianqtversion.h +++ b/src/plugins/qt4projectmanager/qt-s60/symbianqtversion.h @@ -84,6 +84,8 @@ public: QtSupport::QtConfigWidget *createConfigurationWidget() const; Core::FeatureSet availableFeatures() const; + QString platformName() const; + QString platformDisplayName() const; protected: QList<ProjectExplorer::Task> reportIssuesImpl(const QString &proFile, const QString &buildDir); diff --git a/src/plugins/qt4projectmanager/qt4basetargetfactory.h b/src/plugins/qt4projectmanager/qt4basetargetfactory.h index c2d1fec5bdc..069e4e3d542 100644 --- a/src/plugins/qt4projectmanager/qt4basetargetfactory.h +++ b/src/plugins/qt4projectmanager/qt4basetargetfactory.h @@ -40,6 +40,10 @@ #include <QtCore/QList> +namespace Core { +class FeatureSet; +} + namespace QtSupport { class QtVersionNumber; } @@ -59,6 +63,7 @@ public: const QString &proFilePath, const QtSupport::QtVersionNumber &minimumQtVersion, const QtSupport::QtVersionNumber &maximumQtVersion, + const Core::FeatureSet &requiredFeatures, bool importEnabled, QList<BuildConfigurationInfo> importInfos); @@ -72,7 +77,8 @@ public: /// by default creates one debug + one release buildconfiguration per qtversion virtual QList<BuildConfigurationInfo> availableBuildConfigurations(const QString &id, const QString &proFilePath, const QtSupport::QtVersionNumber &minimumQtVersion, - const QtSupport::QtVersionNumber &maximumQtVersion); + const QtSupport::QtVersionNumber &maximumQtVersion, + const Core::FeatureSet &requiredFeatures); virtual QList<ProjectExplorer::Task> reportIssues(const QString &proFile); /// only used in the TargetSetupPage diff --git a/src/plugins/qt4projectmanager/qt4target.cpp b/src/plugins/qt4projectmanager/qt4target.cpp index e79898ab579..e49731995c1 100644 --- a/src/plugins/qt4projectmanager/qt4target.cpp +++ b/src/plugins/qt4projectmanager/qt4target.cpp @@ -43,6 +43,7 @@ #include "qt4buildconfiguration.h" #include <coreplugin/icore.h> +#include <coreplugin/featureprovider.h> #include <extensionsystem/pluginmanager.h> #include <projectexplorer/buildsteplist.h> #include <projectexplorer/runconfiguration.h> @@ -92,10 +93,15 @@ Qt4TargetSetupWidget *Qt4BaseTargetFactory::createTargetSetupWidget(const QStrin const QString &proFilePath, const QtSupport::QtVersionNumber &minimumQtVersion, const QtSupport::QtVersionNumber &maximumQtVersion, + const Core::FeatureSet &requiredFeatures, bool importEnabled, QList<BuildConfigurationInfo> importInfos) { - QList<BuildConfigurationInfo> infos = this->availableBuildConfigurations(id, proFilePath, minimumQtVersion, maximumQtVersion); + QList<BuildConfigurationInfo> infos = this->availableBuildConfigurations(id, + proFilePath, + minimumQtVersion, + maximumQtVersion, + requiredFeatures); if (infos.isEmpty()) return 0; const bool supportsShadowBuilds @@ -121,7 +127,8 @@ ProjectExplorer::Target *Qt4BaseTargetFactory::create(ProjectExplorer::Project * QList<BuildConfigurationInfo> Qt4BaseTargetFactory::availableBuildConfigurations(const QString &id, const QString &proFilePath, const QtSupport::QtVersionNumber &minimumQtVersion, - const QtSupport::QtVersionNumber &maximumQtVersion) + const QtSupport::QtVersionNumber &maximumQtVersion, + const Core::FeatureSet &requiredFeatures) { QList<BuildConfigurationInfo> infoList; QList<QtSupport::BaseQtVersion *> knownVersions @@ -139,6 +146,9 @@ QList<BuildConfigurationInfo> Qt4BaseTargetFactory::availableBuildConfigurations info.directory = shadowBuildDirectory(proFilePath, id, msgBuildConfigurationName(info)); infoList.append(info); } + + infoList = BuildConfigurationInfo::filterBuildConfigurationInfos(infoList, requiredFeatures); + return infoList; } @@ -692,7 +702,12 @@ void Qt4DefaultTargetSetupWidget::setProFilePath(const QString &proFilePath) { m_proFilePath = proFilePath; m_detailsWidget->setAdditionalSummaryText(issuesListToString(m_factory->reportIssues(m_proFilePath))); - setBuildConfigurationInfos(m_factory->availableBuildConfigurations(m_id, proFilePath, m_minimumQtVersion, m_maximumQtVersion), false); + setBuildConfigurationInfos(m_factory->availableBuildConfigurations(m_id, + proFilePath, + m_minimumQtVersion, + m_maximumQtVersion, + Core::FeatureSet()), + false); } void Qt4DefaultTargetSetupWidget::setBuildConfiguraionComboBoxVisible(bool b) @@ -1176,6 +1191,18 @@ QList<BuildConfigurationInfo> BuildConfigurationInfo::filterBuildConfigurationIn return result; } +QList<BuildConfigurationInfo> BuildConfigurationInfo::filterBuildConfigurationInfosByPlatform(const QList<BuildConfigurationInfo> &infos, + const QString &platform) +{ + if (platform.isEmpty()) // empty target == target independent + return infos; + QList<BuildConfigurationInfo> result; + foreach (const BuildConfigurationInfo &info, infos) + if (info.version->supportsPlatform(platform)) + result.append(info); + return result; +} + QList<BuildConfigurationInfo> BuildConfigurationInfo::filterBuildConfigurationInfos(const QList<BuildConfigurationInfo> &infos, Core::FeatureSet features) { QList<BuildConfigurationInfo> result; diff --git a/src/plugins/qt4projectmanager/winceqtversion.cpp b/src/plugins/qt4projectmanager/winceqtversion.cpp index 909ab257a55..f7cb2dd1d71 100644 --- a/src/plugins/qt4projectmanager/winceqtversion.cpp +++ b/src/plugins/qt4projectmanager/winceqtversion.cpp @@ -114,6 +114,16 @@ void WinCeQtVersion::fromMap(const QVariantMap &map) } } +QString WinCeQtVersion::platformName() const +{ + return QLatin1String(QtSupport::Constants::WINDOWS_CE_PLATFORM); +} + +QString WinCeQtVersion::platformDisplayName() const +{ + return QLatin1String(QtSupport::Constants::WINDOWS_CE_PLATFORM_TR); +} + QVariantMap WinCeQtVersion::toMap() const { return BaseQtVersion::toMap(); diff --git a/src/plugins/qt4projectmanager/winceqtversion.h b/src/plugins/qt4projectmanager/winceqtversion.h index 013862b4789..265e15055e1 100644 --- a/src/plugins/qt4projectmanager/winceqtversion.h +++ b/src/plugins/qt4projectmanager/winceqtversion.h @@ -59,6 +59,9 @@ public: virtual QVariantMap toMap() const; virtual void fromMap(const QVariantMap &data); + virtual QString platformName() const; + QString platformDisplayName() const; + private: ProjectExplorer::Abi::Architecture m_archType; }; diff --git a/src/plugins/qt4projectmanager/wizards/abstractmobileappwizard.cpp b/src/plugins/qt4projectmanager/wizards/abstractmobileappwizard.cpp index 994f6d3dfcc..9a2a15fb050 100644 --- a/src/plugins/qt4projectmanager/wizards/abstractmobileappwizard.cpp +++ b/src/plugins/qt4projectmanager/wizards/abstractmobileappwizard.cpp @@ -70,6 +70,8 @@ AbstractMobileAppWizardDialog::AbstractMobileAppWizardDialog(QWidget *parent, m_targetsPage->setPreferredFeatures(QSet<QString>() << QLatin1String(Constants::MOBILE_TARGETFEATURE_ID)); m_targetsPage->setMinimumQtVersion(minimumQtVersionNumber); m_targetsPage->setMaximumQtVersion(maximumQtVersionNumber); + m_targetsPage->setSelectedPlatform(selectedPlatform()); + m_targetsPage->setRequiredQtFeatures(requiredFeatures()); resize(900, 450); m_genericOptionsPage = new Internal::MobileAppWizardGenericOptionsPage; diff --git a/src/plugins/qt4projectmanager/wizards/consoleappwizard.cpp b/src/plugins/qt4projectmanager/wizards/consoleappwizard.cpp index 4a10c5fed1d..e9f304d482f 100644 --- a/src/plugins/qt4projectmanager/wizards/consoleappwizard.cpp +++ b/src/plugins/qt4projectmanager/wizards/consoleappwizard.cpp @@ -58,8 +58,8 @@ namespace Internal { ConsoleAppWizard::ConsoleAppWizard() : QtWizard(QLatin1String("E.Qt4Core"), - QLatin1String(ProjectExplorer::Constants::QT_PROJECT_WIZARD_CATEGORY), - QLatin1String(ProjectExplorer::Constants::QT_PROJECT_WIZARD_CATEGORY_DISPLAY), + QLatin1String(ProjectExplorer::Constants::QT_APPLICATION_WIZARD_CATEGORY), + QLatin1String(ProjectExplorer::Constants::QT_APPLICATION_WIZARD_CATEGORY_DISPLAY), tr("Qt Console Application"), tr("Creates a project containing a single main.cpp file with a stub implementation.\n\n" "Preselects a desktop Qt for building the application if available."), diff --git a/src/plugins/qt4projectmanager/wizards/guiappwizard.cpp b/src/plugins/qt4projectmanager/wizards/guiappwizard.cpp index b1cf1500231..a73875468f6 100644 --- a/src/plugins/qt4projectmanager/wizards/guiappwizard.cpp +++ b/src/plugins/qt4projectmanager/wizards/guiappwizard.cpp @@ -85,8 +85,8 @@ namespace Internal { GuiAppWizard::GuiAppWizard() : QtWizard(QLatin1String("C.Qt4Gui"), - QLatin1String(ProjectExplorer::Constants::QT_PROJECT_WIZARD_CATEGORY), - QLatin1String(ProjectExplorer::Constants::QT_PROJECT_WIZARD_CATEGORY_DISPLAY), + QLatin1String(ProjectExplorer::Constants::QT_APPLICATION_WIZARD_CATEGORY), + QLatin1String(ProjectExplorer::Constants::QT_APPLICATION_WIZARD_CATEGORY_DISPLAY), tr("Qt Gui Application"), tr("Creates a Qt application for the desktop. " "Includes a Qt Designer-based main window.\n\n" diff --git a/src/plugins/qt4projectmanager/wizards/html5appwizard.cpp b/src/plugins/qt4projectmanager/wizards/html5appwizard.cpp index aa799c73285..e96e2ad28f3 100644 --- a/src/plugins/qt4projectmanager/wizards/html5appwizard.cpp +++ b/src/plugins/qt4projectmanager/wizards/html5appwizard.cpp @@ -113,8 +113,8 @@ Core::BaseFileWizardParameters Html5AppWizard::parameters() "mobile target platforms. For example, you can create signed " "Symbian Installation System (SIS) packages for this type of " "projects.")); - parameters.setCategory(QLatin1String(ProjectExplorer::Constants::PROJECT_WIZARD_CATEGORY)); - parameters.setDisplayCategory(QLatin1String(ProjectExplorer::Constants::PROJECT_WIZARD_CATEGORY_DISPLAY)); + parameters.setCategory(QLatin1String(ProjectExplorer::Constants::QT_APPLICATION_WIZARD_CATEGORY)); + parameters.setDisplayCategory(QLatin1String(ProjectExplorer::Constants::QT_APPLICATION_WIZARD_CATEGORY_DISPLAY)); return parameters; } diff --git a/src/plugins/qt4projectmanager/wizards/librarywizard.cpp b/src/plugins/qt4projectmanager/wizards/librarywizard.cpp index 26e89042d81..758d398c92c 100644 --- a/src/plugins/qt4projectmanager/wizards/librarywizard.cpp +++ b/src/plugins/qt4projectmanager/wizards/librarywizard.cpp @@ -53,8 +53,8 @@ namespace Internal { LibraryWizard::LibraryWizard() : QtWizard(QLatin1String("H.Qt4Library"), - QLatin1String(ProjectExplorer::Constants::PROJECT_WIZARD_CATEGORY), - QLatin1String(ProjectExplorer::Constants::PROJECT_WIZARD_CATEGORY_DISPLAY), + QLatin1String(ProjectExplorer::Constants::LIBRARIES_WIZARD_CATEGORY), + QLatin1String(ProjectExplorer::Constants::LIBRARIES_WIZARD_CATEGORY_DISPLAY), tr("C++ Library"), tr("Creates a C++ library based on qmake. This can be used to create:<ul>" "<li>a shared C++ library for use with <tt>QPluginLoader</tt> and runtime (Plugins)</li>" diff --git a/src/plugins/qt4projectmanager/wizards/mobileappwizard.cpp b/src/plugins/qt4projectmanager/wizards/mobileappwizard.cpp index b770519cac1..e57aba7df54 100644 --- a/src/plugins/qt4projectmanager/wizards/mobileappwizard.cpp +++ b/src/plugins/qt4projectmanager/wizards/mobileappwizard.cpp @@ -96,6 +96,7 @@ MobileAppWizard::~MobileAppWizard() Core::FeatureSet MobileAppWizard::requiredFeatures() const { return Core::Feature(QtSupport::Constants::FEATURE_GENERIC_CPP_ENTRY_POINT) + | Core::FeatureSet(QtSupport::Constants::FEATURE_MOBILE) | Core::Feature(QtSupport::Constants::FEATURE_QWIDGETS); } @@ -106,8 +107,8 @@ Core::BaseFileWizardParameters MobileAppWizard::parameters() parameters.setDisplayName(DisplayName); parameters.setId(QLatin1String("C.Qt4GuiMobile")); parameters.setDescription(Description); - parameters.setCategory(QLatin1String(ProjectExplorer::Constants::QT_PROJECT_WIZARD_CATEGORY)); - parameters.setDisplayCategory(QLatin1String(ProjectExplorer::Constants::QT_PROJECT_WIZARD_CATEGORY_DISPLAY)); + parameters.setCategory(QLatin1String(ProjectExplorer::Constants::QT_APPLICATION_WIZARD_CATEGORY)); + parameters.setDisplayCategory(QLatin1String(ProjectExplorer::Constants::QT_APPLICATION_WIZARD_CATEGORY_DISPLAY)); return parameters; } diff --git a/src/plugins/qt4projectmanager/wizards/qtquickappwizard.cpp b/src/plugins/qt4projectmanager/wizards/qtquickappwizard.cpp index fff80868a7a..0ca40b7a8b4 100644 --- a/src/plugins/qt4projectmanager/wizards/qtquickappwizard.cpp +++ b/src/plugins/qt4projectmanager/wizards/qtquickappwizard.cpp @@ -39,6 +39,7 @@ #include "qt4projectmanagerconstants.h" #include <qtsupport/qtsupportconstants.h> +#include <projectexplorer/projectexplorerconstants.h> #include <coreplugin/dialogs/iwizard.h> #include <QtCore/QCoreApplication> @@ -144,9 +145,8 @@ Core::BaseFileWizardParameters QtQuickAppWizard::parameters() "projects. Moreover, you can select to use a set of premade " "UI components in your Qt Quick application. " "To utilize the components, Qt 4.7.4 or newer is required.")); - parameters.setCategory(QLatin1String(QtSupport::Constants::QML_WIZARD_CATEGORY)); - parameters.setDisplayCategory(QCoreApplication::translate(QtSupport::Constants::QML_WIZARD_TR_SCOPE, - QtSupport::Constants::QML_WIZARD_TR_CATEGORY)); + parameters.setCategory(QLatin1String(ProjectExplorer::Constants::QT_APPLICATION_WIZARD_CATEGORY)); + parameters.setDisplayCategory(ProjectExplorer::Constants::QT_APPLICATION_WIZARD_CATEGORY_DISPLAY); return parameters; } diff --git a/src/plugins/qt4projectmanager/wizards/qtwizard.cpp b/src/plugins/qt4projectmanager/wizards/qtwizard.cpp index ecdfd4cdb02..8229f440cca 100644 --- a/src/plugins/qt4projectmanager/wizards/qtwizard.cpp +++ b/src/plugins/qt4projectmanager/wizards/qtwizard.cpp @@ -240,6 +240,8 @@ int BaseQt4ProjectWizardDialog::addModulesPage(int id) int BaseQt4ProjectWizardDialog::addTargetSetupPage(QSet<QString> targets, bool mobile, int id) { m_targetSetupPage = new TargetSetupPage; + m_targetSetupPage->setSelectedPlatform(selectedPlatform()); + m_targetSetupPage->setRequiredQtFeatures(requiredFeatures()); m_targets = targets; resize(900, 450); diff --git a/src/plugins/qt4projectmanager/wizards/subdirsprojectwizard.cpp b/src/plugins/qt4projectmanager/wizards/subdirsprojectwizard.cpp index c84ae4a5664..d0dce2208e2 100644 --- a/src/plugins/qt4projectmanager/wizards/subdirsprojectwizard.cpp +++ b/src/plugins/qt4projectmanager/wizards/subdirsprojectwizard.cpp @@ -44,8 +44,8 @@ namespace Internal { SubdirsProjectWizard::SubdirsProjectWizard() : QtWizard(QLatin1String("U.Qt4Subdirs"), - QLatin1String(ProjectExplorer::Constants::PROJECT_WIZARD_CATEGORY), - QLatin1String(ProjectExplorer::Constants::PROJECT_WIZARD_CATEGORY_DISPLAY), + QLatin1String(ProjectExplorer::Constants::QT_PROJECT_WIZARD_CATEGORY), + QLatin1String(ProjectExplorer::Constants::QT_PROJECT_WIZARD_CATEGORY_DISPLAY), tr("Subdirs Project"), tr("Creates a qmake-based subdirs project. This allows you to group " "your projects in a tree structure."), diff --git a/src/plugins/qt4projectmanager/wizards/targetsetuppage.cpp b/src/plugins/qt4projectmanager/wizards/targetsetuppage.cpp index ecac81603d8..85f33f14aaa 100644 --- a/src/plugins/qt4projectmanager/wizards/targetsetuppage.cpp +++ b/src/plugins/qt4projectmanager/wizards/targetsetuppage.cpp @@ -120,6 +120,11 @@ void TargetSetupPage::setRequiredQtFeatures(const Core::FeatureSet &features) m_requiredQtFeatures = features; } +void TargetSetupPage::setSelectedPlatform(const QString &platform) +{ + m_selectedPlatform = platform; +} + void TargetSetupPage::setMinimumQtVersion(const QtSupport::QtVersionNumber &number) { m_minimumQtVersionNumber = number; @@ -153,11 +158,21 @@ void TargetSetupPage::setupWidgets() continue; QList<BuildConfigurationInfo> infos = BuildConfigurationInfo::filterBuildConfigurationInfos(m_importInfos, id); - infos = BuildConfigurationInfo::filterBuildConfigurationInfos(infos, m_requiredQtFeatures); + const QList<BuildConfigurationInfo> platformFilteredInfos = + BuildConfigurationInfo::filterBuildConfigurationInfosByPlatform(factory->availableBuildConfigurations(id, + m_proFilePath, + m_minimumQtVersionNumber, + m_maximumQtVersionNumber, + m_requiredQtFeatures), + m_selectedPlatform); + + Qt4TargetSetupWidget *widget = factory->createTargetSetupWidget(id, m_proFilePath, - m_minimumQtVersionNumber, m_maximumQtVersionNumber, + m_minimumQtVersionNumber, + m_maximumQtVersionNumber, + m_requiredQtFeatures, m_importSearch, infos); if (widget) { bool selectTarget = false; @@ -168,6 +183,9 @@ void TargetSetupPage::setupWidgets() selectTarget = factory->targetFeatures(id).contains(m_preferredFeatures) && factory->selectByDefault(id); } + if (!m_selectedPlatform.isEmpty()) { + selectTarget = !platformFilteredInfos.isEmpty(); + } } widget->setTargetSelected(selectTarget); atLeastOneTargetSelected |= selectTarget; diff --git a/src/plugins/qt4projectmanager/wizards/targetsetuppage.h b/src/plugins/qt4projectmanager/wizards/targetsetuppage.h index b8351e3a3fd..396b70dbe57 100644 --- a/src/plugins/qt4projectmanager/wizards/targetsetuppage.h +++ b/src/plugins/qt4projectmanager/wizards/targetsetuppage.h @@ -82,6 +82,8 @@ public: /// Sets the features a qt version must support /// call this before \sa initializePage() void setRequiredQtFeatures(const Core::FeatureSet &features); + /// Sets the platform that was selected in the wizard + void setSelectedPlatform(const QString &platform); /// Sets the minimum qt version /// calls this before \sa initializePage() void setMinimumQtVersion(const QtSupport::QtVersionNumber &number); @@ -119,6 +121,7 @@ private: QSet<QString> m_preferredFeatures; QSet<QString> m_requiredTargetFeatures; Core::FeatureSet m_requiredQtFeatures; + QString m_selectedPlatform; bool m_importSearch; bool m_useScrollArea; QtSupport::QtVersionNumber m_minimumQtVersionNumber; diff --git a/src/plugins/qtsupport/baseqtversion.cpp b/src/plugins/qtsupport/baseqtversion.cpp index 5c894f14a98..3285e1789da 100644 --- a/src/plugins/qtsupport/baseqtversion.cpp +++ b/src/plugins/qtsupport/baseqtversion.cpp @@ -275,6 +275,23 @@ Core::FeatureSet BaseQtVersion::availableFeatures() const return features; } +QString BaseQtVersion::platformName() const +{ + return QString(); +} + +QString BaseQtVersion::platformDisplayName() const +{ + return platformName(); +} + +bool BaseQtVersion::supportsPlatform(const QString &platform) const +{ + if (platform.isEmpty()) // empty target == target independent + return true; + return platform == platformName(); +} + void BaseQtVersion::setId(int id) { m_id = id; diff --git a/src/plugins/qtsupport/baseqtversion.h b/src/plugins/qtsupport/baseqtversion.h index 021a6c06655..e27f2a597f2 100644 --- a/src/plugins/qtsupport/baseqtversion.h +++ b/src/plugins/qtsupport/baseqtversion.h @@ -216,6 +216,9 @@ public: bool fromPath = false); virtual Core::FeatureSet availableFeatures() const; + virtual QString platformName() const; + virtual QString platformDisplayName() const; + virtual bool supportsPlatform(const QString &platformName) const; protected: BaseQtVersion(); diff --git a/src/plugins/qtsupport/qtsupportconstants.h b/src/plugins/qtsupport/qtsupportconstants.h index 0db8ce8e461..6808a8814da 100644 --- a/src/plugins/qtsupport/qtsupportconstants.h +++ b/src/plugins/qtsupport/qtsupportconstants.h @@ -59,14 +59,26 @@ 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"; +const char FEATURE_MOBILE[] = "QtSupport.Wizards.FeatureMobile"; +const char FEATURE_DESKTOP[] = "QtSupport.Wizards.FeatureDesktop"; +// Platforms +const char MEEGO_HARMATTAN_PLATFORM[] = "MeeGo/Harmattan"; +const char SYMBIAN_PLATFORM[] = "Symbian"; +const char DESKTOP_PLATFORM[] = "Desktop"; +const char EMBEDDED_LINUX_PLATFORM[] = "Embedded Linux"; +const char WINDOWS_CE_PLATFORM[] = "Windows CE"; -// QML wizard categories +const char MEEGO_HARMATTAN_PLATFORM_TR[] = QT_TRANSLATE_NOOP("QtSupport", "MeeGo/Harmattan"); +const char SYMBIAN_PLATFORM_TR[] = QT_TRANSLATE_NOOP("QtSupport", "Symbian"); +const char DESKTOP_PLATFORM_TR[] = QT_TRANSLATE_NOOP("QtSupport", "Desktop"); +const char EMBEDDED_LINUX_PLATFORM_TR[] = QT_TRANSLATE_NOOP("QtSupport", "Embedded Linux"); +const char WINDOWS_CE_PLATFORM_TR[] = QT_TRANSLATE_NOOP("QtSupport", "Windows CE"); + + +// QML wizard icon // both the qt4projectmanager and the qmlprojectmanager do have qt quick wizards -// so we define the category here -const char QML_WIZARD_CATEGORY[] = "C.Projects"; // (before Qt) -const char QML_WIZARD_TR_SCOPE[] = "QmlProjectManager"; -const char QML_WIZARD_TR_CATEGORY[] = QT_TRANSLATE_NOOP("QmlProjectManager", "Qt Quick Project"); +// so we define the icon here const char QML_WIZARD_ICON[] = ":/qmlproject/images/qml_wizard.png"; } // namepsace Constants diff --git a/src/plugins/qtsupport/qtversionmanager.cpp b/src/plugins/qtsupport/qtversionmanager.cpp index 757cc131afe..9bb49a96272 100644 --- a/src/plugins/qtsupport/qtversionmanager.cpp +++ b/src/plugins/qtsupport/qtversionmanager.cpp @@ -562,11 +562,11 @@ QString QtVersionManager::popPendingGcceUpdate() return m_pendingGcceUpdates.takeFirst(); } -Core::FeatureSet QtVersionManager::availableFeatures() const +Core::FeatureSet QtVersionManager::availableFeatures(const QString &platformName) const { Core::FeatureSet features; foreach (BaseQtVersion *const qtVersion, validVersions()) { - if (qtVersion->isValid()) + if (qtVersion->isValid() && ((qtVersion->platformName() == platformName) || platformName.isEmpty())) features |= qtVersion->availableFeatures(); } if (validVersions().empty()) @@ -574,6 +574,26 @@ Core::FeatureSet QtVersionManager::availableFeatures() const return features; } +QStringList QtVersionManager::availablePlatforms() const +{ + QStringList platforms; + foreach (BaseQtVersion *const qtVersion, validVersions()) { + if (qtVersion->isValid() && !qtVersion->platformName().isEmpty()) + platforms.append(qtVersion->platformName()); + } + platforms.removeDuplicates(); + return platforms; +} + +QString QtVersionManager::displayNameForPlatform(const QString &string) const +{ + foreach (BaseQtVersion *const qtVersion, validVersions()) { + if (qtVersion->platformName() == string) + return qtVersion->platformDisplayName(); + } + return QString(); +} + BaseQtVersion *QtVersionManager::version(int id) const { QMap<int, BaseQtVersion *>::const_iterator it = m_versions.find(id); @@ -893,7 +913,17 @@ BaseQtVersion::QmakeBuildConfigs QtVersionManager::qmakeBuildConfigFromCmdArgs(Q return result; } -Core::FeatureSet QtFeatureProvider::availableFeatures() const +Core::FeatureSet QtFeatureProvider::availableFeatures(const QString &platformName) const +{ + return QtVersionManager::instance()->availableFeatures(platformName); +} + +QStringList QtFeatureProvider::availablePlatforms() const +{ + return QtVersionManager::instance()->availablePlatforms(); +} + +QString QtFeatureProvider::displayNameForPlatform(const QString &string) const { - return QtVersionManager::instance()->availableFeatures(); + return QtVersionManager::instance()->displayNameForPlatform(string); } diff --git a/src/plugins/qtsupport/qtversionmanager.h b/src/plugins/qtsupport/qtversionmanager.h index 97690293adb..19cc85c9ade 100644 --- a/src/plugins/qtsupport/qtversionmanager.h +++ b/src/plugins/qtsupport/qtversionmanager.h @@ -101,7 +101,9 @@ public: QString popPendingMwcUpdate(); QString popPendingGcceUpdate(); - Core::FeatureSet availableFeatures() const; + Core::FeatureSet availableFeatures(const QString &platformName) const; + QStringList availablePlatforms() const; + QString displayNameForPlatform(const QString &string) const; signals: // content of BaseQtVersion objects with qmake path might have changed @@ -155,7 +157,9 @@ class QTSUPPORT_EXPORT QtFeatureProvider : public Core::IFeatureProvider public: QtFeatureProvider() {} - virtual Core::FeatureSet availableFeatures() const; + Core::FeatureSet availableFeatures(const QString &platformName) const; + QStringList availablePlatforms() const; + QString displayNameForPlatform(const QString &string) const; }; } diff --git a/src/plugins/remotelinux/embeddedlinuxqtversion.cpp b/src/plugins/remotelinux/embeddedlinuxqtversion.cpp index 30a9bba11dc..e6e61907a84 100644 --- a/src/plugins/remotelinux/embeddedlinuxqtversion.cpp +++ b/src/plugins/remotelinux/embeddedlinuxqtversion.cpp @@ -34,6 +34,8 @@ #include "remotelinux_constants.h" +#include <qtsupport/qtsupportconstants.h> + #include <QtCore/QCoreApplication> namespace RemoteLinux { @@ -87,5 +89,15 @@ QString EmbeddedLinuxQtVersion::description() const return QCoreApplication::translate("QtVersion", "Embedded Linux", "Qt Version is used for embedded Linux development"); } +QString EmbeddedLinuxQtVersion::platformName() const +{ + return QLatin1String(QtSupport::Constants::EMBEDDED_LINUX_PLATFORM); +} + +QString EmbeddedLinuxQtVersion::platformDisplayName() const +{ + return QLatin1String(QtSupport::Constants::EMBEDDED_LINUX_PLATFORM_TR); +} + } // namespace Internal } // namespace RemoteLinux diff --git a/src/plugins/remotelinux/embeddedlinuxqtversion.h b/src/plugins/remotelinux/embeddedlinuxqtversion.h index bc0999489e8..2820b48447f 100644 --- a/src/plugins/remotelinux/embeddedlinuxqtversion.h +++ b/src/plugins/remotelinux/embeddedlinuxqtversion.h @@ -56,6 +56,9 @@ public: QSet<QString> supportedTargetIds() const; QString description() const; + + QString platformName() const; + QString platformDisplayName() const; }; } // namespace Internal diff --git a/src/plugins/texteditor/texteditorplugin.cpp b/src/plugins/texteditor/texteditorplugin.cpp index 9d950eec414..2c195f90113 100644 --- a/src/plugins/texteditor/texteditorplugin.cpp +++ b/src/plugins/texteditor/texteditorplugin.cpp @@ -111,6 +111,7 @@ bool TextEditorPlugin::initialize(const QStringList &arguments, QString *errorMe wizardParameters.setDisplayName(tr("Text File")); wizardParameters.setCategory(QLatin1String("U.General")); wizardParameters.setDisplayCategory(tr("General")); + wizardParameters.setFlags(Core::IWizard::PlatformIndependent); TextFileWizard *wizard = new TextFileWizard(QLatin1String(Constants::C_TEXTEDITOR_MIMETYPE_TEXT), QLatin1String("text$"), wizardParameters); diff --git a/src/plugins/vcsbase/basecheckoutwizard.cpp b/src/plugins/vcsbase/basecheckoutwizard.cpp index b3d5947e713..dfbcf275187 100644 --- a/src/plugins/vcsbase/basecheckoutwizard.cpp +++ b/src/plugins/vcsbase/basecheckoutwizard.cpp @@ -124,7 +124,7 @@ void BaseCheckoutWizard::setId(const QString &id) d->id = id; } -void BaseCheckoutWizard::runWizard(const QString &path, QWidget *parent) +void BaseCheckoutWizard::runWizard(const QString &path, QWidget *parent, const QString & /*platform*/) { // Create dialog and launch d->parameterPages = createParameterPages(path); @@ -152,6 +152,11 @@ Core::FeatureSet BaseCheckoutWizard::requiredFeatures() const return Core::FeatureSet(); } +Core::IWizard::WizardFlags BaseCheckoutWizard::flags() const +{ + return Core::IWizard::PlatformIndependent; +} + 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())); diff --git a/src/plugins/vcsbase/basecheckoutwizard.h b/src/plugins/vcsbase/basecheckoutwizard.h index 00ecb788081..b36bacc576c 100644 --- a/src/plugins/vcsbase/basecheckoutwizard.h +++ b/src/plugins/vcsbase/basecheckoutwizard.h @@ -64,10 +64,12 @@ public: virtual QString displayCategory() const; virtual QString id() const; - virtual void runWizard(const QString &path, QWidget *parent); + virtual void runWizard(const QString &path, QWidget *parent, const QString &platform); virtual Core::FeatureSet requiredFeatures() const; + virtual WizardFlags flags() const; + static QString openProject(const QString &path, QString *errorMessage); protected: -- GitLab