diff --git a/src/plugins/projectexplorer/projectexplorer.cpp b/src/plugins/projectexplorer/projectexplorer.cpp index 8e70440bd9edc878e670287ffde568a560c6a11b..e9e0a77e436a1c53767470c5bdd1d0b1debb568e 100644 --- a/src/plugins/projectexplorer/projectexplorer.cpp +++ b/src/plugins/projectexplorer/projectexplorer.cpp @@ -2106,7 +2106,7 @@ void ProjectExplorerPlugin::addNewSubproject() if (d->m_currentNode->nodeType() == ProjectNodeType && d->m_currentNode->projectNode()->supportedActions( d->m_currentNode->projectNode()).contains(ProjectNode::AddSubProject)) { - Core::ICore::instance()->showNewItemDialog(tr("New Project", "Title of dialog"), + Core::ICore::instance()->showNewItemDialog(tr("New Subproject", "Title of dialog"), Core::IWizard::wizardsOfKind(Core::IWizard::ProjectWizard), location); } diff --git a/src/plugins/qt4projectmanager/qt4projectmanager.pro b/src/plugins/qt4projectmanager/qt4projectmanager.pro index d0a823d5a97253546f83c254d0dacc7157a23d03..564d471da7888064dd606a9ac9b959540a2e21b1 100644 --- a/src/plugins/qt4projectmanager/qt4projectmanager.pro +++ b/src/plugins/qt4projectmanager/qt4projectmanager.pro @@ -41,6 +41,8 @@ HEADERS += qt4deployconfiguration.h \ wizards/abstractmobileapp.h \ wizards/qmlstandaloneapp.h \ wizards/abstractmobileappwizard.h \ + wizards/subdirsprojectwizard.h \ + wizards/subdirsprojectwizarddialog.h \ qt4projectmanagerconstants.h \ makestep.h \ qmakestep.h \ @@ -103,6 +105,8 @@ SOURCES += qt4projectmanagerplugin.cpp \ wizards/abstractmobileapp.cpp \ wizards/qmlstandaloneapp.cpp \ wizards/abstractmobileappwizard.cpp \ + wizards/subdirsprojectwizard.cpp \ + wizards/subdirsprojectwizarddialog.cpp \ makestep.cpp \ qmakestep.cpp \ qt4runconfiguration.cpp \ diff --git a/src/plugins/qt4projectmanager/qt4projectmanagerplugin.cpp b/src/plugins/qt4projectmanager/qt4projectmanagerplugin.cpp index fd670e6a4648c2668d083a278aa112032fc1c75b..e740616953e12f54b4a96eed8986de54e16c860f 100644 --- a/src/plugins/qt4projectmanager/qt4projectmanagerplugin.cpp +++ b/src/plugins/qt4projectmanager/qt4projectmanagerplugin.cpp @@ -38,6 +38,7 @@ #include "wizards/librarywizard.h" #include "wizards/testwizard.h" #include "wizards/emptyprojectwizard.h" +#include "wizards/subdirsprojectwizard.h" #include "wizards/qmlstandaloneappwizard.h" #include "customwidgetwizard/customwidgetwizard.h" #include "profileeditorfactory.h" @@ -132,20 +133,12 @@ bool Qt4ProjectManagerPlugin::initialize(const QStringList &arguments, QString * addObject(m_proFileEditorFactory); addAutoReleasedObject(new EmptyProjectWizard); - - GuiAppWizard *guiWizard = new GuiAppWizard; - addAutoReleasedObject(guiWizard); - - ConsoleAppWizard *consoleWizard = new ConsoleAppWizard; - addAutoReleasedObject(consoleWizard); - - MobileAppWizard *mobileWizard = new MobileAppWizard; - addAutoReleasedObject(mobileWizard); - + addAutoReleasedObject(new SubdirsProjectWizard); + addAutoReleasedObject(new GuiAppWizard); + addAutoReleasedObject(new ConsoleAppWizard); + addAutoReleasedObject(new MobileAppWizard); addAutoReleasedObject(new QmlStandaloneAppWizard()); - - LibraryWizard *libWizard = new LibraryWizard; - addAutoReleasedObject(libWizard); + addAutoReleasedObject(new LibraryWizard); addAutoReleasedObject(new TestWizard); addAutoReleasedObject(new CustomWidgetWizard); diff --git a/src/plugins/qt4projectmanager/qt4projectmanagerplugin.h b/src/plugins/qt4projectmanager/qt4projectmanagerplugin.h index a74a978ae3c87657ad5c644d7c0246978e6c5861..c6f9f992c6d1cc3b935c3321c45cde179d448fbd 100644 --- a/src/plugins/qt4projectmanager/qt4projectmanagerplugin.h +++ b/src/plugins/qt4projectmanager/qt4projectmanagerplugin.h @@ -50,12 +50,6 @@ class QtVersionManager; namespace Internal { class ProFileEditorFactory; -class ConsoleAppWizard; -class GuiAppWizard; -class EmptyProjectWizard; -class QMakeStepFactory; -class MakeStepFactory; -class EmbeddedPropertiesPage; class GettingStartedWelcomePage; class Qt4ProjectManagerPlugin : public ExtensionSystem::IPlugin diff --git a/src/plugins/qt4projectmanager/wizards/subdirsprojectwizard.cpp b/src/plugins/qt4projectmanager/wizards/subdirsprojectwizard.cpp new file mode 100644 index 0000000000000000000000000000000000000000..f9f0f76971d8230b5dc88ea14c076390b41c6e3f --- /dev/null +++ b/src/plugins/qt4projectmanager/wizards/subdirsprojectwizard.cpp @@ -0,0 +1,95 @@ +/************************************************************************** +** +** This file is part of Qt Creator +** +** Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +** +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** Commercial Usage +** +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** +** Alternatively, 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. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at http://qt.nokia.com/contact. +** +**************************************************************************/ + +#include "subdirsprojectwizard.h" + +#include "subdirsprojectwizarddialog.h" + +#include <projectexplorer/projectexplorerconstants.h> +#include <coreplugin/icore.h> + +#include <QtGui/QIcon> + +namespace Qt4ProjectManager { +namespace Internal { + +SubdirsProjectWizard::SubdirsProjectWizard() + : QtWizard(QLatin1String("U.Qt4Subdirs"), + QLatin1String(ProjectExplorer::Constants::PROJECT_WIZARD_CATEGORY), + QLatin1String(ProjectExplorer::Constants::PROJECT_WIZARD_TR_SCOPE), + QLatin1String(ProjectExplorer::Constants::PROJECT_WIZARD_TR_CATEGORY), + tr("Subdirs Project"), + tr("Creates a qmake-based subdirs project. This allows you to group " + "your projects in a tree structure."), + QIcon(QLatin1String(":/wizards/images/gui.png"))) +{ +} + +QWizard *SubdirsProjectWizard::createWizardDialog(QWidget *parent, + const QString &defaultPath, + const WizardPageList &extensionPages) const +{ + SubdirsProjectWizardDialog *dialog = new SubdirsProjectWizardDialog(displayName(), icon(), extensionPages, parent); + dialog->setPath(defaultPath); + dialog->setProjectName(SubdirsProjectWizardDialog::uniqueProjectName(defaultPath)); + const QString buttonText = dialog->wizardStyle() == QWizard::MacStyle + ? tr("Done && Add Subproject") : tr("Finish && Add Subproject"); + dialog->setButtonText(QWizard::FinishButton, buttonText); + return dialog; +} + +Core::GeneratedFiles SubdirsProjectWizard::generateFiles(const QWizard *w, + QString * /*errorMessage*/) const +{ + const SubdirsProjectWizardDialog *wizard = qobject_cast< const SubdirsProjectWizardDialog *>(w); + const QtProjectParameters params = wizard->parameters(); + const QString projectPath = params.projectPath(); + const QString profileName = Core::BaseFileWizard::buildFileName(projectPath, params.fileName, profileSuffix()); + + Core::GeneratedFile profile(profileName); + profile.setAttributes(Core::GeneratedFile::OpenProjectAttribute | Core::GeneratedFile::OpenEditorAttribute); + profile.setContents(QLatin1String("TEMPLATE = subdirs\n")); + return Core::GeneratedFiles() << profile; +} + +bool SubdirsProjectWizard::postGenerateFiles(const QWizard *w, const Core::GeneratedFiles &files, QString *errorMessage) +{ + const SubdirsProjectWizardDialog *wizard = qobject_cast< const SubdirsProjectWizardDialog *>(w); + if (QtWizard::qt4ProjectPostGenerateFiles(wizard, files, errorMessage)) { + Core::ICore::instance()->showNewItemDialog(tr("New Subproject", "Title of dialog"), + Core::IWizard::wizardsOfKind(Core::IWizard::ProjectWizard), + wizard->parameters().projectPath()); + } else { + return false; + } + return true; +} + +} // namespace Internal +} // namespace Qt4ProjectManager diff --git a/src/plugins/qt4projectmanager/wizards/subdirsprojectwizard.h b/src/plugins/qt4projectmanager/wizards/subdirsprojectwizard.h new file mode 100644 index 0000000000000000000000000000000000000000..74c3fda4dfd44c38f1f6a6937dcb51d6989892f2 --- /dev/null +++ b/src/plugins/qt4projectmanager/wizards/subdirsprojectwizard.h @@ -0,0 +1,58 @@ +/************************************************************************** +** +** This file is part of Qt Creator +** +** Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +** +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** Commercial Usage +** +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** +** Alternatively, 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. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at http://qt.nokia.com/contact. +** +**************************************************************************/ + +#ifndef SUBDIRSPROJECTWIZARD_H +#define SUBDIRSPROJECTWIZARD_H + +#include "qtwizard.h" + +namespace Qt4ProjectManager { +namespace Internal { + +class SubdirsProjectWizard : public QtWizard +{ + Q_OBJECT + +public: + SubdirsProjectWizard(); + +protected: + virtual QWizard *createWizardDialog(QWidget *parent, + const QString &defaultPath, + const WizardPageList &extensionPages) const; + + virtual Core::GeneratedFiles generateFiles(const QWizard *w, + QString *errorMessage) const; + virtual bool postGenerateFiles(const QWizard *, const Core::GeneratedFiles &l, QString *errorMessage); +}; + +} // namespace Internal +} // namespace Qt4ProjectManager + +#endif // SUBDIRSPROJECTWIZARD_H diff --git a/src/plugins/qt4projectmanager/wizards/subdirsprojectwizarddialog.cpp b/src/plugins/qt4projectmanager/wizards/subdirsprojectwizarddialog.cpp new file mode 100644 index 0000000000000000000000000000000000000000..d11350cf110569eb066ed32d207925292a778ba8 --- /dev/null +++ b/src/plugins/qt4projectmanager/wizards/subdirsprojectwizarddialog.cpp @@ -0,0 +1,64 @@ +/************************************************************************** +** +** This file is part of Qt Creator +** +** Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +** +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** Commercial Usage +** +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** +** Alternatively, 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. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at http://qt.nokia.com/contact. +** +**************************************************************************/ + +#include "subdirsprojectwizarddialog.h" +#include "qtprojectparameters.h" + +namespace Qt4ProjectManager { +namespace Internal { + +SubdirsProjectWizardDialog::SubdirsProjectWizardDialog(const QString &templateName, + const QIcon &icon, + const QList<QWizardPage*> &extensionPages, + QWidget *parent) : + BaseQt4ProjectWizardDialog(parent) +{ + setWindowIcon(icon); + setWindowTitle(templateName); + + setIntroDescription(tr("This wizard generates Qt4 subdirs project. " + "Add subprojects to it later on by using the other wizards.")); + + addTargetSetupPage(); + + foreach (QWizardPage *p, extensionPages) + Core::BaseFileWizard::applyExtensionPageShortTitle(this, addPage(p)); +} + +QtProjectParameters SubdirsProjectWizardDialog::parameters() const +{ + QtProjectParameters rc; + rc.type = QtProjectParameters::EmptyProject; + rc.fileName = projectName(); + rc.path = path(); + return rc; +} + +} // namespace Internal +} // namespace Qt4ProjectManager diff --git a/src/plugins/qt4projectmanager/wizards/subdirsprojectwizarddialog.h b/src/plugins/qt4projectmanager/wizards/subdirsprojectwizarddialog.h new file mode 100644 index 0000000000000000000000000000000000000000..d5a51e01b94bf32920c0e865ebcc660aae3ae0ef --- /dev/null +++ b/src/plugins/qt4projectmanager/wizards/subdirsprojectwizarddialog.h @@ -0,0 +1,55 @@ +/************************************************************************** +** +** This file is part of Qt Creator +** +** Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +** +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** Commercial Usage +** +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** +** Alternatively, 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. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at http://qt.nokia.com/contact. +** +**************************************************************************/ + +#ifndef SUBDIRSPROJECTWIZARDDIALOG_H +#define SUBDIRSPROJECTWIZARDDIALOG_H + +#include "qtwizard.h" + +namespace Qt4ProjectManager { +namespace Internal { + +struct QtProjectParameters; + +class SubdirsProjectWizardDialog : public BaseQt4ProjectWizardDialog +{ + Q_OBJECT +public: + explicit SubdirsProjectWizardDialog(const QString &templateName, + const QIcon &icon, + const QList<QWizardPage*> &extensionPages, + QWidget *parent = 0); + + QtProjectParameters parameters() const; +}; + +} // namespace Internal +} // namespace Qt4ProjectManager + +#endif // SUBDIRSPROJECTWIZARDDIALOG_H diff --git a/src/plugins/qt4projectmanager/wizards/targetsetuppage.cpp b/src/plugins/qt4projectmanager/wizards/targetsetuppage.cpp index 601472054e588d552f471581541fe824b0aec063..979c7f88a8e2b3d49876927945ba8739f5b86166 100644 --- a/src/plugins/qt4projectmanager/wizards/targetsetuppage.cpp +++ b/src/plugins/qt4projectmanager/wizards/targetsetuppage.cpp @@ -84,6 +84,8 @@ TargetSetupPage::TargetSetupPage(QWidget *parent) : this, SLOT(handleDoubleClicks(QTreeWidgetItem*,int))); connect(m_ui->versionTree, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(contextMenuRequested(QPoint))); + + setTitle(tr("Qt Versions")); } void TargetSetupPage::initializePage()