2009-02-25 09:15:00 +01:00
|
|
|
/**************************************************************************
|
2008-12-02 12:01:29 +01:00
|
|
|
**
|
|
|
|
|
** This file is part of Qt Creator
|
|
|
|
|
**
|
2012-01-26 18:33:46 +01:00
|
|
|
** Copyright (c) 2012 Nokia Corporation and/or its subsidiary(-ies).
|
2008-12-02 12:01:29 +01:00
|
|
|
**
|
2012-07-19 12:26:56 +02:00
|
|
|
** Contact: http://www.qt-project.org/
|
2008-12-02 12:01:29 +01:00
|
|
|
**
|
2008-12-02 14:17:16 +01:00
|
|
|
**
|
2009-02-25 09:15:00 +01:00
|
|
|
** GNU Lesser General Public License Usage
|
2008-12-02 14:17:16 +01:00
|
|
|
**
|
2011-04-13 08:42:33 +02:00
|
|
|
** This file may be used under the terms of the GNU Lesser General Public
|
|
|
|
|
** License version 2.1 as published by the Free Software Foundation and
|
|
|
|
|
** appearing in the file LICENSE.LGPL included in the packaging of this file.
|
|
|
|
|
** Please review the following information to ensure the GNU Lesser General
|
|
|
|
|
** Public License version 2.1 requirements will be met:
|
|
|
|
|
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
2008-12-02 14:17:16 +01:00
|
|
|
**
|
2010-12-17 16:01:08 +01:00
|
|
|
** In addition, as a special exception, Nokia gives you certain additional
|
2011-04-13 08:42:33 +02:00
|
|
|
** rights. These rights are described in the Nokia Qt LGPL Exception
|
2010-12-17 16:01:08 +01:00
|
|
|
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
|
|
|
|
|
**
|
2011-04-13 08:42:33 +02:00
|
|
|
** Other Usage
|
|
|
|
|
**
|
|
|
|
|
** Alternatively, this file may be used in accordance with the terms and
|
|
|
|
|
** conditions contained in a signed written agreement between you and Nokia.
|
|
|
|
|
**
|
2008-12-02 12:01:29 +01:00
|
|
|
**
|
2009-02-25 09:15:00 +01:00
|
|
|
**************************************************************************/
|
2008-12-02 16:19:05 +01:00
|
|
|
|
2008-12-02 12:01:29 +01:00
|
|
|
#include "qtwizard.h"
|
2010-02-17 14:26:42 +01:00
|
|
|
|
2008-12-02 12:01:29 +01:00
|
|
|
#include "qt4project.h"
|
2010-03-29 17:57:18 +02:00
|
|
|
#include "qt4projectmanager.h"
|
2008-12-02 12:01:29 +01:00
|
|
|
#include "qt4projectmanagerconstants.h"
|
2009-11-26 18:03:16 +01:00
|
|
|
#include "modulespage.h"
|
2010-03-29 17:57:18 +02:00
|
|
|
#include "targetsetuppage.h"
|
2008-12-02 12:01:29 +01:00
|
|
|
|
2009-01-20 11:52:04 +01:00
|
|
|
#include <coreplugin/icore.h>
|
2010-04-16 15:55:32 +02:00
|
|
|
#include <coreplugin/editormanager/editormanager.h>
|
2011-02-28 16:50:14 +01:00
|
|
|
|
2009-06-17 12:40:54 +02:00
|
|
|
#include <cpptools/cpptoolsconstants.h>
|
2011-02-28 16:50:14 +01:00
|
|
|
|
2012-09-03 18:31:44 +02:00
|
|
|
#include <projectexplorer/kit.h>
|
2010-03-17 17:45:33 +01:00
|
|
|
#include <projectexplorer/projectexplorer.h>
|
2011-02-28 16:50:14 +01:00
|
|
|
#include <projectexplorer/task.h>
|
2012-09-03 18:31:44 +02:00
|
|
|
#include <qtsupport/qtkitinformation.h>
|
2012-04-24 15:49:09 +02:00
|
|
|
#include <qtsupport/qtsupportconstants.h>
|
2011-02-28 16:50:14 +01:00
|
|
|
|
|
|
|
|
#include <extensionsystem/pluginmanager.h>
|
|
|
|
|
|
2012-02-15 10:42:41 +01:00
|
|
|
#include <QCoreApplication>
|
|
|
|
|
#include <QVariant>
|
2008-12-02 12:01:29 +01:00
|
|
|
|
|
|
|
|
using namespace Qt4ProjectManager;
|
|
|
|
|
using namespace Qt4ProjectManager::Internal;
|
|
|
|
|
|
2011-11-18 12:54:41 +01:00
|
|
|
static Core::BaseFileWizardParameters
|
2009-11-27 10:33:24 +01:00
|
|
|
wizardParameters(const QString &id,
|
2010-01-13 18:44:15 +01:00
|
|
|
const QString &category,
|
|
|
|
|
const QString &displayCategory,
|
2009-11-27 10:33:24 +01:00
|
|
|
const QString &name,
|
2008-12-02 12:01:29 +01:00
|
|
|
const QString &description,
|
|
|
|
|
const QIcon &icon)
|
|
|
|
|
{
|
|
|
|
|
Core::BaseFileWizardParameters rc(Core::IWizard::ProjectWizard);
|
2010-01-13 18:44:15 +01:00
|
|
|
rc.setCategory(category);
|
2011-11-18 12:54:41 +01:00
|
|
|
rc.setDisplayCategory(QCoreApplication::translate("ProjectExplorer",
|
2010-01-13 18:44:15 +01:00
|
|
|
displayCategory.toLatin1()));
|
2008-12-02 12:01:29 +01:00
|
|
|
rc.setIcon(icon);
|
2010-01-07 18:17:24 +01:00
|
|
|
rc.setDisplayName(name);
|
2009-11-27 10:33:24 +01:00
|
|
|
rc.setId(id);
|
2008-12-02 12:01:29 +01:00
|
|
|
rc.setDescription(description);
|
|
|
|
|
return rc;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// -------------------- QtWizard
|
2010-01-13 18:44:15 +01:00
|
|
|
QtWizard::QtWizard(const QString &id,
|
|
|
|
|
const QString &category,
|
|
|
|
|
const QString &displayCategory,
|
|
|
|
|
const QString &name,
|
2009-11-27 10:33:24 +01:00
|
|
|
const QString &description, const QIcon &icon) :
|
2010-01-13 18:44:15 +01:00
|
|
|
Core::BaseFileWizard(wizardParameters(id,
|
|
|
|
|
category,
|
|
|
|
|
displayCategory,
|
|
|
|
|
name,
|
|
|
|
|
description,
|
|
|
|
|
icon))
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
2009-12-16 14:19:34 +01:00
|
|
|
QString QtWizard::sourceSuffix()
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
|
|
|
|
return preferredSuffix(QLatin1String(Constants::CPP_SOURCE_MIMETYPE));
|
|
|
|
|
}
|
|
|
|
|
|
2009-12-16 14:19:34 +01:00
|
|
|
QString QtWizard::headerSuffix()
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
|
|
|
|
return preferredSuffix(QLatin1String(Constants::CPP_HEADER_MIMETYPE));
|
|
|
|
|
}
|
|
|
|
|
|
2009-12-16 14:19:34 +01:00
|
|
|
QString QtWizard::formSuffix()
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
|
|
|
|
return preferredSuffix(QLatin1String(Constants::FORM_MIMETYPE));
|
|
|
|
|
}
|
|
|
|
|
|
2009-12-16 14:19:34 +01:00
|
|
|
QString QtWizard::profileSuffix()
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
|
|
|
|
return preferredSuffix(QLatin1String(Constants::PROFILE_MIMETYPE));
|
|
|
|
|
}
|
|
|
|
|
|
2010-02-17 16:18:21 +01:00
|
|
|
bool QtWizard::postGenerateFiles(const QWizard *w, const Core::GeneratedFiles &l, QString *errorMessage)
|
2010-03-12 11:20:32 +01:00
|
|
|
{
|
|
|
|
|
return QtWizard::qt4ProjectPostGenerateFiles(w, l, errorMessage);
|
|
|
|
|
}
|
|
|
|
|
|
2010-04-16 15:55:32 +02:00
|
|
|
bool QtWizard::qt4ProjectPostGenerateFiles(const QWizard *w,
|
|
|
|
|
const Core::GeneratedFiles &generatedFiles,
|
|
|
|
|
QString *errorMessage)
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
2010-02-17 16:18:21 +01:00
|
|
|
const BaseQt4ProjectWizardDialog *dialog = qobject_cast<const BaseQt4ProjectWizardDialog *>(w);
|
|
|
|
|
|
2010-04-16 15:55:32 +02:00
|
|
|
// Generate user settings
|
|
|
|
|
foreach (const Core::GeneratedFile &file, generatedFiles)
|
|
|
|
|
if (file.attributes() & Core::GeneratedFile::OpenProjectAttribute) {
|
|
|
|
|
dialog->writeUserFile(file.path());
|
|
|
|
|
break;
|
|
|
|
|
}
|
2010-02-17 16:18:21 +01:00
|
|
|
|
2010-04-16 15:55:32 +02:00
|
|
|
// Post-Generate: Open the projects/editors
|
|
|
|
|
return ProjectExplorer::CustomProjectWizard::postGenerateOpen(generatedFiles ,errorMessage);
|
2008-12-02 12:01:29 +01:00
|
|
|
}
|
|
|
|
|
|
2009-12-16 14:19:34 +01:00
|
|
|
QString QtWizard::templateDir()
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
2012-01-24 15:36:40 +01:00
|
|
|
QString rc = Core::ICore::resourcePath();
|
2008-12-02 12:01:29 +01:00
|
|
|
rc += QLatin1String("/templates/qt4project");
|
|
|
|
|
return rc;
|
|
|
|
|
}
|
2009-06-17 12:40:54 +02:00
|
|
|
|
|
|
|
|
bool QtWizard::lowerCaseFiles()
|
|
|
|
|
{
|
|
|
|
|
QString lowerCaseSettingsKey = QLatin1String(CppTools::Constants::CPPTOOLS_SETTINGSGROUP);
|
|
|
|
|
lowerCaseSettingsKey += QLatin1Char('/');
|
|
|
|
|
lowerCaseSettingsKey += QLatin1String(CppTools::Constants::LOWERCASE_CPPFILES_KEY);
|
|
|
|
|
const bool lowerCaseDefault = CppTools::Constants::lowerCaseFilesDefault;
|
2012-01-24 15:36:40 +01:00
|
|
|
return Core::ICore::settings()->value(lowerCaseSettingsKey, QVariant(lowerCaseDefault)).toBool();
|
2009-06-17 12:40:54 +02:00
|
|
|
}
|
|
|
|
|
|
2009-11-26 18:03:16 +01:00
|
|
|
bool QtWizard::showModulesPageForApplications()
|
|
|
|
|
{
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool QtWizard::showModulesPageForLibraries()
|
|
|
|
|
{
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
2010-03-12 11:20:32 +01:00
|
|
|
// ------------ CustomQt4ProjectWizard
|
|
|
|
|
CustomQt4ProjectWizard::CustomQt4ProjectWizard(const Core::BaseFileWizardParameters& baseFileParameters,
|
|
|
|
|
QObject *parent) :
|
|
|
|
|
ProjectExplorer::CustomProjectWizard(baseFileParameters, parent)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
2012-02-03 18:00:08 +01:00
|
|
|
QWizard *CustomQt4ProjectWizard::createWizardDialog(QWidget *parent,
|
|
|
|
|
const Core::WizardDialogParameters &wizardDialogParameters) const
|
2010-03-12 11:20:32 +01:00
|
|
|
{
|
2012-02-03 18:00:08 +01:00
|
|
|
BaseQt4ProjectWizardDialog *wizard = new BaseQt4ProjectWizardDialog(false, parent, wizardDialogParameters);
|
|
|
|
|
|
2012-05-14 18:55:30 +02:00
|
|
|
if (!wizardDialogParameters.extraValues().contains(ProjectExplorer::Constants::PROJECT_PROFILE_IDS))
|
|
|
|
|
wizard->addTargetSetupPage(false, targetPageId);
|
2012-07-04 15:57:54 +02:00
|
|
|
|
|
|
|
|
initProjectWizardDialog(wizard, wizardDialogParameters.defaultPath(),
|
|
|
|
|
wizardDialogParameters.extensionPages());
|
2010-03-12 11:20:32 +01:00
|
|
|
return wizard;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool CustomQt4ProjectWizard::postGenerateFiles(const QWizard *w, const Core::GeneratedFiles &l, QString *errorMessage)
|
|
|
|
|
{
|
|
|
|
|
return QtWizard::qt4ProjectPostGenerateFiles(w, l, errorMessage);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void CustomQt4ProjectWizard::registerSelf()
|
|
|
|
|
{
|
|
|
|
|
ProjectExplorer::CustomWizard::registerFactory<CustomQt4ProjectWizard>(QLatin1String("qt4project"));
|
|
|
|
|
}
|
|
|
|
|
|
2009-11-26 18:03:16 +01:00
|
|
|
// ----------------- BaseQt4ProjectWizardDialog
|
2012-02-03 18:00:08 +01:00
|
|
|
BaseQt4ProjectWizardDialog::BaseQt4ProjectWizardDialog(bool showModulesPage, QWidget *parent,
|
|
|
|
|
const Core::WizardDialogParameters ¶meters) :
|
|
|
|
|
ProjectExplorer::BaseProjectWizardDialog(parent, parameters),
|
2010-02-17 16:18:21 +01:00
|
|
|
m_modulesPage(0),
|
2012-05-14 18:55:30 +02:00
|
|
|
m_targetSetupPage(0),
|
|
|
|
|
m_profileIds(parameters.extraValues().value(ProjectExplorer::Constants::PROJECT_PROFILE_IDS).value<QList<Core::Id> >())
|
2009-11-26 18:03:16 +01:00
|
|
|
{
|
|
|
|
|
init(showModulesPage);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
BaseQt4ProjectWizardDialog::BaseQt4ProjectWizardDialog(bool showModulesPage,
|
|
|
|
|
Utils::ProjectIntroPage *introPage,
|
2012-02-03 18:00:08 +01:00
|
|
|
int introId, QWidget *parent,
|
|
|
|
|
const Core::WizardDialogParameters ¶meters) :
|
|
|
|
|
ProjectExplorer::BaseProjectWizardDialog(introPage, introId, parent, parameters),
|
2010-02-17 16:18:21 +01:00
|
|
|
m_modulesPage(0),
|
2012-05-14 18:55:30 +02:00
|
|
|
m_targetSetupPage(0),
|
|
|
|
|
m_profileIds(parameters.extraValues().value(ProjectExplorer::Constants::PROJECT_PROFILE_IDS).value<QList<Core::Id> >())
|
2009-11-26 18:03:16 +01:00
|
|
|
{
|
|
|
|
|
init(showModulesPage);
|
|
|
|
|
}
|
|
|
|
|
|
2010-03-05 12:12:21 +01:00
|
|
|
BaseQt4ProjectWizardDialog::~BaseQt4ProjectWizardDialog()
|
|
|
|
|
{
|
2010-03-29 17:57:18 +02:00
|
|
|
if (m_targetSetupPage && !m_targetSetupPage->parent())
|
|
|
|
|
delete m_targetSetupPage;
|
2010-03-05 12:12:21 +01:00
|
|
|
if (m_modulesPage && !m_modulesPage->parent())
|
|
|
|
|
delete m_modulesPage;
|
|
|
|
|
}
|
|
|
|
|
|
2009-11-26 18:03:16 +01:00
|
|
|
void BaseQt4ProjectWizardDialog::init(bool showModulesPage)
|
|
|
|
|
{
|
|
|
|
|
if (showModulesPage)
|
|
|
|
|
m_modulesPage = new ModulesPage;
|
2010-10-27 12:51:33 +02:00
|
|
|
connect(this, SIGNAL(projectParametersChanged(QString,QString)),
|
2010-04-20 12:56:21 +02:00
|
|
|
this, SLOT(generateProfileName(QString,QString)));
|
2009-11-26 18:03:16 +01:00
|
|
|
}
|
2009-06-17 12:40:54 +02:00
|
|
|
|
2010-03-05 11:24:31 +01:00
|
|
|
int BaseQt4ProjectWizardDialog::addModulesPage(int id)
|
2009-11-26 18:03:16 +01:00
|
|
|
{
|
2010-03-05 11:24:31 +01:00
|
|
|
if (!m_modulesPage)
|
|
|
|
|
return -1;
|
|
|
|
|
if (id >= 0) {
|
|
|
|
|
setPage(id, m_modulesPage);
|
2010-03-31 14:48:08 +02:00
|
|
|
wizardProgress()->item(id)->setTitle(tr("Modules"));
|
2010-03-05 11:24:31 +01:00
|
|
|
return id;
|
2009-11-26 18:03:16 +01:00
|
|
|
}
|
2010-03-31 14:48:08 +02:00
|
|
|
const int newId = addPage(m_modulesPage);
|
|
|
|
|
wizardProgress()->item(newId)->setTitle(tr("Modules"));
|
|
|
|
|
return newId;
|
2009-11-26 18:03:16 +01:00
|
|
|
}
|
|
|
|
|
|
2012-04-24 15:49:09 +02:00
|
|
|
int BaseQt4ProjectWizardDialog::addTargetSetupPage(bool mobile, int id)
|
2010-02-17 16:18:21 +01:00
|
|
|
{
|
2010-03-29 17:57:18 +02:00
|
|
|
m_targetSetupPage = new TargetSetupPage;
|
2012-04-24 15:49:09 +02:00
|
|
|
const QString platform = selectedPlatform();
|
|
|
|
|
Core::FeatureSet features = mobile ? Core::FeatureSet(QtSupport::Constants::FEATURE_MOBILE)
|
|
|
|
|
: Core::FeatureSet(QtSupport::Constants::FEATURE_DESKTOP);
|
|
|
|
|
if (platform.isEmpty())
|
2012-09-03 18:31:44 +02:00
|
|
|
m_targetSetupPage->setPreferredKitMatcher(new QtSupport::QtVersionKitMatcher(features));
|
2012-04-24 15:49:09 +02:00
|
|
|
else
|
2012-09-03 18:31:44 +02:00
|
|
|
m_targetSetupPage->setPreferredKitMatcher(new QtSupport::QtPlatformKitMatcher(platform));
|
2010-08-18 11:25:23 +02:00
|
|
|
|
2012-09-03 18:31:44 +02:00
|
|
|
m_targetSetupPage->setRequiredKitMatcher(new QtSupport::QtVersionKitMatcher(requiredFeatures()));
|
2012-04-24 15:49:09 +02:00
|
|
|
|
|
|
|
|
resize(900, 450);
|
2010-03-29 17:57:18 +02:00
|
|
|
if (id >= 0)
|
|
|
|
|
setPage(id, m_targetSetupPage);
|
|
|
|
|
else
|
|
|
|
|
id = addPage(m_targetSetupPage);
|
2011-02-21 15:30:05 +01:00
|
|
|
wizardProgress()->item(id)->setTitle(tr("Targets"));
|
2010-03-29 17:57:18 +02:00
|
|
|
|
|
|
|
|
return id;
|
2010-02-17 16:18:21 +01:00
|
|
|
}
|
|
|
|
|
|
2012-02-10 12:29:53 +01:00
|
|
|
QStringList BaseQt4ProjectWizardDialog::selectedModulesList() const
|
2009-11-26 18:03:16 +01:00
|
|
|
{
|
2012-02-10 12:29:53 +01:00
|
|
|
return m_modulesPage ? m_modulesPage->selectedModulesList() : m_selectedModules;
|
2009-11-26 18:03:16 +01:00
|
|
|
}
|
2009-06-17 12:40:54 +02:00
|
|
|
|
2009-11-26 18:03:16 +01:00
|
|
|
void BaseQt4ProjectWizardDialog::setSelectedModules(const QString &modules, bool lock)
|
2010-01-29 22:49:55 +01:00
|
|
|
{
|
2012-02-10 12:29:53 +01:00
|
|
|
const QStringList modulesList = modules.split(QLatin1Char(' '));
|
2009-11-26 18:03:16 +01:00
|
|
|
if (m_modulesPage) {
|
2012-02-10 12:29:53 +01:00
|
|
|
foreach (const QString &module, modulesList) {
|
2009-11-26 18:03:16 +01:00
|
|
|
m_modulesPage->setModuleSelected(module, true);
|
|
|
|
|
m_modulesPage->setModuleEnabled(module, !lock);
|
|
|
|
|
}
|
|
|
|
|
} else {
|
2012-02-10 12:29:53 +01:00
|
|
|
m_selectedModules = modulesList;
|
2009-11-26 18:03:16 +01:00
|
|
|
}
|
|
|
|
|
}
|
2009-06-17 12:40:54 +02:00
|
|
|
|
2012-02-10 12:29:53 +01:00
|
|
|
QStringList BaseQt4ProjectWizardDialog::deselectedModulesList() const
|
2009-11-26 18:03:16 +01:00
|
|
|
{
|
2012-02-10 12:29:53 +01:00
|
|
|
return m_modulesPage ? m_modulesPage->deselectedModulesList() : m_deselectedModules;
|
2009-11-26 18:03:16 +01:00
|
|
|
}
|
2009-06-17 12:40:54 +02:00
|
|
|
|
2009-11-26 18:03:16 +01:00
|
|
|
void BaseQt4ProjectWizardDialog::setDeselectedModules(const QString &modules)
|
|
|
|
|
{
|
2012-02-10 12:29:53 +01:00
|
|
|
const QStringList modulesList = modules.split(QLatin1Char(' '));
|
2009-11-26 18:03:16 +01:00
|
|
|
if (m_modulesPage) {
|
2012-02-10 12:29:53 +01:00
|
|
|
foreach (const QString &module, modulesList)
|
2009-11-26 18:03:16 +01:00
|
|
|
m_modulesPage->setModuleSelected(module, false);
|
|
|
|
|
} else {
|
2012-02-10 12:29:53 +01:00
|
|
|
m_deselectedModules = modulesList;
|
2009-11-26 18:03:16 +01:00
|
|
|
}
|
|
|
|
|
}
|
2009-06-17 12:40:54 +02:00
|
|
|
|
2010-03-29 17:57:18 +02:00
|
|
|
bool BaseQt4ProjectWizardDialog::writeUserFile(const QString &proFileName) const
|
|
|
|
|
{
|
|
|
|
|
if (!m_targetSetupPage)
|
|
|
|
|
return false;
|
|
|
|
|
|
2012-06-18 11:34:15 +02:00
|
|
|
Qt4Manager *manager = ExtensionSystem::PluginManager::getObject<Qt4Manager>();
|
2010-03-29 17:57:18 +02:00
|
|
|
Q_ASSERT(manager);
|
|
|
|
|
|
|
|
|
|
Qt4Project *pro = new Qt4Project(manager, proFileName);
|
|
|
|
|
bool success = m_targetSetupPage->setupProject(pro);
|
|
|
|
|
if (success)
|
|
|
|
|
pro->saveSettings();
|
|
|
|
|
delete pro;
|
|
|
|
|
return success;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool BaseQt4ProjectWizardDialog::setupProject(Qt4Project *project) const
|
2010-02-17 16:18:21 +01:00
|
|
|
{
|
2012-05-14 18:55:30 +02:00
|
|
|
if (!m_targetSetupPage)
|
|
|
|
|
return true;
|
2010-03-29 17:57:18 +02:00
|
|
|
return m_targetSetupPage->setupProject(project);
|
2010-02-17 16:18:21 +01:00
|
|
|
}
|
|
|
|
|
|
2012-04-24 15:49:09 +02:00
|
|
|
bool BaseQt4ProjectWizardDialog::isQtPlatformSelected(const QString &platform) const
|
2010-02-17 16:18:21 +01:00
|
|
|
{
|
2012-09-03 18:31:44 +02:00
|
|
|
QList<Core::Id> selectedKitList = selectedKits();
|
2012-05-14 18:55:30 +02:00
|
|
|
|
2012-09-03 18:31:44 +02:00
|
|
|
QtSupport::QtPlatformKitMatcher matcher(platform);
|
|
|
|
|
QList<ProjectExplorer::Kit *> kitList
|
|
|
|
|
= ProjectExplorer::KitManager::instance()->kits(&matcher);
|
|
|
|
|
foreach (ProjectExplorer::Kit *p, kitList) {
|
|
|
|
|
if (selectedKitList.contains(p->id()))
|
2012-05-14 18:55:30 +02:00
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
2012-09-03 18:31:44 +02:00
|
|
|
QList<Core::Id> BaseQt4ProjectWizardDialog::selectedKits() const
|
2012-05-14 18:55:30 +02:00
|
|
|
{
|
|
|
|
|
if (!m_targetSetupPage)
|
|
|
|
|
return m_profileIds;
|
2012-09-03 18:31:44 +02:00
|
|
|
return m_targetSetupPage->selectedKits();
|
2010-02-17 16:18:21 +01:00
|
|
|
}
|
2010-03-05 11:24:31 +01:00
|
|
|
|
2012-02-14 15:21:21 +01:00
|
|
|
void BaseQt4ProjectWizardDialog::addExtensionPages(const QList<QWizardPage *> &wizardPageList)
|
|
|
|
|
{
|
|
|
|
|
foreach (QWizardPage *p,wizardPageList)
|
|
|
|
|
Core::BaseFileWizard::applyExtensionPageShortTitle(this, addPage(p));
|
|
|
|
|
}
|
|
|
|
|
|
2010-04-20 12:56:21 +02:00
|
|
|
void BaseQt4ProjectWizardDialog::generateProfileName(const QString &name, const QString &path)
|
2010-04-19 16:11:21 +02:00
|
|
|
{
|
2012-05-14 18:55:30 +02:00
|
|
|
if (!m_targetSetupPage)
|
|
|
|
|
return;
|
|
|
|
|
|
2012-01-13 14:20:45 +01:00
|
|
|
const QString proFile =
|
|
|
|
|
QDir::cleanPath(path + QLatin1Char('/') + name + QLatin1Char('/')
|
|
|
|
|
+ name + QLatin1String(".pro"));
|
2012-05-14 18:55:30 +02:00
|
|
|
|
2011-02-21 15:30:05 +01:00
|
|
|
m_targetSetupPage->setProFilePath(proFile);
|
2010-04-19 16:11:21 +02:00
|
|
|
}
|