forked from qt-creator/qt-creator
Wizards: Simplify code a bit
Change-Id: Iedcb36af5a64c2ae322bb2eb7f7fa73df9426114 Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
This commit is contained in:
committed by
Eike Ziller
parent
828b0de5db
commit
1c51de11ce
@@ -88,9 +88,7 @@ GuiAppWizard::GuiAppWizard()
|
||||
|
||||
Core::BaseFileWizard *GuiAppWizard::create(QWidget *parent, const Core::WizardDialogParameters ¶meters) const
|
||||
{
|
||||
GuiAppWizardDialog *dialog = new GuiAppWizardDialog(displayName(), icon(),
|
||||
showModulesPageForApplications(),
|
||||
parent, parameters);
|
||||
GuiAppWizardDialog *dialog = new GuiAppWizardDialog(displayName(), icon(), parent, parameters);
|
||||
dialog->setProjectName(GuiAppWizardDialog::uniqueProjectName(parameters.defaultPath()));
|
||||
// Order! suffixes first to generate files correctly
|
||||
dialog->setLowerCaseFiles(QtWizard::lowerCaseFiles());
|
||||
|
||||
@@ -47,10 +47,9 @@ GuiAppParameters::GuiAppParameters()
|
||||
|
||||
GuiAppWizardDialog::GuiAppWizardDialog(const QString &templateName,
|
||||
const QIcon &icon,
|
||||
bool showModulesPage,
|
||||
QWidget *parent,
|
||||
const Core::WizardDialogParameters ¶meters) :
|
||||
BaseQmakeProjectWizardDialog(showModulesPage, parent, parameters),
|
||||
BaseQmakeProjectWizardDialog(false, parent, parameters),
|
||||
m_filesPage(new FilesPage)
|
||||
{
|
||||
setWindowIcon(icon);
|
||||
|
||||
@@ -61,7 +61,6 @@ class GuiAppWizardDialog : public BaseQmakeProjectWizardDialog
|
||||
public:
|
||||
explicit GuiAppWizardDialog(const QString &templateName,
|
||||
const QIcon &icon,
|
||||
bool showModulesPage,
|
||||
QWidget *parent,
|
||||
const Core::WizardDialogParameters ¶meters);
|
||||
|
||||
|
||||
@@ -61,9 +61,7 @@ LibraryWizard::LibraryWizard()
|
||||
|
||||
Core::BaseFileWizard *LibraryWizard::create(QWidget *parent, const Core::WizardDialogParameters ¶meters) const
|
||||
{
|
||||
LibraryWizardDialog *dialog = new LibraryWizardDialog(displayName(), icon(),
|
||||
showModulesPageForLibraries(), parent,
|
||||
parameters);
|
||||
LibraryWizardDialog *dialog = new LibraryWizardDialog(displayName(), icon(), parent, parameters);
|
||||
dialog->setLowerCaseFiles(QtWizard::lowerCaseFiles());
|
||||
dialog->setProjectName(LibraryWizardDialog::uniqueProjectName(parameters.defaultPath()));
|
||||
dialog->setSuffixes(headerSuffix(), sourceSuffix(), formSuffix());
|
||||
|
||||
@@ -131,10 +131,9 @@ QtProjectParameters::Type LibraryIntroPage::type() const
|
||||
// ------------------- LibraryWizardDialog
|
||||
LibraryWizardDialog::LibraryWizardDialog(const QString &templateName,
|
||||
const QIcon &icon,
|
||||
bool showModulesPage,
|
||||
QWidget *parent,
|
||||
const Core::WizardDialogParameters ¶meters) :
|
||||
BaseQmakeProjectWizardDialog(showModulesPage, new LibraryIntroPage, -1, parent, parameters),
|
||||
BaseQmakeProjectWizardDialog(true, new LibraryIntroPage, -1, parent, parameters),
|
||||
m_filesPage(new FilesPage),
|
||||
m_pluginBaseClassesInitialized(false),
|
||||
m_filesPageId(-1), m_modulesPageId(-1), m_targetPageId(-1)
|
||||
|
||||
@@ -48,7 +48,6 @@ class LibraryWizardDialog : public BaseQmakeProjectWizardDialog
|
||||
public:
|
||||
LibraryWizardDialog(const QString &templateName,
|
||||
const QIcon &icon,
|
||||
bool showModulesPage,
|
||||
QWidget *parent,
|
||||
const Core::WizardDialogParameters ¶meters);
|
||||
|
||||
|
||||
@@ -121,16 +121,6 @@ bool QtWizard::lowerCaseFiles()
|
||||
return Core::ICore::settings()->value(lowerCaseSettingsKey, QVariant(lowerCaseDefault)).toBool();
|
||||
}
|
||||
|
||||
bool QtWizard::showModulesPageForApplications()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
bool QtWizard::showModulesPageForLibraries()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
// ------------ CustomQmakeProjectWizard
|
||||
CustomQmakeProjectWizard::CustomQmakeProjectWizard()
|
||||
{
|
||||
|
||||
@@ -76,10 +76,6 @@ public:
|
||||
|
||||
static bool qt4ProjectPostGenerateFiles(const QWizard *w, const Core::GeneratedFiles &l, QString *errorMessage);
|
||||
|
||||
protected:
|
||||
static bool showModulesPageForApplications();
|
||||
static bool showModulesPageForLibraries();
|
||||
|
||||
private:
|
||||
bool postGenerateFiles(const QWizard *w, const Core::GeneratedFiles &l, QString *errorMessage);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user