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:
@@ -50,8 +50,9 @@
|
||||
namespace QmlProjectManager {
|
||||
namespace Internal {
|
||||
|
||||
QmlProjectApplicationWizardDialog::QmlProjectApplicationWizardDialog(QWidget *parent) :
|
||||
ProjectExplorer::BaseProjectWizardDialog(parent)
|
||||
QmlProjectApplicationWizardDialog::QmlProjectApplicationWizardDialog(QWidget *parent,
|
||||
const Core::WizardDialogParameters ¶meters) :
|
||||
ProjectExplorer::BaseProjectWizardDialog(parent, parameters)
|
||||
{
|
||||
setWindowTitle(tr("New 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,
|
||||
const QString &defaultPath,
|
||||
const WizardPageList &extensionPages) const
|
||||
const Core::WizardDialogParameters &wizardDialogParameters) const
|
||||
{
|
||||
QmlProjectApplicationWizardDialog *wizard = new QmlProjectApplicationWizardDialog(parent);
|
||||
QmlProjectApplicationWizardDialog *wizard = new QmlProjectApplicationWizardDialog(parent, wizardDialogParameters);
|
||||
|
||||
wizard->setPath(defaultPath);
|
||||
wizard->setProjectName(QmlProjectApplicationWizardDialog::uniqueProjectName(defaultPath));
|
||||
wizard->setPath(wizardDialogParameters.defaultPath());
|
||||
wizard->setProjectName(QmlProjectApplicationWizardDialog::uniqueProjectName(wizardDialogParameters.defaultPath()));
|
||||
|
||||
foreach (QWizardPage *p, extensionPages)
|
||||
foreach (QWizardPage *p, wizardDialogParameters.extensionPages())
|
||||
BaseFileWizard::applyExtensionPageShortTitle(wizard, wizard->addPage(p));
|
||||
|
||||
return wizard;
|
||||
|
||||
Reference in New Issue
Block a user