forked from qt-creator/qt-creator
Wizards: refactoring - adding WizardDialogParameters
The Wizards itself (derived from IWizard) and the dialogs implementing the wizards were quite discoupled. Since I want to add parameters that are delivered from IWizard::run to the dialog a I added WizardDialogParameters. Examples of paramters I want to add are the choosen platform and the choosen subOption/template for this wizard. Change-Id: I9c0ae2901e3d46d3c36a3f433f4d7d508a6ba74e Reviewed-by: Alessandro Portale <alessandro.portale@nokia.com>
This commit is contained in:
@@ -437,7 +437,11 @@ void BaseFileWizard::runWizard(const QString &path, QWidget *parent)
|
|||||||
// Create dialog and run it. Ensure that the dialog is deleted when
|
// Create dialog and run it. Ensure that the dialog is deleted when
|
||||||
// leaving the func, but not before the IFileWizardExtension::process
|
// leaving the func, but not before the IFileWizardExtension::process
|
||||||
// has been called
|
// has been called
|
||||||
const QScopedPointer<QWizard> wizard(createWizardDialog(parent, path, allExtensionPages));
|
const QScopedPointer<QWizard> wizard(createWizardDialog(parent,
|
||||||
|
WizardDialogParameters(path,
|
||||||
|
allExtensionPages,
|
||||||
|
QString(),
|
||||||
|
requiredFeatures())));
|
||||||
QTC_ASSERT(!wizard.isNull(), return);
|
QTC_ASSERT(!wizard.isNull(), return);
|
||||||
|
|
||||||
GeneratedFiles files;
|
GeneratedFiles files;
|
||||||
@@ -773,14 +777,13 @@ StandardFileWizard::StandardFileWizard(const BaseFileWizardParameters ¶meter
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
QWizard *StandardFileWizard::createWizardDialog(QWidget *parent,
|
QWizard *StandardFileWizard::createWizardDialog(QWidget *parent,
|
||||||
const QString &defaultPath,
|
const WizardDialogParameters &wizardDialogParameters) const
|
||||||
const WizardPageList &extensionPages) const
|
|
||||||
{
|
{
|
||||||
Utils::FileWizardDialog *standardWizardDialog = new Utils::FileWizardDialog(parent);
|
Utils::FileWizardDialog *standardWizardDialog = new Utils::FileWizardDialog(parent);
|
||||||
standardWizardDialog->setWindowTitle(tr("New %1").arg(displayName()));
|
standardWizardDialog->setWindowTitle(tr("New %1").arg(displayName()));
|
||||||
setupWizard(standardWizardDialog);
|
setupWizard(standardWizardDialog);
|
||||||
standardWizardDialog->setPath(defaultPath);
|
standardWizardDialog->setPath(wizardDialogParameters.defaultPath());
|
||||||
foreach (QWizardPage *p, extensionPages)
|
foreach (QWizardPage *p, wizardDialogParameters.extensionPages())
|
||||||
BaseFileWizard::applyExtensionPageShortTitle(standardWizardDialog, standardWizardDialog->addPage(p));
|
BaseFileWizard::applyExtensionPageShortTitle(standardWizardDialog, standardWizardDialog->addPage(p));
|
||||||
return standardWizardDialog;
|
return standardWizardDialog;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -100,6 +100,37 @@ private:
|
|||||||
|
|
||||||
CORE_EXPORT QDebug operator<<(QDebug d, const BaseFileWizardParameters &);
|
CORE_EXPORT QDebug operator<<(QDebug d, const BaseFileWizardParameters &);
|
||||||
|
|
||||||
|
class CORE_EXPORT WizardDialogParameters
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
typedef QList<QWizardPage *> WizardPageList;
|
||||||
|
|
||||||
|
explicit WizardDialogParameters(const QString &defaultPath, const WizardPageList &extensionPages,
|
||||||
|
const QString &platform, const Core::FeatureSet &requiredFeatures)
|
||||||
|
: m_defaultPath(defaultPath),
|
||||||
|
m_extensionPages(extensionPages),
|
||||||
|
m_selectedPlatform(platform),
|
||||||
|
m_requiredFeatures(requiredFeatures) {}
|
||||||
|
|
||||||
|
QString defaultPath() const
|
||||||
|
{ return m_defaultPath; }
|
||||||
|
|
||||||
|
WizardPageList extensionPages() const
|
||||||
|
{ return m_extensionPages; }
|
||||||
|
|
||||||
|
QString selectedPlatform() const
|
||||||
|
{ return m_selectedPlatform; }
|
||||||
|
|
||||||
|
Core::FeatureSet requiredFeatures() const
|
||||||
|
{ return m_requiredFeatures; }
|
||||||
|
|
||||||
|
private:
|
||||||
|
QString m_defaultPath;
|
||||||
|
WizardPageList m_extensionPages;
|
||||||
|
QString m_selectedPlatform;
|
||||||
|
Core::FeatureSet m_requiredFeatures;
|
||||||
|
};
|
||||||
|
|
||||||
class CORE_EXPORT BaseFileWizard : public IWizard
|
class CORE_EXPORT BaseFileWizard : public IWizard
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
@@ -132,8 +163,8 @@ protected:
|
|||||||
BaseFileWizardParameters baseFileWizardParameters() const;
|
BaseFileWizardParameters baseFileWizardParameters() const;
|
||||||
|
|
||||||
virtual QWizard *createWizardDialog(QWidget *parent,
|
virtual QWizard *createWizardDialog(QWidget *parent,
|
||||||
const QString &defaultPath,
|
const WizardDialogParameters &wizardDialogParameters) const = 0;
|
||||||
const WizardPageList &extensionPages) const = 0;
|
|
||||||
virtual GeneratedFiles generateFiles(const QWizard *w,
|
virtual GeneratedFiles generateFiles(const QWizard *w,
|
||||||
QString *errorMessage) const = 0;
|
QString *errorMessage) const = 0;
|
||||||
|
|
||||||
@@ -158,9 +189,7 @@ class CORE_EXPORT StandardFileWizard : public BaseFileWizard
|
|||||||
|
|
||||||
protected:
|
protected:
|
||||||
explicit StandardFileWizard(const BaseFileWizardParameters ¶meters, QObject *parent = 0);
|
explicit StandardFileWizard(const BaseFileWizardParameters ¶meters, QObject *parent = 0);
|
||||||
virtual QWizard *createWizardDialog(QWidget *parent,
|
virtual QWizard *createWizardDialog(QWidget *parent, const WizardDialogParameters &wizardDialogParameters) const;
|
||||||
const QString &defaultPath,
|
|
||||||
const WizardPageList &extensionPages) const;
|
|
||||||
virtual GeneratedFiles generateFiles(const QWizard *w, QString *errorMessage) const;
|
virtual GeneratedFiles generateFiles(const QWizard *w, QString *errorMessage) const;
|
||||||
virtual GeneratedFiles generateFilesFromPath(const QString &path, const QString &name,
|
virtual GeneratedFiles generateFilesFromPath(const QString &path, const QString &name,
|
||||||
QString *errorMessage) const = 0;
|
QString *errorMessage) const = 0;
|
||||||
|
|||||||
@@ -170,13 +170,12 @@ QString CppClassWizard::headerSuffix() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
QWizard *CppClassWizard::createWizardDialog(QWidget *parent,
|
QWizard *CppClassWizard::createWizardDialog(QWidget *parent,
|
||||||
const QString &defaultPath,
|
const Core::WizardDialogParameters &wizardDialogParameters) const
|
||||||
const WizardPageList &extensionPages) const
|
|
||||||
{
|
{
|
||||||
CppClassWizardDialog *wizard = new CppClassWizardDialog(parent);
|
CppClassWizardDialog *wizard = new CppClassWizardDialog(parent);
|
||||||
foreach (QWizardPage *p, extensionPages)
|
foreach (QWizardPage *p, wizardDialogParameters.extensionPages())
|
||||||
BaseFileWizard::applyExtensionPageShortTitle(wizard, wizard->addPage(p));
|
BaseFileWizard::applyExtensionPageShortTitle(wizard, wizard->addPage(p));
|
||||||
wizard->setPath(defaultPath);
|
wizard->setPath(wizardDialogParameters.defaultPath());
|
||||||
return wizard;
|
return wizard;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -106,8 +106,7 @@ public:
|
|||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual QWizard *createWizardDialog(QWidget *parent,
|
virtual QWizard *createWizardDialog(QWidget *parent,
|
||||||
const QString &defaultPath,
|
const Core::WizardDialogParameters &wizardDialogParameters) const;
|
||||||
const WizardPageList &extensionPages) const;
|
|
||||||
|
|
||||||
|
|
||||||
virtual Core::GeneratedFiles generateFiles(const QWizard *w,
|
virtual Core::GeneratedFiles generateFiles(const QWizard *w,
|
||||||
|
|||||||
@@ -72,12 +72,11 @@ Core::FeatureSet FormClassWizard::requiredFeatures() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
QWizard *FormClassWizard::createWizardDialog(QWidget *parent,
|
QWizard *FormClassWizard::createWizardDialog(QWidget *parent,
|
||||||
const QString &defaultPath,
|
const Core::WizardDialogParameters &wizardDialogParameters) const
|
||||||
const WizardPageList &extensionPages) const
|
|
||||||
{
|
{
|
||||||
FormClassWizardDialog *wizardDialog = new FormClassWizardDialog(extensionPages,
|
FormClassWizardDialog *wizardDialog = new FormClassWizardDialog(wizardDialogParameters.extensionPages(),
|
||||||
parent);
|
parent);
|
||||||
wizardDialog->setPath(defaultPath);
|
wizardDialog->setPath(wizardDialogParameters.defaultPath());
|
||||||
return wizardDialog;
|
return wizardDialog;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -59,8 +59,7 @@ public:
|
|||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual QWizard *createWizardDialog(QWidget *parent,
|
virtual QWizard *createWizardDialog(QWidget *parent,
|
||||||
const QString &defaultPath,
|
const Core::WizardDialogParameters &wizardDialogParameters) const;
|
||||||
const WizardPageList &extensionPages) const;
|
|
||||||
|
|
||||||
virtual Core::GeneratedFiles generateFiles(const QWizard *w,
|
virtual Core::GeneratedFiles generateFiles(const QWizard *w,
|
||||||
QString *errorMessage) const;
|
QString *errorMessage) const;
|
||||||
|
|||||||
@@ -52,11 +52,11 @@ Core::FeatureSet FormWizard::requiredFeatures() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
QWizard *FormWizard::createWizardDialog(QWidget *parent,
|
QWizard *FormWizard::createWizardDialog(QWidget *parent,
|
||||||
const QString &defaultPath,
|
const Core::WizardDialogParameters &wizardDialogParameters) const
|
||||||
const WizardPageList &extensionPages) const
|
|
||||||
{
|
{
|
||||||
FormFileWizardDialog *wizardDialog = new FormFileWizardDialog(extensionPages, parent);
|
FormFileWizardDialog *wizardDialog = new FormFileWizardDialog(wizardDialogParameters.extensionPages(),
|
||||||
wizardDialog->setPath(defaultPath);
|
parent);
|
||||||
|
wizardDialog->setPath(wizardDialogParameters.defaultPath());
|
||||||
return wizardDialog;
|
return wizardDialog;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -51,8 +51,7 @@ public:
|
|||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual QWizard *createWizardDialog(QWidget *parent,
|
virtual QWizard *createWizardDialog(QWidget *parent,
|
||||||
const QString &defaultPath,
|
const Core::WizardDialogParameters &wizardDialogParameters) const;
|
||||||
const WizardPageList &extensionPages) const;
|
|
||||||
|
|
||||||
virtual Core::GeneratedFiles generateFiles(const QWizard *w,
|
virtual Core::GeneratedFiles generateFiles(const QWizard *w,
|
||||||
QString *errorMessage) const;
|
QString *errorMessage) const;
|
||||||
|
|||||||
@@ -142,15 +142,14 @@ Core::BaseFileWizardParameters GenericProjectWizard::parameters()
|
|||||||
}
|
}
|
||||||
|
|
||||||
QWizard *GenericProjectWizard::createWizardDialog(QWidget *parent,
|
QWizard *GenericProjectWizard::createWizardDialog(QWidget *parent,
|
||||||
const QString &defaultPath,
|
const Core::WizardDialogParameters &wizardDialogParameters) const
|
||||||
const WizardPageList &extensionPages) const
|
|
||||||
{
|
{
|
||||||
GenericProjectWizardDialog *wizard = new GenericProjectWizardDialog(parent);
|
GenericProjectWizardDialog *wizard = new GenericProjectWizardDialog(parent);
|
||||||
setupWizard(wizard);
|
setupWizard(wizard);
|
||||||
|
|
||||||
wizard->setPath(defaultPath);
|
wizard->setPath(wizardDialogParameters.defaultPath());
|
||||||
|
|
||||||
foreach (QWizardPage *p, extensionPages)
|
foreach (QWizardPage *p, wizardDialogParameters.extensionPages())
|
||||||
BaseFileWizard::applyExtensionPageShortTitle(wizard, wizard->addPage(p));
|
BaseFileWizard::applyExtensionPageShortTitle(wizard, wizard->addPage(p));
|
||||||
|
|
||||||
return wizard;
|
return wizard;
|
||||||
|
|||||||
@@ -84,8 +84,7 @@ public:
|
|||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual QWizard *createWizardDialog(QWidget *parent,
|
virtual QWizard *createWizardDialog(QWidget *parent,
|
||||||
const QString &defaultPath,
|
const Core::WizardDialogParameters &wizardDialogParameters) const;
|
||||||
const WizardPageList &extensionPages) const;
|
|
||||||
|
|
||||||
virtual Core::GeneratedFiles generateFiles(const QWizard *w,
|
virtual Core::GeneratedFiles generateFiles(const QWizard *w,
|
||||||
QString *errorMessage) const;
|
QString *errorMessage) const;
|
||||||
|
|||||||
@@ -137,14 +137,14 @@ QString GLSLFileWizard::fileContents(const QString &, ShaderType shaderType) con
|
|||||||
return contents;
|
return contents;
|
||||||
}
|
}
|
||||||
|
|
||||||
QWizard *GLSLFileWizard::createWizardDialog(QWidget *parent, const QString &defaultPath,
|
QWizard *GLSLFileWizard::createWizardDialog(QWidget *parent,
|
||||||
const WizardPageList &extensionPages) const
|
const Core::WizardDialogParameters &wizardDialogParameters) const
|
||||||
{
|
{
|
||||||
GLSLFileWizardDialog *wizardDialog = new GLSLFileWizardDialog(parent);
|
GLSLFileWizardDialog *wizardDialog = new GLSLFileWizardDialog(parent);
|
||||||
wizardDialog->setWindowTitle(tr("New %1").arg(displayName()));
|
wizardDialog->setWindowTitle(tr("New %1").arg(displayName()));
|
||||||
setupWizard(wizardDialog);
|
setupWizard(wizardDialog);
|
||||||
wizardDialog->setPath(defaultPath);
|
wizardDialog->setPath(wizardDialogParameters.defaultPath());
|
||||||
foreach (QWizardPage *p, extensionPages)
|
foreach (QWizardPage *p, wizardDialogParameters.extensionPages())
|
||||||
BaseFileWizard::applyExtensionPageShortTitle(wizardDialog, wizardDialog->addPage(p));
|
BaseFileWizard::applyExtensionPageShortTitle(wizardDialog, wizardDialog->addPage(p));
|
||||||
return wizardDialog;
|
return wizardDialog;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -61,8 +61,7 @@ protected:
|
|||||||
QString fileContents(const QString &baseName, ShaderType shaderType) const;
|
QString fileContents(const QString &baseName, ShaderType shaderType) const;
|
||||||
|
|
||||||
virtual QWizard *createWizardDialog(QWidget *parent,
|
virtual QWizard *createWizardDialog(QWidget *parent,
|
||||||
const QString &defaultPath,
|
const Core::WizardDialogParameters &wizardDialogParameters) const;
|
||||||
const WizardPageList &extensionPages) const;
|
|
||||||
|
|
||||||
virtual Core::GeneratedFiles generateFiles(const QWizard *w,
|
virtual Core::GeneratedFiles generateFiles(const QWizard *w,
|
||||||
QString *errorMessage) const;
|
QString *errorMessage) const;
|
||||||
|
|||||||
@@ -65,7 +65,8 @@ BaseProjectWizardDialogPrivate::BaseProjectWizardDialogPrivate(Utils::ProjectInt
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
BaseProjectWizardDialog::BaseProjectWizardDialog(QWidget *parent) :
|
BaseProjectWizardDialog::BaseProjectWizardDialog(QWidget *parent,
|
||||||
|
const Core::WizardDialogParameters & /*parameters*/) :
|
||||||
Utils::Wizard(parent),
|
Utils::Wizard(parent),
|
||||||
d(new BaseProjectWizardDialogPrivate(new Utils::ProjectIntroPage))
|
d(new BaseProjectWizardDialogPrivate(new Utils::ProjectIntroPage))
|
||||||
{
|
{
|
||||||
@@ -74,7 +75,8 @@ BaseProjectWizardDialog::BaseProjectWizardDialog(QWidget *parent) :
|
|||||||
|
|
||||||
BaseProjectWizardDialog::BaseProjectWizardDialog(Utils::ProjectIntroPage *introPage,
|
BaseProjectWizardDialog::BaseProjectWizardDialog(Utils::ProjectIntroPage *introPage,
|
||||||
int introId,
|
int introId,
|
||||||
QWidget *parent) :
|
QWidget *parent,
|
||||||
|
const Core::WizardDialogParameters & /*parameters*/) :
|
||||||
Utils::Wizard(parent),
|
Utils::Wizard(parent),
|
||||||
d(new BaseProjectWizardDialogPrivate(introPage, introId))
|
d(new BaseProjectWizardDialogPrivate(introPage, introId))
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -34,6 +34,7 @@
|
|||||||
#define BASEPROJECTWIZARDDIALOG_H
|
#define BASEPROJECTWIZARDDIALOG_H
|
||||||
|
|
||||||
#include "projectexplorer_export.h"
|
#include "projectexplorer_export.h"
|
||||||
|
#include <coreplugin/basefilewizard.h>
|
||||||
#include <utils/wizard.h>
|
#include <utils/wizard.h>
|
||||||
|
|
||||||
#include <QtGui/QWizard>
|
#include <QtGui/QWizard>
|
||||||
@@ -53,11 +54,11 @@ class PROJECTEXPLORER_EXPORT BaseProjectWizardDialog : public Utils::Wizard
|
|||||||
|
|
||||||
protected:
|
protected:
|
||||||
explicit BaseProjectWizardDialog(Utils::ProjectIntroPage *introPage,
|
explicit BaseProjectWizardDialog(Utils::ProjectIntroPage *introPage,
|
||||||
int introId = -1,
|
int introId,
|
||||||
QWidget *parent = 0);
|
QWidget *parent, const Core::WizardDialogParameters ¶meters);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit BaseProjectWizardDialog(QWidget *parent = 0);
|
explicit BaseProjectWizardDialog(QWidget *parent, const Core::WizardDialogParameters ¶meters);
|
||||||
|
|
||||||
virtual ~BaseProjectWizardDialog();
|
virtual ~BaseProjectWizardDialog();
|
||||||
|
|
||||||
|
|||||||
@@ -155,12 +155,11 @@ void CustomWizard::initWizardDialog(Utils::Wizard *wizard, const QString &defaul
|
|||||||
}
|
}
|
||||||
|
|
||||||
QWizard *CustomWizard::createWizardDialog(QWidget *parent,
|
QWizard *CustomWizard::createWizardDialog(QWidget *parent,
|
||||||
const QString &defaultPath,
|
const Core::WizardDialogParameters &wizardDialogParameters) const
|
||||||
const WizardPageList &extensionPages) const
|
|
||||||
{
|
{
|
||||||
QTC_ASSERT(!d->m_parameters.isNull(), return 0);
|
QTC_ASSERT(!d->m_parameters.isNull(), return 0);
|
||||||
Utils::Wizard *wizard = new Utils::Wizard(parent);
|
Utils::Wizard *wizard = new Utils::Wizard(parent);
|
||||||
initWizardDialog(wizard, defaultPath, extensionPages);
|
initWizardDialog(wizard, wizardDialogParameters.defaultPath(), wizardDialogParameters.extensionPages());
|
||||||
return wizard;
|
return wizard;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -522,13 +521,14 @@ CustomProjectWizard::CustomProjectWizard(const Core::BaseFileWizardParameters& b
|
|||||||
initProjectWizardDialog() needs to be called.
|
initProjectWizardDialog() needs to be called.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
QWizard *CustomProjectWizard::createWizardDialog(QWidget *parent,
|
QWizard *CustomProjectWizard::createWizardDialog(QWidget *parent,
|
||||||
const QString &defaultPath,
|
const Core::WizardDialogParameters &wizardDialogParameters) const
|
||||||
const WizardPageList &extensionPages) const
|
|
||||||
{
|
{
|
||||||
QTC_ASSERT(!parameters().isNull(), return 0);
|
QTC_ASSERT(!parameters().isNull(), return 0);
|
||||||
BaseProjectWizardDialog *projectDialog = new BaseProjectWizardDialog(parent);
|
BaseProjectWizardDialog *projectDialog = new BaseProjectWizardDialog(parent, wizardDialogParameters);
|
||||||
initProjectWizardDialog(projectDialog, defaultPath, extensionPages);
|
initProjectWizardDialog(projectDialog,
|
||||||
|
wizardDialogParameters.defaultPath(),
|
||||||
|
wizardDialogParameters.extensionPages());
|
||||||
return projectDialog;
|
return projectDialog;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -89,8 +89,7 @@ public:
|
|||||||
// Can be reimplemented to create custom wizards. initWizardDialog() needs to be
|
// Can be reimplemented to create custom wizards. initWizardDialog() needs to be
|
||||||
// called.
|
// called.
|
||||||
virtual QWizard *createWizardDialog(QWidget *parent,
|
virtual QWizard *createWizardDialog(QWidget *parent,
|
||||||
const QString &defaultPath,
|
const Core::WizardDialogParameters &wizardDialogParameters) const;
|
||||||
const WizardPageList &extensionPages) const;
|
|
||||||
|
|
||||||
virtual Core::GeneratedFiles generateFiles(const QWizard *w, QString *errorMessage) const;
|
virtual Core::GeneratedFiles generateFiles(const QWizard *w, QString *errorMessage) const;
|
||||||
|
|
||||||
@@ -128,7 +127,8 @@ protected:
|
|||||||
private:
|
private:
|
||||||
void setParameters(const CustomWizardParametersPtr &p);
|
void setParameters(const CustomWizardParametersPtr &p);
|
||||||
|
|
||||||
static CustomWizard *createWizard(const CustomWizardParametersPtr &p, const Core::BaseFileWizardParameters &b);
|
static CustomWizard *createWizard(const CustomWizardParametersPtr &p,
|
||||||
|
const Core::BaseFileWizardParameters &b);
|
||||||
CustomWizardPrivate *d;
|
CustomWizardPrivate *d;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -141,8 +141,7 @@ public:
|
|||||||
QObject *parent = 0);
|
QObject *parent = 0);
|
||||||
|
|
||||||
virtual QWizard *createWizardDialog(QWidget *parent,
|
virtual QWizard *createWizardDialog(QWidget *parent,
|
||||||
const QString &defaultPath,
|
const Core::WizardDialogParameters &wizardDialogParameters) const;
|
||||||
const WizardPageList &extensionPages) const;
|
|
||||||
|
|
||||||
virtual Core::GeneratedFiles generateFiles(const QWizard *w, QString *errorMessage) const;
|
virtual Core::GeneratedFiles generateFiles(const QWizard *w, QString *errorMessage) const;
|
||||||
|
|
||||||
|
|||||||
@@ -134,14 +134,14 @@ QString JsFileWizard::fileContents(const QString &, bool statelessLibrary) const
|
|||||||
return contents;
|
return contents;
|
||||||
}
|
}
|
||||||
|
|
||||||
QWizard *JsFileWizard::createWizardDialog(QWidget *parent, const QString &defaultPath,
|
QWizard *JsFileWizard::createWizardDialog(QWidget *parent,
|
||||||
const WizardPageList &extensionPages) const
|
const Core::WizardDialogParameters &wizardDialogParameters) const
|
||||||
{
|
{
|
||||||
JsFileWizardDialog *wizardDialog = new JsFileWizardDialog(parent);
|
JsFileWizardDialog *wizardDialog = new JsFileWizardDialog(parent);
|
||||||
wizardDialog->setWindowTitle(tr("New %1").arg(displayName()));
|
wizardDialog->setWindowTitle(tr("New %1").arg(displayName()));
|
||||||
setupWizard(wizardDialog);
|
setupWizard(wizardDialog);
|
||||||
wizardDialog->setPath(defaultPath);
|
wizardDialog->setPath(wizardDialogParameters.defaultPath());
|
||||||
foreach (QWizardPage *p, extensionPages)
|
foreach (QWizardPage *p, wizardDialogParameters.extensionPages())
|
||||||
BaseFileWizard::applyExtensionPageShortTitle(wizardDialog, wizardDialog->addPage(p));
|
BaseFileWizard::applyExtensionPageShortTitle(wizardDialog, wizardDialog->addPage(p));
|
||||||
return wizardDialog;
|
return wizardDialog;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -53,8 +53,7 @@ protected:
|
|||||||
QString fileContents(const QString &baseName, bool statelessLibrary) const;
|
QString fileContents(const QString &baseName, bool statelessLibrary) const;
|
||||||
|
|
||||||
virtual QWizard *createWizardDialog(QWidget *parent,
|
virtual QWizard *createWizardDialog(QWidget *parent,
|
||||||
const QString &defaultPath,
|
const Core::WizardDialogParameters &wizardDialogParameters) const;
|
||||||
const WizardPageList &extensionPages) const;
|
|
||||||
|
|
||||||
virtual Core::GeneratedFiles generateFiles(const QWizard *w,
|
virtual Core::GeneratedFiles generateFiles(const QWizard *w,
|
||||||
QString *errorMessage) const;
|
QString *errorMessage) const;
|
||||||
|
|||||||
@@ -50,8 +50,9 @@
|
|||||||
namespace QmlProjectManager {
|
namespace QmlProjectManager {
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
|
||||||
QmlProjectApplicationWizardDialog::QmlProjectApplicationWizardDialog(QWidget *parent) :
|
QmlProjectApplicationWizardDialog::QmlProjectApplicationWizardDialog(QWidget *parent,
|
||||||
ProjectExplorer::BaseProjectWizardDialog(parent)
|
const Core::WizardDialogParameters ¶meters) :
|
||||||
|
ProjectExplorer::BaseProjectWizardDialog(parent, parameters)
|
||||||
{
|
{
|
||||||
setWindowTitle(tr("New Qt Quick UI Project"));
|
setWindowTitle(tr("New Qt Quick UI Project"));
|
||||||
setIntroDescription(tr("This wizard generates a Qt Quick UI project."));
|
setIntroDescription(tr("This wizard generates a Qt Quick UI project."));
|
||||||
@@ -88,15 +89,14 @@ Core::BaseFileWizardParameters QmlProjectApplicationWizard::parameters()
|
|||||||
}
|
}
|
||||||
|
|
||||||
QWizard *QmlProjectApplicationWizard::createWizardDialog(QWidget *parent,
|
QWizard *QmlProjectApplicationWizard::createWizardDialog(QWidget *parent,
|
||||||
const QString &defaultPath,
|
const Core::WizardDialogParameters &wizardDialogParameters) const
|
||||||
const WizardPageList &extensionPages) const
|
|
||||||
{
|
{
|
||||||
QmlProjectApplicationWizardDialog *wizard = new QmlProjectApplicationWizardDialog(parent);
|
QmlProjectApplicationWizardDialog *wizard = new QmlProjectApplicationWizardDialog(parent, wizardDialogParameters);
|
||||||
|
|
||||||
wizard->setPath(defaultPath);
|
wizard->setPath(wizardDialogParameters.defaultPath());
|
||||||
wizard->setProjectName(QmlProjectApplicationWizardDialog::uniqueProjectName(defaultPath));
|
wizard->setProjectName(QmlProjectApplicationWizardDialog::uniqueProjectName(wizardDialogParameters.defaultPath()));
|
||||||
|
|
||||||
foreach (QWizardPage *p, extensionPages)
|
foreach (QWizardPage *p, wizardDialogParameters.extensionPages())
|
||||||
BaseFileWizard::applyExtensionPageShortTitle(wizard, wizard->addPage(p));
|
BaseFileWizard::applyExtensionPageShortTitle(wizard, wizard->addPage(p));
|
||||||
|
|
||||||
return wizard;
|
return wizard;
|
||||||
|
|||||||
@@ -43,7 +43,8 @@ class QmlProjectApplicationWizardDialog : public ProjectExplorer::BaseProjectWiz
|
|||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
explicit QmlProjectApplicationWizardDialog(QWidget *parent = 0);
|
explicit QmlProjectApplicationWizardDialog(QWidget *parent,
|
||||||
|
const Core::WizardDialogParameters ¶meters);
|
||||||
};
|
};
|
||||||
|
|
||||||
class QmlProjectApplicationWizard : public Core::BaseFileWizard
|
class QmlProjectApplicationWizard : public Core::BaseFileWizard
|
||||||
@@ -59,8 +60,7 @@ public:
|
|||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual QWizard *createWizardDialog(QWidget *parent,
|
virtual QWizard *createWizardDialog(QWidget *parent,
|
||||||
const QString &defaultPath,
|
const Core::WizardDialogParameters &wizardDialogParameters) const;
|
||||||
const WizardPageList &extensionPages) const;
|
|
||||||
|
|
||||||
virtual Core::GeneratedFiles generateFiles(const QWizard *w,
|
virtual Core::GeneratedFiles generateFiles(const QWizard *w,
|
||||||
QString *errorMessage) const;
|
QString *errorMessage) const;
|
||||||
|
|||||||
@@ -61,12 +61,14 @@ Core::FeatureSet CustomWidgetWizard::requiredFeatures() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
QWizard *CustomWidgetWizard::createWizardDialog(QWidget *parent,
|
QWizard *CustomWidgetWizard::createWizardDialog(QWidget *parent,
|
||||||
const QString &defaultPath,
|
const Core::WizardDialogParameters &wizardDialogParameters) const
|
||||||
const WizardPageList &extensionPages) const
|
|
||||||
{
|
{
|
||||||
CustomWidgetWizardDialog *rc = new CustomWidgetWizardDialog(displayName(), icon(), extensionPages, parent);
|
CustomWidgetWizardDialog *rc = new CustomWidgetWizardDialog(displayName(),
|
||||||
rc->setPath(defaultPath);
|
icon(),
|
||||||
rc->setProjectName(CustomWidgetWizardDialog::uniqueProjectName(defaultPath));
|
parent,
|
||||||
|
wizardDialogParameters);
|
||||||
|
rc->setPath(wizardDialogParameters.defaultPath());
|
||||||
|
rc->setProjectName(CustomWidgetWizardDialog::uniqueProjectName(wizardDialogParameters.defaultPath()));
|
||||||
rc->setFileNamingParameters(FileNamingParameters(headerSuffix(), sourceSuffix(), QtWizard::lowerCaseFiles()));
|
rc->setFileNamingParameters(FileNamingParameters(headerSuffix(), sourceSuffix(), QtWizard::lowerCaseFiles()));
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -48,8 +48,7 @@ public:
|
|||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual QWizard *createWizardDialog(QWidget *parent,
|
virtual QWizard *createWizardDialog(QWidget *parent,
|
||||||
const QString &defaultPath,
|
const Core::WizardDialogParameters &wizardDialogParameters) const;
|
||||||
const WizardPageList &extensionPages) const;
|
|
||||||
|
|
||||||
virtual Core::GeneratedFiles generateFiles(const QWizard *w,
|
virtual Core::GeneratedFiles generateFiles(const QWizard *w,
|
||||||
QString *errorMessage) const;
|
QString *errorMessage) const;
|
||||||
|
|||||||
@@ -42,9 +42,9 @@ enum { IntroPageId = 0};
|
|||||||
|
|
||||||
CustomWidgetWizardDialog::CustomWidgetWizardDialog(const QString &templateName,
|
CustomWidgetWizardDialog::CustomWidgetWizardDialog(const QString &templateName,
|
||||||
const QIcon &icon,
|
const QIcon &icon,
|
||||||
const QList<QWizardPage*> &extensionPages,
|
QWidget *parent,
|
||||||
QWidget *parent) :
|
const Core::WizardDialogParameters ¶meters) :
|
||||||
BaseQt4ProjectWizardDialog(false, parent),
|
BaseQt4ProjectWizardDialog(false, parent, parameters),
|
||||||
m_widgetsPage(new CustomWidgetWidgetsWizardPage),
|
m_widgetsPage(new CustomWidgetWidgetsWizardPage),
|
||||||
m_pluginPage(new CustomWidgetPluginWizardPage),
|
m_pluginPage(new CustomWidgetPluginWizardPage),
|
||||||
m_widgetPageId(-1), m_pluginPageId(-1)
|
m_widgetPageId(-1), m_pluginPageId(-1)
|
||||||
@@ -61,7 +61,7 @@ CustomWidgetWizardDialog::CustomWidgetWizardDialog(const QString &templateName,
|
|||||||
wizardProgress()->item(m_widgetPageId)->setTitle(tr("Custom Widgets"));
|
wizardProgress()->item(m_widgetPageId)->setTitle(tr("Custom Widgets"));
|
||||||
wizardProgress()->item(m_pluginPageId)->setTitle(tr("Plugin Details"));
|
wizardProgress()->item(m_pluginPageId)->setTitle(tr("Plugin Details"));
|
||||||
|
|
||||||
foreach (QWizardPage *p, extensionPages)
|
foreach (QWizardPage *p, parameters.extensionPages())
|
||||||
Core::BaseFileWizard::applyExtensionPageShortTitle(this, addPage(p));
|
Core::BaseFileWizard::applyExtensionPageShortTitle(this, addPage(p));
|
||||||
connect(this, SIGNAL(currentIdChanged(int)), this, SLOT(slotCurrentIdChanged(int)));
|
connect(this, SIGNAL(currentIdChanged(int)), this, SLOT(slotCurrentIdChanged(int)));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -51,8 +51,8 @@ class CustomWidgetWizardDialog : public BaseQt4ProjectWizardDialog
|
|||||||
public:
|
public:
|
||||||
explicit CustomWidgetWizardDialog(const QString &templateName,
|
explicit CustomWidgetWizardDialog(const QString &templateName,
|
||||||
const QIcon &icon,
|
const QIcon &icon,
|
||||||
const QList<QWizardPage*> &extensionPages,
|
QWidget *parent,
|
||||||
QWidget *parent);
|
const Core::WizardDialogParameters ¶meters);
|
||||||
|
|
||||||
QSharedPointer<PluginOptions> pluginOptions() const;
|
QSharedPointer<PluginOptions> pluginOptions() const;
|
||||||
|
|
||||||
|
|||||||
@@ -51,8 +51,9 @@ namespace Qt4ProjectManager {
|
|||||||
|
|
||||||
AbstractMobileAppWizardDialog::AbstractMobileAppWizardDialog(QWidget *parent,
|
AbstractMobileAppWizardDialog::AbstractMobileAppWizardDialog(QWidget *parent,
|
||||||
const QtSupport::QtVersionNumber &minimumQtVersionNumber,
|
const QtSupport::QtVersionNumber &minimumQtVersionNumber,
|
||||||
const QtSupport::QtVersionNumber &maximumQtVersionNumber)
|
const QtSupport::QtVersionNumber &maximumQtVersionNumber,
|
||||||
: ProjectExplorer::BaseProjectWizardDialog(parent)
|
const Core::WizardDialogParameters ¶meters)
|
||||||
|
: ProjectExplorer::BaseProjectWizardDialog(parent, parameters)
|
||||||
, m_genericOptionsPageId(-1)
|
, m_genericOptionsPageId(-1)
|
||||||
, m_symbianOptionsPageId(-1)
|
, m_symbianOptionsPageId(-1)
|
||||||
, m_maemoOptionsPageId(-1)
|
, m_maemoOptionsPageId(-1)
|
||||||
@@ -227,12 +228,12 @@ AbstractMobileAppWizard::AbstractMobileAppWizard(const Core::BaseFileWizardParam
|
|||||||
}
|
}
|
||||||
|
|
||||||
QWizard *AbstractMobileAppWizard::createWizardDialog(QWidget *parent,
|
QWizard *AbstractMobileAppWizard::createWizardDialog(QWidget *parent,
|
||||||
const QString &defaultPath, const WizardPageList &extensionPages) const
|
const Core::WizardDialogParameters &wizardDialogParameters) const
|
||||||
{
|
{
|
||||||
AbstractMobileAppWizardDialog * const wdlg
|
AbstractMobileAppWizardDialog * const wdlg
|
||||||
= createWizardDialogInternal(parent);
|
= createWizardDialogInternal(parent, wizardDialogParameters);
|
||||||
wdlg->setPath(defaultPath);
|
wdlg->setPath(wizardDialogParameters.defaultPath());
|
||||||
wdlg->setProjectName(ProjectExplorer::BaseProjectWizardDialog::uniqueProjectName(defaultPath));
|
wdlg->setProjectName(ProjectExplorer::BaseProjectWizardDialog::uniqueProjectName(wizardDialogParameters.defaultPath()));
|
||||||
wdlg->m_genericOptionsPage->setOrientation(app()->orientation());
|
wdlg->m_genericOptionsPage->setOrientation(app()->orientation());
|
||||||
wdlg->m_symbianOptionsPage->setSvgIcon(app()->symbianSvgIcon());
|
wdlg->m_symbianOptionsPage->setSvgIcon(app()->symbianSvgIcon());
|
||||||
wdlg->m_symbianOptionsPage->setNetworkEnabled(app()->networkEnabled());
|
wdlg->m_symbianOptionsPage->setNetworkEnabled(app()->networkEnabled());
|
||||||
@@ -241,7 +242,7 @@ QWizard *AbstractMobileAppWizard::createWizardDialog(QWidget *parent,
|
|||||||
wdlg->m_harmattanOptionsPage->setBoosterOptionEnabled(app()->canSupportMeegoBooster());
|
wdlg->m_harmattanOptionsPage->setBoosterOptionEnabled(app()->canSupportMeegoBooster());
|
||||||
connect(wdlg, SIGNAL(projectParametersChanged(QString, QString)),
|
connect(wdlg, SIGNAL(projectParametersChanged(QString, QString)),
|
||||||
SLOT(useProjectPath(QString, QString)));
|
SLOT(useProjectPath(QString, QString)));
|
||||||
foreach (QWizardPage *p, extensionPages)
|
foreach (QWizardPage *p, wizardDialogParameters.extensionPages())
|
||||||
BaseFileWizard::applyExtensionPageShortTitle(wdlg, wdlg->addPage(p));
|
BaseFileWizard::applyExtensionPageShortTitle(wdlg, wdlg->addPage(p));
|
||||||
return wdlg;
|
return wdlg;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -57,7 +57,9 @@ class QT4PROJECTMANAGER_EXPORT AbstractMobileAppWizardDialog : public ProjectExp
|
|||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
explicit AbstractMobileAppWizardDialog(QWidget *parent, const QtSupport::QtVersionNumber &minimumQtVersionNumber, const QtSupport::QtVersionNumber &maximumQtVersionNumber);
|
explicit AbstractMobileAppWizardDialog(QWidget *parent, const QtSupport::QtVersionNumber &minimumQtVersionNumber,
|
||||||
|
const QtSupport::QtVersionNumber &maximumQtVersionNumber,
|
||||||
|
const Core::WizardDialogParameters ¶meters);
|
||||||
void addMobilePages();
|
void addMobilePages();
|
||||||
|
|
||||||
public:
|
public:
|
||||||
@@ -116,7 +118,7 @@ protected:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
virtual QWizard *createWizardDialog(QWidget *parent,
|
virtual QWizard *createWizardDialog(QWidget *parent,
|
||||||
const QString &defaultPath, const WizardPageList &extensionPages) const;
|
const Core::WizardDialogParameters &wizardDialogParameters) const;
|
||||||
virtual Core::GeneratedFiles generateFiles(const QWizard *wizard,
|
virtual Core::GeneratedFiles generateFiles(const QWizard *wizard,
|
||||||
QString *errorMessage) const;
|
QString *errorMessage) const;
|
||||||
virtual bool postGenerateFiles(const QWizard *w,
|
virtual bool postGenerateFiles(const QWizard *w,
|
||||||
@@ -124,7 +126,8 @@ private:
|
|||||||
|
|
||||||
virtual AbstractMobileApp *app() const = 0;
|
virtual AbstractMobileApp *app() const = 0;
|
||||||
virtual AbstractMobileAppWizardDialog *wizardDialog() const = 0;
|
virtual AbstractMobileAppWizardDialog *wizardDialog() const = 0;
|
||||||
virtual AbstractMobileAppWizardDialog *createWizardDialogInternal(QWidget *parent) const = 0;
|
virtual AbstractMobileAppWizardDialog *createWizardDialogInternal(QWidget *parent,
|
||||||
|
const Core::WizardDialogParameters &wizardDialogParameters) const = 0;
|
||||||
virtual void projectPathChanged(const QString &path) const = 0;
|
virtual void projectPathChanged(const QString &path) const = 0;
|
||||||
virtual void prepareGenerateFiles(const QWizard *wizard,
|
virtual void prepareGenerateFiles(const QWizard *wizard,
|
||||||
QString *errorMessage) const = 0;
|
QString *errorMessage) const = 0;
|
||||||
|
|||||||
@@ -68,13 +68,12 @@ ConsoleAppWizard::ConsoleAppWizard()
|
|||||||
}
|
}
|
||||||
|
|
||||||
QWizard *ConsoleAppWizard::createWizardDialog(QWidget *parent,
|
QWizard *ConsoleAppWizard::createWizardDialog(QWidget *parent,
|
||||||
const QString &defaultPath,
|
const Core::WizardDialogParameters &wizardDialogParameters) const
|
||||||
const WizardPageList &extensionPages) const
|
|
||||||
{
|
{
|
||||||
ConsoleAppWizardDialog *dialog = new ConsoleAppWizardDialog(displayName(), icon(), extensionPages,
|
ConsoleAppWizardDialog *dialog = new ConsoleAppWizardDialog(displayName(), icon(),
|
||||||
showModulesPageForApplications(), parent);
|
showModulesPageForApplications(), parent, wizardDialogParameters);
|
||||||
dialog->setPath(defaultPath);
|
dialog->setPath(wizardDialogParameters.defaultPath());
|
||||||
dialog->setProjectName(ConsoleAppWizardDialog::uniqueProjectName(defaultPath));
|
dialog->setProjectName(ConsoleAppWizardDialog::uniqueProjectName(wizardDialogParameters.defaultPath()));
|
||||||
return dialog;
|
return dialog;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -49,8 +49,7 @@ public:
|
|||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual QWizard *createWizardDialog(QWidget *parent,
|
virtual QWizard *createWizardDialog(QWidget *parent,
|
||||||
const QString &defaultPath,
|
const Core::WizardDialogParameters &wizardDialogParameters) const;
|
||||||
const WizardPageList &extensionPages) const;
|
|
||||||
|
|
||||||
virtual Core::GeneratedFiles generateFiles(const QWizard *w,
|
virtual Core::GeneratedFiles generateFiles(const QWizard *w,
|
||||||
QString *errorMessage) const;
|
QString *errorMessage) const;
|
||||||
|
|||||||
@@ -41,10 +41,9 @@ namespace Internal {
|
|||||||
|
|
||||||
ConsoleAppWizardDialog::ConsoleAppWizardDialog(const QString &templateName,
|
ConsoleAppWizardDialog::ConsoleAppWizardDialog(const QString &templateName,
|
||||||
const QIcon &icon,
|
const QIcon &icon,
|
||||||
const QList<QWizardPage*> &extensionPages,
|
|
||||||
bool showModulesPage,
|
bool showModulesPage,
|
||||||
QWidget *parent) :
|
QWidget *parent, const Core::WizardDialogParameters ¶meters) :
|
||||||
BaseQt4ProjectWizardDialog(showModulesPage, parent)
|
BaseQt4ProjectWizardDialog(showModulesPage, parent, parameters)
|
||||||
{
|
{
|
||||||
setWindowIcon(icon);
|
setWindowIcon(icon);
|
||||||
setWindowTitle(templateName);
|
setWindowTitle(templateName);
|
||||||
@@ -58,7 +57,7 @@ ConsoleAppWizardDialog::ConsoleAppWizardDialog(const QString &templateName,
|
|||||||
addModulesPage();
|
addModulesPage();
|
||||||
addTargetSetupPage();
|
addTargetSetupPage();
|
||||||
|
|
||||||
foreach (QWizardPage *p, extensionPages)
|
foreach (QWizardPage *p, parameters.extensionPages())
|
||||||
Core::BaseFileWizard::applyExtensionPageShortTitle(this, addPage(p));
|
Core::BaseFileWizard::applyExtensionPageShortTitle(this, addPage(p));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -46,9 +46,8 @@ class ConsoleAppWizardDialog : public BaseQt4ProjectWizardDialog
|
|||||||
public:
|
public:
|
||||||
explicit ConsoleAppWizardDialog(const QString &templateName,
|
explicit ConsoleAppWizardDialog(const QString &templateName,
|
||||||
const QIcon &icon,
|
const QIcon &icon,
|
||||||
const QList<QWizardPage*> &extensionPages,
|
bool showModulesPage,
|
||||||
bool showModulesPage = false,
|
QWidget *parent, const Core::WizardDialogParameters ¶meters);
|
||||||
QWidget *parent = 0);
|
|
||||||
|
|
||||||
QtProjectParameters parameters() const;
|
QtProjectParameters parameters() const;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -58,12 +58,11 @@ Core::FeatureSet EmptyProjectWizard::requiredFeatures() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
QWizard *EmptyProjectWizard::createWizardDialog(QWidget *parent,
|
QWizard *EmptyProjectWizard::createWizardDialog(QWidget *parent,
|
||||||
const QString &defaultPath,
|
const Core::WizardDialogParameters &wizardDialogParameters) const
|
||||||
const WizardPageList &extensionPages) const
|
|
||||||
{
|
{
|
||||||
EmptyProjectWizardDialog *dialog = new EmptyProjectWizardDialog(displayName(), icon(), extensionPages, parent);
|
EmptyProjectWizardDialog *dialog = new EmptyProjectWizardDialog(displayName(), icon(), parent, wizardDialogParameters);
|
||||||
dialog->setPath(defaultPath);
|
dialog->setPath(wizardDialogParameters.defaultPath());
|
||||||
dialog->setProjectName(EmptyProjectWizardDialog::uniqueProjectName(defaultPath));
|
dialog->setProjectName(EmptyProjectWizardDialog::uniqueProjectName(wizardDialogParameters.defaultPath()));
|
||||||
return dialog;
|
return dialog;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -48,8 +48,7 @@ public:
|
|||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual QWizard *createWizardDialog(QWidget *parent,
|
virtual QWizard *createWizardDialog(QWidget *parent,
|
||||||
const QString &defaultPath,
|
const Core::WizardDialogParameters &wizardDialogParameters) const;
|
||||||
const WizardPageList &extensionPages) const;
|
|
||||||
|
|
||||||
virtual Core::GeneratedFiles generateFiles(const QWizard *w,
|
virtual Core::GeneratedFiles generateFiles(const QWizard *w,
|
||||||
QString *errorMessage) const;
|
QString *errorMessage) const;
|
||||||
|
|||||||
@@ -38,9 +38,8 @@ namespace Internal {
|
|||||||
|
|
||||||
EmptyProjectWizardDialog::EmptyProjectWizardDialog(const QString &templateName,
|
EmptyProjectWizardDialog::EmptyProjectWizardDialog(const QString &templateName,
|
||||||
const QIcon &icon,
|
const QIcon &icon,
|
||||||
const QList<QWizardPage*> &extensionPages,
|
QWidget *parent, const Core::WizardDialogParameters ¶meters) :
|
||||||
QWidget *parent) :
|
BaseQt4ProjectWizardDialog(false, parent, parameters)
|
||||||
BaseQt4ProjectWizardDialog(parent)
|
|
||||||
{
|
{
|
||||||
setWindowIcon(icon);
|
setWindowIcon(icon);
|
||||||
setWindowTitle(templateName);
|
setWindowTitle(templateName);
|
||||||
@@ -50,7 +49,7 @@ EmptyProjectWizardDialog::EmptyProjectWizardDialog(const QString &templateName,
|
|||||||
|
|
||||||
addTargetSetupPage();
|
addTargetSetupPage();
|
||||||
|
|
||||||
foreach (QWizardPage *p, extensionPages)
|
foreach (QWizardPage *p, parameters.extensionPages())
|
||||||
Core::BaseFileWizard::applyExtensionPageShortTitle(this, addPage(p));
|
Core::BaseFileWizard::applyExtensionPageShortTitle(this, addPage(p));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -46,8 +46,8 @@ class EmptyProjectWizardDialog : public BaseQt4ProjectWizardDialog
|
|||||||
public:
|
public:
|
||||||
explicit EmptyProjectWizardDialog(const QString &templateName,
|
explicit EmptyProjectWizardDialog(const QString &templateName,
|
||||||
const QIcon &icon,
|
const QIcon &icon,
|
||||||
const QList<QWizardPage*> &extensionPages,
|
QWidget *parent,
|
||||||
QWidget *parent = 0);
|
const Core::WizardDialogParameters ¶meters);
|
||||||
|
|
||||||
QtProjectParameters parameters() const;
|
QtProjectParameters parameters() const;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -114,15 +114,14 @@ GuiAppWizard::GuiAppWizard(const QString &id,
|
|||||||
}
|
}
|
||||||
|
|
||||||
QWizard *GuiAppWizard::createWizardDialog(QWidget *parent,
|
QWizard *GuiAppWizard::createWizardDialog(QWidget *parent,
|
||||||
const QString &defaultPath,
|
const Core::WizardDialogParameters &wizardDialogParameters) const
|
||||||
const WizardPageList &extensionPages) const
|
|
||||||
{
|
{
|
||||||
GuiAppWizardDialog *dialog = new GuiAppWizardDialog(displayName(), icon(), extensionPages,
|
GuiAppWizardDialog *dialog = new GuiAppWizardDialog(displayName(), icon(),
|
||||||
showModulesPageForApplications(),
|
showModulesPageForApplications(),
|
||||||
m_createMobileProject,
|
m_createMobileProject,
|
||||||
parent);
|
parent, wizardDialogParameters);
|
||||||
dialog->setPath(defaultPath);
|
dialog->setPath(wizardDialogParameters.defaultPath());
|
||||||
dialog->setProjectName(GuiAppWizardDialog::uniqueProjectName(defaultPath));
|
dialog->setProjectName(GuiAppWizardDialog::uniqueProjectName(wizardDialogParameters.defaultPath()));
|
||||||
// Order! suffixes first to generate files correctly
|
// Order! suffixes first to generate files correctly
|
||||||
dialog->setLowerCaseFiles(QtWizard::lowerCaseFiles());
|
dialog->setLowerCaseFiles(QtWizard::lowerCaseFiles());
|
||||||
dialog->setSuffixes(headerSuffix(), sourceSuffix(), formSuffix());
|
dialog->setSuffixes(headerSuffix(), sourceSuffix(), formSuffix());
|
||||||
|
|||||||
@@ -57,8 +57,7 @@ protected:
|
|||||||
const QIcon &icon,
|
const QIcon &icon,
|
||||||
bool createMobile);
|
bool createMobile);
|
||||||
virtual QWizard *createWizardDialog(QWidget *parent,
|
virtual QWizard *createWizardDialog(QWidget *parent,
|
||||||
const QString &defaultPath,
|
const Core::WizardDialogParameters &wizardDialogParameters) const;
|
||||||
const WizardPageList &extensionPages) const;
|
|
||||||
|
|
||||||
virtual Core::GeneratedFiles generateFiles(const QWizard *w,
|
virtual Core::GeneratedFiles generateFiles(const QWizard *w,
|
||||||
QString *errorMessage) const;
|
QString *errorMessage) const;
|
||||||
|
|||||||
@@ -50,11 +50,11 @@ GuiAppParameters::GuiAppParameters()
|
|||||||
|
|
||||||
GuiAppWizardDialog::GuiAppWizardDialog(const QString &templateName,
|
GuiAppWizardDialog::GuiAppWizardDialog(const QString &templateName,
|
||||||
const QIcon &icon,
|
const QIcon &icon,
|
||||||
const QList<QWizardPage*> &extensionPages,
|
|
||||||
bool showModulesPage,
|
bool showModulesPage,
|
||||||
bool isMobile,
|
bool isMobile,
|
||||||
QWidget *parent) :
|
QWidget *parent,
|
||||||
BaseQt4ProjectWizardDialog(showModulesPage, parent),
|
const Core::WizardDialogParameters ¶meters) :
|
||||||
|
BaseQt4ProjectWizardDialog(showModulesPage, parent, parameters),
|
||||||
m_filesPage(new FilesPage)
|
m_filesPage(new FilesPage)
|
||||||
{
|
{
|
||||||
setWindowIcon(icon);
|
setWindowIcon(icon);
|
||||||
@@ -73,7 +73,7 @@ GuiAppWizardDialog::GuiAppWizardDialog(const QString &templateName,
|
|||||||
const int filesPageId = addPage(m_filesPage);
|
const int filesPageId = addPage(m_filesPage);
|
||||||
wizardProgress()->item(filesPageId)->setTitle(tr("Details"));
|
wizardProgress()->item(filesPageId)->setTitle(tr("Details"));
|
||||||
|
|
||||||
foreach (QWizardPage *p, extensionPages)
|
foreach (QWizardPage *p, parameters.extensionPages())
|
||||||
Core::BaseFileWizard::applyExtensionPageShortTitle(this, addPage(p));
|
Core::BaseFileWizard::applyExtensionPageShortTitle(this, addPage(p));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -63,10 +63,10 @@ class GuiAppWizardDialog : public BaseQt4ProjectWizardDialog
|
|||||||
public:
|
public:
|
||||||
explicit GuiAppWizardDialog(const QString &templateName,
|
explicit GuiAppWizardDialog(const QString &templateName,
|
||||||
const QIcon &icon,
|
const QIcon &icon,
|
||||||
const QList<QWizardPage*> &extensionPages,
|
bool showModulesPage,
|
||||||
bool showModulesPage = false,
|
bool mobile,
|
||||||
bool mobile = false,
|
QWidget *parent,
|
||||||
QWidget *parent = 0);
|
const Core::WizardDialogParameters ¶meters);
|
||||||
|
|
||||||
void setBaseClasses(const QStringList &baseClasses);
|
void setBaseClasses(const QStringList &baseClasses);
|
||||||
void setSuffixes(const QString &header, const QString &source, const QString &form);
|
void setSuffixes(const QString &header, const QString &source, const QString &form);
|
||||||
|
|||||||
@@ -53,16 +53,18 @@ class Html5AppWizardDialog : public AbstractMobileAppWizardDialog
|
|||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit Html5AppWizardDialog(QWidget *parent = 0);
|
explicit Html5AppWizardDialog(QWidget *parent, const Core::WizardDialogParameters ¶meters);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
class Html5AppWizardOptionsPage *m_htmlOptionsPage;
|
class Html5AppWizardOptionsPage *m_htmlOptionsPage;
|
||||||
friend class Html5AppWizard;
|
friend class Html5AppWizard;
|
||||||
};
|
};
|
||||||
|
|
||||||
Html5AppWizardDialog::Html5AppWizardDialog(QWidget *parent)
|
Html5AppWizardDialog::Html5AppWizardDialog(QWidget *parent,
|
||||||
: AbstractMobileAppWizardDialog(parent, QtSupport::QtVersionNumber(), QtSupport::QtVersionNumber(4, INT_MAX, INT_MAX))
|
const Core::WizardDialogParameters ¶meters)
|
||||||
, m_htmlOptionsPage(0)
|
: AbstractMobileAppWizardDialog(parent, QtSupport::QtVersionNumber(),
|
||||||
|
QtSupport::QtVersionNumber(4, INT_MAX, INT_MAX), parameters),
|
||||||
|
m_htmlOptionsPage(0)
|
||||||
{
|
{
|
||||||
setWindowTitle(tr("New HTML5 Application"));
|
setWindowTitle(tr("New HTML5 Application"));
|
||||||
setIntroDescription(tr("This wizard generates a HTML5 application project."));
|
setIntroDescription(tr("This wizard generates a HTML5 application project."));
|
||||||
@@ -116,9 +118,10 @@ Core::BaseFileWizardParameters Html5AppWizard::parameters()
|
|||||||
return parameters;
|
return parameters;
|
||||||
}
|
}
|
||||||
|
|
||||||
AbstractMobileAppWizardDialog *Html5AppWizard::createWizardDialogInternal(QWidget *parent) const
|
AbstractMobileAppWizardDialog *Html5AppWizard::createWizardDialogInternal(QWidget *parent,
|
||||||
|
const Core::WizardDialogParameters ¶meters) const
|
||||||
{
|
{
|
||||||
d->wizardDialog = new Html5AppWizardDialog(parent);
|
d->wizardDialog = new Html5AppWizardDialog(parent, parameters);
|
||||||
d->wizardDialog->m_htmlOptionsPage->setTouchOptimizationEndabled(
|
d->wizardDialog->m_htmlOptionsPage->setTouchOptimizationEndabled(
|
||||||
d->app->touchOptimizedNavigationEnabled());
|
d->app->touchOptimizedNavigationEnabled());
|
||||||
return d->wizardDialog;
|
return d->wizardDialog;
|
||||||
|
|||||||
@@ -55,7 +55,8 @@ private:
|
|||||||
|
|
||||||
virtual AbstractMobileApp *app() const;
|
virtual AbstractMobileApp *app() const;
|
||||||
virtual AbstractMobileAppWizardDialog *wizardDialog() const;
|
virtual AbstractMobileAppWizardDialog *wizardDialog() const;
|
||||||
virtual AbstractMobileAppWizardDialog *createWizardDialogInternal(QWidget *parent) const;
|
virtual AbstractMobileAppWizardDialog *createWizardDialogInternal(QWidget *parent,
|
||||||
|
const Core::WizardDialogParameters ¶meters) const;
|
||||||
virtual void projectPathChanged(const QString &path) const;
|
virtual void projectPathChanged(const QString &path) const;
|
||||||
virtual void prepareGenerateFiles(const QWizard *wizard,
|
virtual void prepareGenerateFiles(const QWizard *wizard,
|
||||||
QString *errorMessage) const;
|
QString *errorMessage) const;
|
||||||
|
|||||||
@@ -63,15 +63,16 @@ LibraryWizard::LibraryWizard()
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
QWizard *LibraryWizard::createWizardDialog(QWidget *parent,
|
QWizard *LibraryWizard::createWizardDialog(QWidget *parent, const Core::WizardDialogParameters &wizardDialogParameters) const
|
||||||
const QString &defaultPath,
|
|
||||||
const WizardPageList &extensionPages) const
|
|
||||||
{
|
{
|
||||||
LibraryWizardDialog *dialog = new LibraryWizardDialog(displayName(), icon(), extensionPages,
|
LibraryWizardDialog *dialog = new LibraryWizardDialog(displayName(),
|
||||||
showModulesPageForLibraries(), parent);
|
icon(),
|
||||||
|
showModulesPageForLibraries(),
|
||||||
|
parent,
|
||||||
|
wizardDialogParameters);
|
||||||
dialog->setLowerCaseFiles(QtWizard::lowerCaseFiles());
|
dialog->setLowerCaseFiles(QtWizard::lowerCaseFiles());
|
||||||
dialog->setPath(defaultPath);
|
dialog->setPath(wizardDialogParameters.defaultPath());
|
||||||
dialog->setProjectName(LibraryWizardDialog::uniqueProjectName(defaultPath));
|
dialog->setProjectName(LibraryWizardDialog::uniqueProjectName(wizardDialogParameters.defaultPath()));
|
||||||
dialog->setSuffixes(headerSuffix(), sourceSuffix(), formSuffix());
|
dialog->setSuffixes(headerSuffix(), sourceSuffix(), formSuffix());
|
||||||
return dialog;
|
return dialog;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -51,8 +51,7 @@ public:
|
|||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual QWizard *createWizardDialog(QWidget *parent,
|
virtual QWizard *createWizardDialog(QWidget *parent,
|
||||||
const QString &defaultPath,
|
const Core::WizardDialogParameters &wizardDialogParameters) const;
|
||||||
const WizardPageList &extensionPages) const;
|
|
||||||
|
|
||||||
virtual Core::GeneratedFiles generateFiles(const QWizard *w,
|
virtual Core::GeneratedFiles generateFiles(const QWizard *w,
|
||||||
QString *errorMessage) const;
|
QString *errorMessage) const;
|
||||||
|
|||||||
@@ -136,10 +136,10 @@ QtProjectParameters::Type LibraryIntroPage::type() const
|
|||||||
// ------------------- LibraryWizardDialog
|
// ------------------- LibraryWizardDialog
|
||||||
LibraryWizardDialog::LibraryWizardDialog(const QString &templateName,
|
LibraryWizardDialog::LibraryWizardDialog(const QString &templateName,
|
||||||
const QIcon &icon,
|
const QIcon &icon,
|
||||||
const QList<QWizardPage*> &extensionPages,
|
|
||||||
bool showModulesPage,
|
bool showModulesPage,
|
||||||
QWidget *parent) :
|
QWidget *parent,
|
||||||
BaseQt4ProjectWizardDialog(showModulesPage, new LibraryIntroPage, -1, parent),
|
const Core::WizardDialogParameters ¶meters) :
|
||||||
|
BaseQt4ProjectWizardDialog(showModulesPage, new LibraryIntroPage, -1, parent, parameters),
|
||||||
m_filesPage(new FilesPage),
|
m_filesPage(new FilesPage),
|
||||||
m_mobilePage(new MobileLibraryWizardOptionPage),
|
m_mobilePage(new MobileLibraryWizardOptionPage),
|
||||||
m_pluginBaseClassesInitialized(false),
|
m_pluginBaseClassesInitialized(false),
|
||||||
@@ -193,7 +193,7 @@ LibraryWizardDialog::LibraryWizardDialog(const QString &templateName,
|
|||||||
|
|
||||||
connect(this, SIGNAL(currentIdChanged(int)), this, SLOT(slotCurrentIdChanged(int)));
|
connect(this, SIGNAL(currentIdChanged(int)), this, SLOT(slotCurrentIdChanged(int)));
|
||||||
|
|
||||||
foreach (QWizardPage *p, extensionPages)
|
foreach (QWizardPage *p, parameters.extensionPages())
|
||||||
Core::BaseFileWizard::applyExtensionPageShortTitle(this, addPage(p));
|
Core::BaseFileWizard::applyExtensionPageShortTitle(this, addPage(p));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -53,9 +53,9 @@ class LibraryWizardDialog : public BaseQt4ProjectWizardDialog
|
|||||||
public:
|
public:
|
||||||
LibraryWizardDialog(const QString &templateName,
|
LibraryWizardDialog(const QString &templateName,
|
||||||
const QIcon &icon,
|
const QIcon &icon,
|
||||||
const QList<QWizardPage*> &extensionPages,
|
|
||||||
bool showModulesPage,
|
bool showModulesPage,
|
||||||
QWidget *parent = 0);
|
QWidget *parent,
|
||||||
|
const Core::WizardDialogParameters ¶meters);
|
||||||
|
|
||||||
void setSuffixes(const QString &header, const QString &source, const QString &form= QString());
|
void setSuffixes(const QString &header, const QString &source, const QString &form= QString());
|
||||||
void setLowerCaseFiles(bool);
|
void setLowerCaseFiles(bool);
|
||||||
|
|||||||
@@ -61,8 +61,10 @@ class MobileAppWizardDialog : public AbstractMobileAppWizardDialog
|
|||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
explicit MobileAppWizardDialog(QWidget *parent = 0)
|
explicit MobileAppWizardDialog(QWidget *parent, const Core::WizardDialogParameters ¶meters)
|
||||||
: AbstractMobileAppWizardDialog(parent, QtSupport::QtVersionNumber(), QtSupport::QtVersionNumber(4, INT_MAX, INT_MAX))
|
: AbstractMobileAppWizardDialog(parent,
|
||||||
|
QtSupport::QtVersionNumber(),
|
||||||
|
QtSupport::QtVersionNumber(4, INT_MAX, INT_MAX), parameters)
|
||||||
{
|
{
|
||||||
setWindowTitle(DisplayName);
|
setWindowTitle(DisplayName);
|
||||||
setIntroDescription(Description);
|
setIntroDescription(Description);
|
||||||
@@ -109,9 +111,10 @@ Core::BaseFileWizardParameters MobileAppWizard::parameters()
|
|||||||
return parameters;
|
return parameters;
|
||||||
}
|
}
|
||||||
|
|
||||||
AbstractMobileAppWizardDialog *MobileAppWizard::createWizardDialogInternal(QWidget *parent) const
|
AbstractMobileAppWizardDialog *MobileAppWizard::createWizardDialogInternal(QWidget *parent,
|
||||||
|
const Core::WizardDialogParameters ¶meters) const
|
||||||
{
|
{
|
||||||
d->wizardDialog = new MobileAppWizardDialog(parent);
|
d->wizardDialog = new MobileAppWizardDialog(parent, parameters);
|
||||||
return d->wizardDialog;
|
return d->wizardDialog;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -55,7 +55,8 @@ private:
|
|||||||
|
|
||||||
virtual AbstractMobileApp *app() const;
|
virtual AbstractMobileApp *app() const;
|
||||||
virtual AbstractMobileAppWizardDialog *wizardDialog() const;
|
virtual AbstractMobileAppWizardDialog *wizardDialog() const;
|
||||||
virtual AbstractMobileAppWizardDialog *createWizardDialogInternal(QWidget *parent) const;
|
virtual AbstractMobileAppWizardDialog *createWizardDialogInternal(QWidget *parent,
|
||||||
|
const Core::WizardDialogParameters &wizardDialogParameters) const;
|
||||||
virtual void projectPathChanged(const QString &path) const;
|
virtual void projectPathChanged(const QString &path) const;
|
||||||
virtual void prepareGenerateFiles(const QWizard *wizard,
|
virtual void prepareGenerateFiles(const QWizard *wizard,
|
||||||
QString *errorMessage) const;
|
QString *errorMessage) const;
|
||||||
|
|||||||
@@ -52,7 +52,7 @@ class QtQuickAppWizardDialog : public AbstractMobileAppWizardDialog
|
|||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit QtQuickAppWizardDialog(QWidget *parent = 0);
|
explicit QtQuickAppWizardDialog(QWidget *parent, const Core::WizardDialogParameters ¶meters);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
bool validateCurrentPage();
|
bool validateCurrentPage();
|
||||||
@@ -66,8 +66,11 @@ private:
|
|||||||
friend class QtQuickAppWizard;
|
friend class QtQuickAppWizard;
|
||||||
};
|
};
|
||||||
|
|
||||||
QtQuickAppWizardDialog::QtQuickAppWizardDialog(QWidget *parent)
|
QtQuickAppWizardDialog::QtQuickAppWizardDialog(QWidget *parent,
|
||||||
: AbstractMobileAppWizardDialog(parent, QtSupport::QtVersionNumber(4, 7, 0), QtSupport::QtVersionNumber(4, INT_MAX, INT_MAX))
|
const Core::WizardDialogParameters ¶meters)
|
||||||
|
: AbstractMobileAppWizardDialog(parent,
|
||||||
|
QtSupport::QtVersionNumber(4, 7, 0),
|
||||||
|
QtSupport::QtVersionNumber(4, INT_MAX, INT_MAX), parameters)
|
||||||
{
|
{
|
||||||
setWindowTitle(tr("New Qt Quick Application"));
|
setWindowTitle(tr("New Qt Quick Application"));
|
||||||
setIntroDescription(tr("This wizard generates a Qt Quick application project."));
|
setIntroDescription(tr("This wizard generates a Qt Quick application project."));
|
||||||
@@ -147,9 +150,10 @@ Core::BaseFileWizardParameters QtQuickAppWizard::parameters()
|
|||||||
return parameters;
|
return parameters;
|
||||||
}
|
}
|
||||||
|
|
||||||
AbstractMobileAppWizardDialog *QtQuickAppWizard::createWizardDialogInternal(QWidget *parent) const
|
AbstractMobileAppWizardDialog *QtQuickAppWizard::createWizardDialogInternal(QWidget *parent,
|
||||||
|
const Core::WizardDialogParameters ¶meters) const
|
||||||
{
|
{
|
||||||
d->wizardDialog = new QtQuickAppWizardDialog(parent);
|
d->wizardDialog = new QtQuickAppWizardDialog(parent, parameters);
|
||||||
d->wizardDialog->m_componentOptionsPage->setComponentSet(d->app->componentSet());
|
d->wizardDialog->m_componentOptionsPage->setComponentSet(d->app->componentSet());
|
||||||
return d->wizardDialog;
|
return d->wizardDialog;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -55,7 +55,8 @@ private:
|
|||||||
|
|
||||||
virtual AbstractMobileApp *app() const;
|
virtual AbstractMobileApp *app() const;
|
||||||
virtual AbstractMobileAppWizardDialog *wizardDialog() const;
|
virtual AbstractMobileAppWizardDialog *wizardDialog() const;
|
||||||
virtual AbstractMobileAppWizardDialog *createWizardDialogInternal(QWidget *parent) const;
|
virtual AbstractMobileAppWizardDialog *createWizardDialogInternal(QWidget *parent,
|
||||||
|
const Core::WizardDialogParameters ¶meters) const;
|
||||||
virtual void projectPathChanged(const QString &path) const;
|
virtual void projectPathChanged(const QString &path) const;
|
||||||
virtual void prepareGenerateFiles(const QWizard *wizard,
|
virtual void prepareGenerateFiles(const QWizard *wizard,
|
||||||
QString *errorMessage) const;
|
QString *errorMessage) const;
|
||||||
|
|||||||
@@ -164,12 +164,12 @@ CustomQt4ProjectWizard::CustomQt4ProjectWizard(const Core::BaseFileWizardParamet
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
QWizard *CustomQt4ProjectWizard::createWizardDialog(QWidget *parent,
|
QWizard *CustomQt4ProjectWizard::createWizardDialog(QWidget *parent,
|
||||||
const QString &defaultPath,
|
const Core::WizardDialogParameters &wizardDialogParameters) const
|
||||||
const WizardPageList &extensionPages) const
|
|
||||||
{
|
{
|
||||||
BaseQt4ProjectWizardDialog *wizard = new BaseQt4ProjectWizardDialog(false, parent);
|
BaseQt4ProjectWizardDialog *wizard = new BaseQt4ProjectWizardDialog(false, parent, wizardDialogParameters);
|
||||||
initProjectWizardDialog(wizard, defaultPath, extensionPages);
|
|
||||||
|
initProjectWizardDialog(wizard, wizardDialogParameters.defaultPath(), wizardDialogParameters.extensionPages());
|
||||||
if (wizard->pageIds().contains(targetPageId))
|
if (wizard->pageIds().contains(targetPageId))
|
||||||
qWarning("CustomQt4ProjectWizard: Unable to insert target page at %d", int(targetPageId));
|
qWarning("CustomQt4ProjectWizard: Unable to insert target page at %d", int(targetPageId));
|
||||||
wizard->addTargetSetupPage(QSet<QString>(), false, targetPageId);
|
wizard->addTargetSetupPage(QSet<QString>(), false, targetPageId);
|
||||||
@@ -187,8 +187,9 @@ void CustomQt4ProjectWizard::registerSelf()
|
|||||||
}
|
}
|
||||||
|
|
||||||
// ----------------- BaseQt4ProjectWizardDialog
|
// ----------------- BaseQt4ProjectWizardDialog
|
||||||
BaseQt4ProjectWizardDialog::BaseQt4ProjectWizardDialog(bool showModulesPage, QWidget *parent) :
|
BaseQt4ProjectWizardDialog::BaseQt4ProjectWizardDialog(bool showModulesPage, QWidget *parent,
|
||||||
ProjectExplorer::BaseProjectWizardDialog(parent),
|
const Core::WizardDialogParameters ¶meters) :
|
||||||
|
ProjectExplorer::BaseProjectWizardDialog(parent, parameters),
|
||||||
m_modulesPage(0),
|
m_modulesPage(0),
|
||||||
m_targetSetupPage(0)
|
m_targetSetupPage(0)
|
||||||
{
|
{
|
||||||
@@ -197,8 +198,9 @@ BaseQt4ProjectWizardDialog::BaseQt4ProjectWizardDialog(bool showModulesPage, QWi
|
|||||||
|
|
||||||
BaseQt4ProjectWizardDialog::BaseQt4ProjectWizardDialog(bool showModulesPage,
|
BaseQt4ProjectWizardDialog::BaseQt4ProjectWizardDialog(bool showModulesPage,
|
||||||
Utils::ProjectIntroPage *introPage,
|
Utils::ProjectIntroPage *introPage,
|
||||||
int introId, QWidget *parent) :
|
int introId, QWidget *parent,
|
||||||
ProjectExplorer::BaseProjectWizardDialog(introPage, introId, parent),
|
const Core::WizardDialogParameters ¶meters) :
|
||||||
|
ProjectExplorer::BaseProjectWizardDialog(introPage, introId, parent, parameters),
|
||||||
m_modulesPage(0),
|
m_modulesPage(0),
|
||||||
m_targetSetupPage(0)
|
m_targetSetupPage(0)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -100,8 +100,7 @@ public:
|
|||||||
QObject *parent = 0);
|
QObject *parent = 0);
|
||||||
|
|
||||||
virtual QWizard *createWizardDialog(QWidget *parent,
|
virtual QWizard *createWizardDialog(QWidget *parent,
|
||||||
const QString &defaultPath,
|
const Core::WizardDialogParameters &wizardDialogParameters) const;
|
||||||
const WizardPageList &extensionPages) const;
|
|
||||||
static void registerSelf();
|
static void registerSelf();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
@@ -122,10 +121,12 @@ class BaseQt4ProjectWizardDialog : public ProjectExplorer::BaseProjectWizardDial
|
|||||||
protected:
|
protected:
|
||||||
explicit BaseQt4ProjectWizardDialog(bool showModulesPage,
|
explicit BaseQt4ProjectWizardDialog(bool showModulesPage,
|
||||||
Utils::ProjectIntroPage *introPage,
|
Utils::ProjectIntroPage *introPage,
|
||||||
int introId = -1,
|
int introId,
|
||||||
QWidget *parent = 0);
|
QWidget *parent,
|
||||||
|
const Core::WizardDialogParameters ¶meters);
|
||||||
public:
|
public:
|
||||||
explicit BaseQt4ProjectWizardDialog(bool showModulesPage, QWidget *parent = 0);
|
explicit BaseQt4ProjectWizardDialog(bool showModulesPage, QWidget *parent,
|
||||||
|
const Core::WizardDialogParameters ¶meters);
|
||||||
virtual ~BaseQt4ProjectWizardDialog();
|
virtual ~BaseQt4ProjectWizardDialog();
|
||||||
|
|
||||||
int addModulesPage(int id = -1);
|
int addModulesPage(int id = -1);
|
||||||
|
|||||||
@@ -54,12 +54,11 @@ SubdirsProjectWizard::SubdirsProjectWizard()
|
|||||||
}
|
}
|
||||||
|
|
||||||
QWizard *SubdirsProjectWizard::createWizardDialog(QWidget *parent,
|
QWizard *SubdirsProjectWizard::createWizardDialog(QWidget *parent,
|
||||||
const QString &defaultPath,
|
const Core::WizardDialogParameters &wizardDialogParameters) const
|
||||||
const WizardPageList &extensionPages) const
|
|
||||||
{
|
{
|
||||||
SubdirsProjectWizardDialog *dialog = new SubdirsProjectWizardDialog(displayName(), icon(), extensionPages, parent);
|
SubdirsProjectWizardDialog *dialog = new SubdirsProjectWizardDialog(displayName(), icon(), parent, wizardDialogParameters);
|
||||||
dialog->setPath(defaultPath);
|
dialog->setPath(wizardDialogParameters.defaultPath());
|
||||||
dialog->setProjectName(SubdirsProjectWizardDialog::uniqueProjectName(defaultPath));
|
dialog->setProjectName(SubdirsProjectWizardDialog::uniqueProjectName(wizardDialogParameters.defaultPath()));
|
||||||
const QString buttonText = dialog->wizardStyle() == QWizard::MacStyle
|
const QString buttonText = dialog->wizardStyle() == QWizard::MacStyle
|
||||||
? tr("Done && Add Subproject") : tr("Finish && Add Subproject");
|
? tr("Done && Add Subproject") : tr("Finish && Add Subproject");
|
||||||
dialog->setButtonText(QWizard::FinishButton, buttonText);
|
dialog->setButtonText(QWizard::FinishButton, buttonText);
|
||||||
|
|||||||
@@ -47,8 +47,7 @@ public:
|
|||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual QWizard *createWizardDialog(QWidget *parent,
|
virtual QWizard *createWizardDialog(QWidget *parent,
|
||||||
const QString &defaultPath,
|
const Core::WizardDialogParameters &wizardDialogParameters) const;
|
||||||
const WizardPageList &extensionPages) const;
|
|
||||||
|
|
||||||
virtual Core::GeneratedFiles generateFiles(const QWizard *w,
|
virtual Core::GeneratedFiles generateFiles(const QWizard *w,
|
||||||
QString *errorMessage) const;
|
QString *errorMessage) const;
|
||||||
|
|||||||
@@ -38,9 +38,9 @@ namespace Internal {
|
|||||||
|
|
||||||
SubdirsProjectWizardDialog::SubdirsProjectWizardDialog(const QString &templateName,
|
SubdirsProjectWizardDialog::SubdirsProjectWizardDialog(const QString &templateName,
|
||||||
const QIcon &icon,
|
const QIcon &icon,
|
||||||
const QList<QWizardPage*> &extensionPages,
|
QWidget *parent,
|
||||||
QWidget *parent) :
|
const Core::WizardDialogParameters ¶meters) :
|
||||||
BaseQt4ProjectWizardDialog(parent)
|
BaseQt4ProjectWizardDialog(false, parent, parameters)
|
||||||
{
|
{
|
||||||
setWindowIcon(icon);
|
setWindowIcon(icon);
|
||||||
setWindowTitle(templateName);
|
setWindowTitle(templateName);
|
||||||
@@ -50,7 +50,7 @@ SubdirsProjectWizardDialog::SubdirsProjectWizardDialog(const QString &templateNa
|
|||||||
|
|
||||||
addTargetSetupPage();
|
addTargetSetupPage();
|
||||||
|
|
||||||
foreach (QWizardPage *p, extensionPages)
|
foreach (QWizardPage *p, parameters.extensionPages())
|
||||||
Core::BaseFileWizard::applyExtensionPageShortTitle(this, addPage(p));
|
Core::BaseFileWizard::applyExtensionPageShortTitle(this, addPage(p));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -46,8 +46,8 @@ class SubdirsProjectWizardDialog : public BaseQt4ProjectWizardDialog
|
|||||||
public:
|
public:
|
||||||
explicit SubdirsProjectWizardDialog(const QString &templateName,
|
explicit SubdirsProjectWizardDialog(const QString &templateName,
|
||||||
const QIcon &icon,
|
const QIcon &icon,
|
||||||
const QList<QWizardPage*> &extensionPages,
|
QWidget *parent,
|
||||||
QWidget *parent = 0);
|
const Core::WizardDialogParameters ¶meters);
|
||||||
|
|
||||||
QtProjectParameters parameters() const;
|
QtProjectParameters parameters() const;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -60,12 +60,11 @@ TestWizard::TestWizard() :
|
|||||||
}
|
}
|
||||||
|
|
||||||
QWizard *TestWizard::createWizardDialog(QWidget *parent,
|
QWizard *TestWizard::createWizardDialog(QWidget *parent,
|
||||||
const QString &defaultPath,
|
const Core::WizardDialogParameters &wizardDialogParameters) const
|
||||||
const WizardPageList &extensionPages) const
|
|
||||||
{
|
{
|
||||||
TestWizardDialog *dialog = new TestWizardDialog(displayName(), icon(), extensionPages, parent);
|
TestWizardDialog *dialog = new TestWizardDialog(displayName(), icon(), parent, wizardDialogParameters);
|
||||||
dialog->setPath(defaultPath);
|
dialog->setPath(wizardDialogParameters.defaultPath());
|
||||||
dialog->setProjectName(TestWizardDialog::uniqueProjectName(defaultPath));
|
dialog->setProjectName(TestWizardDialog::uniqueProjectName(wizardDialogParameters.defaultPath()));
|
||||||
return dialog;
|
return dialog;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -48,8 +48,7 @@ public:
|
|||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual QWizard *createWizardDialog(QWidget *parent,
|
virtual QWizard *createWizardDialog(QWidget *parent,
|
||||||
const QString &defaultPath,
|
const Core::WizardDialogParameters &wizardDialogParameters) const;
|
||||||
const WizardPageList &extensionPages) const;
|
|
||||||
|
|
||||||
virtual Core::GeneratedFiles generateFiles(const QWizard *w,
|
virtual Core::GeneratedFiles generateFiles(const QWizard *w,
|
||||||
QString *errorMessage) const;
|
QString *errorMessage) const;
|
||||||
|
|||||||
@@ -52,9 +52,9 @@ TestWizardParameters::TestWizardParameters() :
|
|||||||
|
|
||||||
TestWizardDialog::TestWizardDialog(const QString &templateName,
|
TestWizardDialog::TestWizardDialog(const QString &templateName,
|
||||||
const QIcon &icon,
|
const QIcon &icon,
|
||||||
const QList<QWizardPage*> &extensionPages,
|
QWidget *parent,
|
||||||
QWidget *parent) :
|
const Core::WizardDialogParameters ¶meters) :
|
||||||
BaseQt4ProjectWizardDialog(true, parent),
|
BaseQt4ProjectWizardDialog(true, parent, parameters),
|
||||||
m_testPage(new TestWizardPage),
|
m_testPage(new TestWizardPage),
|
||||||
m_testPageId(-1), m_modulesPageId(-1)
|
m_testPageId(-1), m_modulesPageId(-1)
|
||||||
{
|
{
|
||||||
@@ -67,7 +67,7 @@ TestWizardDialog::TestWizardDialog(const QString &templateName,
|
|||||||
m_modulesPageId = addModulesPage();
|
m_modulesPageId = addModulesPage();
|
||||||
m_testPageId = addPage(m_testPage);
|
m_testPageId = addPage(m_testPage);
|
||||||
wizardProgress()->item(m_testPageId)->setTitle(tr("Details"));
|
wizardProgress()->item(m_testPageId)->setTitle(tr("Details"));
|
||||||
foreach (QWizardPage *p, extensionPages)
|
foreach (QWizardPage *p, parameters.extensionPages())
|
||||||
Core::BaseFileWizard::applyExtensionPageShortTitle(this, addPage(p));
|
Core::BaseFileWizard::applyExtensionPageShortTitle(this, addPage(p));
|
||||||
connect(this, SIGNAL(currentIdChanged(int)), this, SLOT(slotCurrentIdChanged(int)));
|
connect(this, SIGNAL(currentIdChanged(int)), this, SLOT(slotCurrentIdChanged(int)));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -67,8 +67,8 @@ class TestWizardDialog : public BaseQt4ProjectWizardDialog
|
|||||||
public:
|
public:
|
||||||
explicit TestWizardDialog(const QString &templateName,
|
explicit TestWizardDialog(const QString &templateName,
|
||||||
const QIcon &icon,
|
const QIcon &icon,
|
||||||
const QList<QWizardPage*> &extensionPages,
|
QWidget *parent,
|
||||||
QWidget *parent = 0);
|
const Core::WizardDialogParameters ¶meters);
|
||||||
|
|
||||||
TestWizardParameters testParameters() const;
|
TestWizardParameters testParameters() const;
|
||||||
QtProjectParameters projectParameters() const;
|
QtProjectParameters projectParameters() const;
|
||||||
|
|||||||
Reference in New Issue
Block a user