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:
Thomas Hartmann
2012-01-18 13:50:14 +01:00
parent 31d5ec9cab
commit 17a7bd17d0
73 changed files with 639 additions and 54 deletions

View File

@@ -37,7 +37,7 @@
#include <utils/stylehelper.h>
#include <coreplugin/coreconstants.h>
#include <coreplugin/dialogs/iwizard.h>
#include <coreplugin/featureprovider.h>
#include <QtGui/QAbstractProxyModel>
#include <QtGui/QItemSelectionModel>
@@ -249,19 +249,21 @@ void NewDialog::setWizards(QList<IWizard*> wizards)
cit = categories.insert(categoryName, categoryItem);
}
// add item
QStandardItem *wizardItem = new QStandardItem(wizard->displayName());
QIcon wizardIcon;
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();
// 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);
}
wizardItem->setIcon(wizardIcon);
wizardItem->setData(QVariant::fromValue(wizard), Qt::UserRole);
wizardItem->setFlags(Qt::ItemIsEnabled|Qt::ItemIsSelectable);
cit.value()->appendRow(wizardItem);
}