forked from qt-creator/qt-creator
Introduce BaseFileWizard
Introduce BaseFileWizard and derive all File Wizards from that. Change BaseFileWizardFactory::create(...) to return a BaseFileWizard. Change-Id: Ic0cb9e9d0390045dab57cd1a75a0f839c1f90216 Reviewed-by: Orgad Shaneh <orgads@gmail.com>
This commit is contained in:
@@ -31,7 +31,8 @@
|
||||
|
||||
#include <qmljstools/qmljstoolsconstants.h>
|
||||
|
||||
#include <utils/filewizarddialog.h>
|
||||
#include <coreplugin/basefilewizard.h>
|
||||
|
||||
#include <utils/qtcassert.h>
|
||||
|
||||
#include <QFileInfo>
|
||||
@@ -71,13 +72,13 @@ private:
|
||||
QCheckBox *m_statelessLibrary;
|
||||
};
|
||||
|
||||
class JsFileWizardDialog : public Utils::FileWizardDialog
|
||||
class JsFileWizardDialog : public Core::BaseFileWizard
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
JsFileWizardDialog(QWidget *parent = 0)
|
||||
: Utils::FileWizardDialog(parent)
|
||||
, m_optionsPage(new JsFileOptionsPage)
|
||||
JsFileWizardDialog(QWidget *parent = 0) :
|
||||
Core::BaseFileWizard(parent),
|
||||
m_optionsPage(new JsFileOptionsPage)
|
||||
{
|
||||
addPage(m_optionsPage);
|
||||
}
|
||||
@@ -122,7 +123,7 @@ QString JsFileWizard::fileContents(const QString &, bool statelessLibrary) const
|
||||
return contents;
|
||||
}
|
||||
|
||||
QWizard *JsFileWizard::create(QWidget *parent, const Core::WizardDialogParameters ¶meters) const
|
||||
Core::BaseFileWizard *JsFileWizard::create(QWidget *parent, const Core::WizardDialogParameters ¶meters) const
|
||||
{
|
||||
JsFileWizardDialog *wizardDialog = new JsFileWizardDialog(parent);
|
||||
wizardDialog->setWindowTitle(tr("New %1").arg(displayName()));
|
||||
|
||||
@@ -44,7 +44,7 @@ public:
|
||||
private:
|
||||
QString fileContents(const QString &baseName, bool statelessLibrary) const;
|
||||
|
||||
QWizard *create(QWidget *parent, const Core::WizardDialogParameters ¶meters) const;
|
||||
Core::BaseFileWizard *create(QWidget *parent, const Core::WizardDialogParameters ¶meters) const;
|
||||
|
||||
Core::GeneratedFiles generateFiles(const QWizard *w, QString *errorMessage) const;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user