Commit 5c04b408 authored by Daniel Teske's avatar Daniel Teske Committed by Jarek Kobus
Browse files

Don't show the target setup page on adding a subproject



Task-number: QTCREATORBUG-7426
Change-Id: I69232c9cd924a701a5c7b48d124ed2319337ea02
Reviewed-by: default avatarJarek Kobus <jaroslaw.kobus@nokia.com>
parent e7993e20
......@@ -474,7 +474,8 @@ void BaseFileWizard::runWizard(const QString &path, QWidget *parent, const QStri
allExtensionPages,
platform,
requiredFeatures(),
dialogParameterFlags)));
dialogParameterFlags,
extraValues)));
QTC_ASSERT(!wizard.isNull(), return);
GeneratedFiles files;
......
......@@ -120,12 +120,15 @@ public:
explicit WizardDialogParameters(const QString &defaultPath, const WizardPageList &extensionPages,
const QString &platform, const Core::FeatureSet &requiredFeatures,
DialogParameterFlags flags)
DialogParameterFlags flags,
QVariantMap extraValues)
: m_defaultPath(defaultPath),
m_extensionPages(extensionPages),
m_selectedPlatform(platform),
m_requiredFeatures(requiredFeatures),
m_parameterFlags(flags) {}
m_parameterFlags(flags),
m_extraValues(extraValues)
{}
QString defaultPath() const
{ return m_defaultPath; }
......@@ -142,12 +145,16 @@ public:
DialogParameterFlags flags() const
{ return m_parameterFlags; }
QVariantMap extraValues() const
{ return m_extraValues; }
private:
QString m_defaultPath;
WizardPageList m_extensionPages;
QString m_selectedPlatform;
Core::FeatureSet m_requiredFeatures;
DialogParameterFlags m_parameterFlags;
QVariantMap m_extraValues;
};
class CORE_EXPORT BaseFileWizard : public IWizard
......
......@@ -70,5 +70,6 @@ inline uint qHash(const Id &id) { return id.uniqueIdentifier(); }
} // namespace Core
Q_DECLARE_METATYPE(Core::Id)
Q_DECLARE_METATYPE(QList<Core::Id>)
#endif // CORE_ID_H
......@@ -2597,6 +2597,12 @@ void ProjectExplorerPlugin::addNewFile()
QVariantMap map;
map.insert(QLatin1String(Constants::PREFERED_PROJECT_NODE), d->m_currentNode->projectNode()->path());
if (d->m_currentProject) {
QList<Core::Id> profileIds;
foreach (Target *target, d->m_currentProject->targets())
profileIds << target->id();
map.insert(QLatin1String(Constants::PROJECT_PROFILE_IDS), QVariant::fromValue(profileIds));
}
Core::ICore::showNewItemDialog(tr("New File", "Title of dialog"),
Core::IWizard::wizardsOfKind(Core::IWizard::FileWizard)
+ Core::IWizard::wizardsOfKind(Core::IWizard::ClassWizard),
......@@ -2613,6 +2619,13 @@ void ProjectExplorerPlugin::addNewSubproject()
d->m_currentNode->projectNode()).contains(ProjectNode::AddSubProject)) {
QVariantMap map;
map.insert(QLatin1String(Constants::PREFERED_PROJECT_NODE), d->m_currentNode->projectNode()->path());
if (d->m_currentProject) {
QList<Core::Id> profileIds;
foreach (Target *target, d->m_currentProject->targets())
profileIds << target->id();
map.insert(QLatin1String(Constants::PROJECT_PROFILE_IDS), QVariant::fromValue(profileIds));
}
Core::ICore::showNewItemDialog(tr("New Subproject", "Title of dialog"),
Core::IWizard::wizardsOfKind(Core::IWizard::ProjectWizard),
location, map);
......
......@@ -210,6 +210,7 @@ const char IMPORT_WIZARD_CATEGORY_DISPLAY[] = QT_TRANSLATE_NOOP("ProjectExplorer
// Wizard extra values
const char PREFERED_PROJECT_NODE[] = "ProjectExplorer.PreferedProjectNode";
const char PROJECT_PROFILE_IDS[] = "ProjectExplorer.Target.Ids";
// Build step lists ids:
const char BUILDSTEPS_CLEAN[] = "ProjectExplorer.BuildSteps.Clean";
......
......@@ -34,6 +34,7 @@
#include "customwidgetwidgetswizardpage.h"
#include "customwidgetpluginwizardpage.h"
#include "customwidgetwizard.h"
#include <projectexplorer/projectexplorerconstants.h>
#include <projectexplorer/devicesupport/idevice.h>
#include <projectexplorer/projectexplorerconstants.h>
......@@ -80,7 +81,9 @@ CustomWidgetWizardDialog::CustomWidgetWizardDialog(const QString &templateName,
setIntroDescription(tr("This wizard generates a Qt4 Designer Custom Widget "
"or a Qt4 Designer Custom Widget Collection project."));
addTargetSetupPage();
if (!parameters.extraValues().contains(ProjectExplorer::Constants::PROJECT_PROFILE_IDS))
addTargetSetupPage();
m_widgetPageId = addPage(m_widgetsPage);
m_pluginPageId = addPage(m_pluginPage);
wizardProgress()->item(m_widgetPageId)->setTitle(tr("Custom Widgets"));
......
......@@ -56,6 +56,7 @@ AbstractMobileAppWizardDialog::AbstractMobileAppWizardDialog(QWidget *parent,
const QtSupport::QtVersionNumber &maximumQtVersionNumber,
const Core::WizardDialogParameters &parameters)
: ProjectExplorer::BaseProjectWizardDialog(parent, parameters)
, m_targetsPage(0)
, m_genericOptionsPageId(-1)
, m_symbianOptionsPageId(-1)
, m_maemoOptionsPageId(-1)
......@@ -67,13 +68,16 @@ AbstractMobileAppWizardDialog::AbstractMobileAppWizardDialog(QWidget *parent,
, m_symbianItem(0)
, m_maemoItem(0)
, m_harmattanItem(0)
, m_profileIds(parameters.extraValues().value(ProjectExplorer::Constants::PROJECT_PROFILE_IDS).value<QList<Core::Id> >())
{
m_targetsPage = new TargetSetupPage;
m_targetsPage->setPreferredProfileMatcher(new QtSupport::QtPlatformProfileMatcher(selectedPlatform()));
m_targetsPage->setRequiredProfileMatcher(new QtSupport::QtVersionProfileMatcher(requiredFeatures(),
minimumQtVersionNumber,
maximumQtVersionNumber));
resize(900, 450);
if (!parameters.extraValues().contains(ProjectExplorer::Constants::PROJECT_PROFILE_IDS)) {
m_targetsPage = new TargetSetupPage;
m_targetsPage->setPreferredProfileMatcher(new QtSupport::QtPlatformProfileMatcher(selectedPlatform()));
m_targetsPage->setRequiredProfileMatcher(new QtSupport::QtVersionProfileMatcher(requiredFeatures(),
minimumQtVersionNumber,
maximumQtVersionNumber));
resize(900, 450);
}
m_genericOptionsPage = new Internal::MobileAppWizardGenericOptionsPage;
m_symbianOptionsPage = new Internal::MobileAppWizardSymbianOptionsPage;
......@@ -83,24 +87,48 @@ AbstractMobileAppWizardDialog::AbstractMobileAppWizardDialog(QWidget *parent,
void AbstractMobileAppWizardDialog::addMobilePages()
{
m_targetsPageId = addPageWithTitle(m_targetsPage, tr("Qt Versions"));
m_genericOptionsPageId = addPageWithTitle(m_genericOptionsPage,
tr("Mobile Options"));
m_symbianOptionsPageId = addPageWithTitle(m_symbianOptionsPage,
QLatin1String(" ") + tr("Symbian Specific"));
m_maemoOptionsPageId = addPageWithTitle(m_maemoOptionsPage,
QLatin1String(" ") + tr("Maemo5 And MeeGo Specific"));
m_harmattanOptionsPageId = addPageWithTitle(m_harmattanOptionsPage,
QLatin1String(" ") + tr("Harmattan Specific"));
m_targetItem = wizardProgress()->item(m_targetsPageId);
m_genericItem = wizardProgress()->item(m_genericOptionsPageId);
m_symbianItem = wizardProgress()->item(m_symbianOptionsPageId);
m_maemoItem = wizardProgress()->item(m_maemoOptionsPageId);
m_harmattanItem = wizardProgress()->item(m_harmattanOptionsPageId);
m_targetItem->setNextShownItem(0);
if (m_targetsPage) {
m_targetsPageId = addPageWithTitle(m_targetsPage, tr("Targets"));
m_targetItem = wizardProgress()->item(m_targetsPageId);
}
const bool shouldAddGenericPage = m_targetsPage
|| (isQtPlatformSelected(QtSupport::Constants::SYMBIAN_PLATFORM) && !m_ignoreGeneralOptions)
|| isQtPlatformSelected(QtSupport::Constants::MAEMO_FREMANTLE_PLATFORM);
const bool shouldAddSymbianPage = m_targetsPage ||
isQtPlatformSelected(QtSupport::Constants::SYMBIAN_PLATFORM);
const bool shouldAddMaemoPage = m_targetsPage ||
isQtPlatformSelected(QtSupport::Constants::MAEMO_FREMANTLE_PLATFORM)
|| isQtPlatformSelected(QtSupport::Constants::MEEGO_PLATFORM);
const bool shouldAddHarmattanPage = m_targetsPage ||
isQtPlatformSelected(QtSupport::Constants::MEEGO_HARMATTAN_PLATFORM);
if (shouldAddGenericPage) {
m_genericOptionsPageId = addPageWithTitle(m_genericOptionsPage,
tr("Mobile Options"));
m_genericItem = wizardProgress()->item(m_genericOptionsPageId);
}
if (shouldAddSymbianPage) {
m_symbianOptionsPageId = addPageWithTitle(m_symbianOptionsPage,
QLatin1String(" ") + tr("Symbian Specific"));
m_symbianItem = wizardProgress()->item(m_symbianOptionsPageId);
}
if (shouldAddMaemoPage) {
m_maemoOptionsPageId = addPageWithTitle(m_maemoOptionsPage,
QLatin1String(" ") + tr("Maemo5 And MeeGo Specific"));
m_maemoItem = wizardProgress()->item(m_maemoOptionsPageId);
}
if (shouldAddHarmattanPage) {
m_harmattanOptionsPageId = addPageWithTitle(m_harmattanOptionsPage,
QLatin1String(" ") + tr("Harmattan Specific"));
m_harmattanItem = wizardProgress()->item(m_harmattanOptionsPageId);
}
if (m_targetItem)
m_targetItem->setNextShownItem(0);
}
TargetSetupPage *AbstractMobileAppWizardDialog::targetsPage() const
......@@ -117,72 +145,78 @@ int AbstractMobileAppWizardDialog::addPageWithTitle(QWizardPage *page, const QSt
int AbstractMobileAppWizardDialog::nextId() const
{
if (currentPage() == m_targetsPage) {
if ((isQtPlatformSelected(QtSupport::Constants::SYMBIAN_PLATFORM) && !m_ignoreGeneralOptions) ||
isQtPlatformSelected(QtSupport::Constants::MAEMO_FREMANTLE_PLATFORM))
return m_genericOptionsPageId;
// If Symbian target and Qt Quick components for Symbian, skip the mobile options page.
else if (isQtPlatformSelected(QtSupport::Constants::SYMBIAN_PLATFORM) && m_ignoreGeneralOptions)
return m_symbianOptionsPageId;
else if (isQtPlatformSelected(QtSupport::Constants::MAEMO_FREMANTLE_PLATFORM))
return m_maemoOptionsPageId;
else if (isQtPlatformSelected(QtSupport::Constants::MEEGO_HARMATTAN_PLATFORM))
return m_harmattanOptionsPageId;
else
return idOfNextGenericPage();
} else if (currentPage() == m_genericOptionsPage) {
if (isQtPlatformSelected(QtSupport::Constants::SYMBIAN_PLATFORM))
return m_symbianOptionsPageId;
else if (isQtPlatformSelected(QtSupport::Constants::MAEMO_FREMANTLE_PLATFORM)
|| isQtPlatformSelected(QtSupport::Constants::MEEGO_PLATFORM))
return m_maemoOptionsPageId;
else
return m_harmattanOptionsPageId;
} else if (currentPage() == m_symbianOptionsPage) {
if (isQtPlatformSelected(QtSupport::Constants::MAEMO_FREMANTLE_PLATFORM)
|| isQtPlatformSelected(QtSupport::Constants::MEEGO_PLATFORM))
return m_maemoOptionsPageId;
else if (isQtPlatformSelected(QtSupport::Constants::MEEGO_HARMATTAN_PLATFORM))
return m_harmattanOptionsPageId;
else
return idOfNextGenericPage();
} else if (currentPage() == m_maemoOptionsPage) {
if (isQtPlatformSelected(QtSupport::Constants::MEEGO_HARMATTAN_PLATFORM))
return m_harmattanOptionsPageId;
else
return idOfNextGenericPage();
} else {
return BaseProjectWizardDialog::nextId();
if (m_targetsPage) {
if (currentPage() == m_targetsPage) {
if ((isQtPlatformSelected(QtSupport::Constants::SYMBIAN_PLATFORM) && !m_ignoreGeneralOptions) ||
isQtPlatformSelected(QtSupport::Constants::MAEMO_FREMANTLE_PLATFORM))
return m_genericOptionsPageId;
// If Symbian target and Qt Quick components for Symbian, skip the mobile options page.
else if (isQtPlatformSelected(QtSupport::Constants::SYMBIAN_PLATFORM) && m_ignoreGeneralOptions)
return m_symbianOptionsPageId;
else if (isQtPlatformSelected(QtSupport::Constants::MEEGO_PLATFORM))
return m_maemoOptionsPageId;
else if (isQtPlatformSelected(QtSupport::Constants::MEEGO_HARMATTAN_PLATFORM))
return m_harmattanOptionsPageId;
else
return idOfNextGenericPage();
} else if (currentPage() == m_genericOptionsPage) {
if (isQtPlatformSelected(QtSupport::Constants::SYMBIAN_PLATFORM))
return m_symbianOptionsPageId;
else if (isQtPlatformSelected(QtSupport::Constants::MAEMO_FREMANTLE_PLATFORM)
|| isQtPlatformSelected(QtSupport::Constants::MEEGO_PLATFORM))
return m_maemoOptionsPageId;
else if (isQtPlatformSelected(QtSupport::Constants::MEEGO_HARMATTAN_PLATFORM))
return m_harmattanOptionsPageId;
else
return idOfNextGenericPage();
} else if (currentPage() == m_symbianOptionsPage) {
if (isQtPlatformSelected(QtSupport::Constants::MAEMO_FREMANTLE_PLATFORM)
|| isQtPlatformSelected(QtSupport::Constants::MEEGO_PLATFORM))
return m_maemoOptionsPageId;
else if (isQtPlatformSelected(QtSupport::Constants::MEEGO_HARMATTAN_PLATFORM))
return m_harmattanOptionsPageId;
else
return idOfNextGenericPage();
} else if (currentPage() == m_maemoOptionsPage) {
if (isQtPlatformSelected(QtSupport::Constants::MEEGO_HARMATTAN_PLATFORM))
return m_harmattanOptionsPageId;
else
return idOfNextGenericPage();
}
}
return BaseProjectWizardDialog::nextId();
}
void AbstractMobileAppWizardDialog::initializePage(int id)
{
if (id == startId()) {
m_targetItem->setNextItems(QList<Utils::WizardProgressItem *>()
<< m_genericItem << m_symbianItem << m_maemoItem << m_harmattanItem << itemOfNextGenericPage());
m_genericItem->setNextItems(QList<Utils::WizardProgressItem *>()
<< m_symbianItem << m_maemoItem);
m_symbianItem->setNextItems(QList<Utils::WizardProgressItem *>()
<< m_maemoItem << m_harmattanItem << itemOfNextGenericPage());
m_maemoItem->setNextItems(QList<Utils::WizardProgressItem *>()
<< m_harmattanItem << itemOfNextGenericPage());
} else if (id == m_genericOptionsPageId
|| id == m_symbianOptionsPageId
|| id == m_maemoOptionsPageId) {
QList<Utils::WizardProgressItem *> order;
order << m_genericItem;
if (isQtPlatformSelected(QtSupport::Constants::SYMBIAN_PLATFORM))
order << m_symbianItem;
if (isQtPlatformSelected(QtSupport::Constants::MAEMO_FREMANTLE_PLATFORM)
|| isQtPlatformSelected(QtSupport::Constants::MEEGO_PLATFORM))
order << m_maemoItem;
if (isQtPlatformSelected(QtSupport::Constants::MEEGO_HARMATTAN_PLATFORM))
order << m_harmattanItem;
order << itemOfNextGenericPage();
for (int i = 0; i < order.count() - 1; i++)
order.at(i)->setNextShownItem(order.at(i + 1));
if (m_targetItem) {
if (id == startId()) {
m_targetItem->setNextItems(QList<Utils::WizardProgressItem *>()
<< m_genericItem << m_symbianItem << m_maemoItem << m_harmattanItem << itemOfNextGenericPage());
m_genericItem->setNextItems(QList<Utils::WizardProgressItem *>()
<< m_symbianItem << m_maemoItem);
m_symbianItem->setNextItems(QList<Utils::WizardProgressItem *>()
<< m_maemoItem << m_harmattanItem << itemOfNextGenericPage());
m_maemoItem->setNextItems(QList<Utils::WizardProgressItem *>()
<< m_harmattanItem << itemOfNextGenericPage());
} else if ((!m_targetItem && id == startId())
|| id == m_genericOptionsPageId
|| id == m_symbianOptionsPageId
|| id == m_maemoOptionsPageId) {
QList<Utils::WizardProgressItem *> order;
order << m_genericItem;
if (isQtPlatformSelected(QtSupport::Constants::SYMBIAN_PLATFORM))
order << m_symbianItem;
if (isQtPlatformSelected(QtSupport::Constants::MAEMO_FREMANTLE_PLATFORM)
|| isQtPlatformSelected(QtSupport::Constants::MEEGO_PLATFORM))
order << m_maemoItem;
if (isQtPlatformSelected(QtSupport::Constants::MEEGO_HARMATTAN_PLATFORM))
order << m_harmattanItem;
order << itemOfNextGenericPage();
for (int i = 0; i < order.count() - 1; i++)
order.at(i)->setNextShownItem(order.at(i + 1));
}
}
BaseProjectWizardDialog::initializePage(id);
}
......@@ -209,9 +243,27 @@ Utils::WizardProgressItem *AbstractMobileAppWizardDialog::itemOfNextGenericPage(
bool AbstractMobileAppWizardDialog::isQtPlatformSelected(const QString &platform) const
{
return m_targetsPage->isQtPlatformSelected(platform);
QList<Core::Id> selectedProfileList = selectedProfiles();
QtSupport::QtPlatformProfileMatcher matcher(platform);
QList<ProjectExplorer::Profile *> allProfileList
= ProjectExplorer::ProfileManager::instance()->profiles(&matcher);
foreach (ProjectExplorer::Profile *p, allProfileList) {
if (selectedProfileList.contains(p->id()))
return true;
}
return false;
}
QList<Core::Id> AbstractMobileAppWizardDialog::selectedProfiles() const
{
if (m_targetsPage)
return m_targetsPage->selectedProfiles();
return m_profileIds;
}
AbstractMobileAppWizard::AbstractMobileAppWizard(const Core::BaseFileWizardParameters &params,
QObject *parent) : Core::BaseFileWizard(params, parent)
{ }
......@@ -262,16 +314,19 @@ bool AbstractMobileAppWizard::postGenerateFiles(const QWizard *w,
= ExtensionSystem::PluginManager::getObject<Qt4Manager>();
Q_ASSERT(manager);
Qt4Project project(manager, app()->path(AbstractMobileApp::AppPro));
bool success = wizardDialog()->m_targetsPage->setupProject(&project);
if (success) {
project.saveSettings();
success = ProjectExplorer::CustomProjectWizard::postGenerateOpen(l, errorMessage);
bool success = true;
if (wizardDialog()->m_targetsPage) {
success = wizardDialog()->m_targetsPage->setupProject(&project);
if (success) {
const QString fileToOpen = fileToOpenPostGeneration();
if (!fileToOpen.isEmpty()) {
Core::EditorManager::openEditor(fileToOpen, Core::Id(), Core::EditorManager::ModeSwitch);
ProjectExplorer::ProjectExplorerPlugin::instance()->setCurrentFile(0, fileToOpen);
}
project.saveSettings();
success = ProjectExplorer::CustomProjectWizard::postGenerateOpen(l, errorMessage);
}
}
if (success) {
const QString fileToOpen = fileToOpenPostGeneration();
if (!fileToOpen.isEmpty()) {
Core::EditorManager::openEditor(fileToOpen, Core::Id(), Core::EditorManager::ModeSwitch);
ProjectExplorer::ProjectExplorerPlugin::instance()->setCurrentFile(0, fileToOpen);
}
}
return success;
......@@ -283,7 +338,8 @@ void AbstractMobileAppWizard::useProjectPath(const QString &projectName,
wizardDialog()->m_symbianOptionsPage->setSymbianUid(app()->symbianUidForPath(projectPath + projectName));
app()->setProjectName(projectName);
app()->setProjectPath(projectPath);
wizardDialog()->m_targetsPage->setProFilePath(app()->path(AbstractMobileApp::AppPro));
if (wizardDialog()->m_targetsPage)
wizardDialog()->m_targetsPage->setProFilePath(app()->path(AbstractMobileApp::AppPro));
projectPathChanged(app()->path(AbstractMobileApp::AppPro));
}
......
......@@ -77,6 +77,7 @@ private:
int idOfNextGenericPage() const;
Utils::WizardProgressItem *itemOfNextGenericPage() const;
bool isQtPlatformSelected(const QString &platform) const;
QList<Core::Id> selectedProfiles() const;
Internal::MobileAppWizardGenericOptionsPage *m_genericOptionsPage;
Internal::MobileAppWizardSymbianOptionsPage *m_symbianOptionsPage;
......@@ -95,6 +96,7 @@ private:
Utils::WizardProgressItem *m_symbianItem;
Utils::WizardProgressItem *m_maemoItem;
Utils::WizardProgressItem *m_harmattanItem;
QList<Core::Id> m_profileIds;
friend class AbstractMobileAppWizard;
};
......
......@@ -33,6 +33,7 @@
#include "consoleappwizarddialog.h"
#include "consoleappwizard.h"
#include <coreplugin/basefilewizard.h>
#include <projectexplorer/projectexplorerconstants.h>
#include <QDebug>
......@@ -55,7 +56,8 @@ ConsoleAppWizardDialog::ConsoleAppWizardDialog(const QString &templateName,
"provide a GUI."));
addModulesPage();
addTargetSetupPage();
if (!parameters.extraValues().contains(ProjectExplorer::Constants::PROJECT_PROFILE_IDS))
addTargetSetupPage();
addExtensionPages(parameters.extensionPages());
}
......
......@@ -32,6 +32,7 @@
#include "emptyprojectwizarddialog.h"
#include "qtprojectparameters.h"
#include <projectexplorer/projectexplorerconstants.h>
namespace Qt4ProjectManager {
namespace Internal {
......@@ -47,7 +48,8 @@ EmptyProjectWizardDialog::EmptyProjectWizardDialog(const QString &templateName,
setIntroDescription(tr("This wizard generates an empty Qt4 project. "
"Add files to it later on by using the other wizards."));
addTargetSetupPage();
if (!parameters.extraValues().contains(ProjectExplorer::Constants::PROJECT_PROFILE_IDS))
addTargetSetupPage();
addExtensionPages(parameters.extensionPages());
}
......
......@@ -37,6 +37,7 @@
#include <qtsupport/qtsupportconstants.h>
#include <projectexplorer/projectexplorerconstants.h>
#include <QSet>
namespace Qt4ProjectManager {
......@@ -66,7 +67,8 @@ GuiAppWizardDialog::GuiAppWizardDialog(const QString &templateName,
"and includes an empty widget."));
addModulesPage();
addTargetSetupPage(isMobile);
if (!parameters.extraValues().contains(ProjectExplorer::Constants::PROJECT_PROFILE_IDS))
addTargetSetupPage(isMobile);
m_filesPage->setFormInputCheckable(true);
m_filesPage->setClassTypeComboVisible(false);
......
......@@ -129,7 +129,8 @@ AbstractMobileAppWizardDialog *Html5AppWizard::createWizardDialogInternal(QWidge
void Html5AppWizard::projectPathChanged(const QString &path) const
{
d->wizardDialog->targetsPage()->setProFilePath(path);
if (d->wizardDialog->targetsPage())
d->wizardDialog->targetsPage()->setProFilePath(path);
}
void Html5AppWizard::prepareGenerateFiles(const QWizard *w,
......
......@@ -42,6 +42,7 @@
#include <qtsupport/qtsupportconstants.h>
#include <utils/projectintropage.h>
#include <projectexplorer/projectexplorerconstants.h>
#include <QDebug>
#include <QDir>
......@@ -154,10 +155,12 @@ LibraryWizardDialog::LibraryWizardDialog(const QString &templateName,
// Use the intro page instead, set up initially
setIntroDescription(tr("This wizard generates a C++ library project."));
m_targetPageId = addTargetSetupPage();
if (m_targetPageId != -1)
if (!parameters.extraValues().contains(ProjectExplorer::Constants::PROJECT_PROFILE_IDS)) {
m_targetPageId = addTargetSetupPage();
m_mobilePageId = addPage(m_mobilePage);
} else if (isQtPlatformSelected(QtSupport::Constants::SYMBIAN_PLATFORM)) {
m_mobilePageId = addPage(m_mobilePage);
}
m_modulesPageId = addModulesPage();
......@@ -169,10 +172,12 @@ LibraryWizardDialog::LibraryWizardDialog(const QString &templateName,
Utils::WizardProgressItem *introItem = wizardProgress()->item(startId());
Utils::WizardProgressItem *targetItem = 0;
if (m_targetPageId != -1)
Utils::WizardProgressItem *mobileItem = 0;
if (m_targetPageId != -1) {
targetItem = wizardProgress()->item(m_targetPageId);
Utils::WizardProgressItem *mobileItem = wizardProgress()->item(m_mobilePageId);
mobileItem->setTitle(QLatin1String(" ") + tr("Symbian Specific"));
mobileItem = wizardProgress()->item(m_mobilePageId);
mobileItem->setTitle(QLatin1String(" ") + tr("Symbian Specific"));
}
Utils::WizardProgressItem *modulesItem = wizardProgress()->item(m_modulesPageId);
Utils::WizardProgressItem *filesItem = wizardProgress()->item(m_filesPageId);
filesItem->setTitle(tr("Details"));
......@@ -185,12 +190,19 @@ LibraryWizardDialog::LibraryWizardDialog(const QString &templateName,
<< modulesItem << filesItem);
mobileItem->setNextShownItem(0);
} else {
introItem->setNextItems(QList<Utils::WizardProgressItem *>()
<< modulesItem << filesItem);
introItem->setNextShownItem(0);
if (isQtPlatformSelected(QtSupport::Constants::SYMBIAN_PLATFORM)) {
introItem->setNextItems(QList<Utils::WizardProgressItem *>()
<< mobileItem);
mobileItem->setNextItems(QList<Utils::WizardProgressItem *>()
<< modulesItem << filesItem);
mobileItem->setNextShownItem(0);
} else {
introItem->setNextItems(QList<Utils::WizardProgressItem *>()
<< modulesItem << filesItem);
introItem->setNextShownItem(0);
}
}
connect(this, SIGNAL(currentIdChanged(int)), this, SLOT(slotCurrentIdChanged(int)));
addExtensionPages(parameters.extensionPages());
......@@ -254,6 +266,10 @@ int LibraryWizardDialog::nextId() const
return skipModulesPageIfNeeded();
}
} else if (currentId() == startId()) {
if (isQtPlatformSelected(QtSupport::Constants::SYMBIAN_PLATFORM))
return m_mobilePageId;
return skipModulesPageIfNeeded();
} else if (currentId() == m_mobilePageId) {
return skipModulesPageIfNeeded();
}
......@@ -262,7 +278,8 @@ int LibraryWizardDialog::nextId() const
void LibraryWizardDialog::initializePage(int id)
{
if (m_targetPageId != -1 && id == m_targetPageId) {
if ((m_targetPageId != -1 && id == m_targetPageId)