BaseFileWizard: Get rid of applyExtensionPageShortTitle(...)

That method was used to set a title in the progress view of the wizard
that is different from the page title. That is used exactly once and
there it adds more confusion than it helps. So get rid of the whole
thing.

Consistently set the "shortTitle" property instead for all wizards
that want to have a separate short title.

Change-Id: Ia4881e9c00891058629491f9e9de4ac421c59727
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
This commit is contained in:
Tobias Hunger
2014-05-30 11:38:08 +02:00
parent d0f00cc29d
commit ce37f05297
44 changed files with 114 additions and 104 deletions

View File

@@ -47,8 +47,7 @@ FileWizardDialog::FileWizardDialog(QWidget *parent) :
Wizard(parent),
m_filePage(new FileWizardPage)
{
const int filePageId = addPage(m_filePage);
wizardProgress()->item(filePageId)->setTitle(tr("Location"));
addPage(m_filePage);
connect(m_filePage, SIGNAL(activated()), button(QWizard::FinishButton), SLOT(animateClick()));
}

View File

@@ -30,6 +30,8 @@
#include "filewizardpage.h"
#include "ui_filewizardpage.h"
#include "wizard.h"
/*!
\class Utils::FileWizardPage
@@ -66,6 +68,8 @@ FileWizardPage::FileWizardPage(QWidget *parent) :
connect(d->m_ui.pathChooser, SIGNAL(returnPressed()), this, SLOT(slotActivated()));
connect(d->m_ui.nameLineEdit, SIGNAL(validReturnPressed()), this, SLOT(slotActivated()));
setProperty(Utils::SHORT_TITLE_PROPERTY, tr("Location"));
}
FileWizardPage::~FileWizardPage()

View File

@@ -30,6 +30,8 @@
#include "projectintropage.h"
#include "ui_projectintropage.h"
#include "wizard.h"
#include <QDir>
/*!
@@ -96,6 +98,8 @@ ProjectIntroPage::ProjectIntroPage(QWidget *parent) :
connect(d->m_ui.pathChooser, SIGNAL(returnPressed()), this, SLOT(slotActivated()));
connect(d->m_ui.nameLineEdit, SIGNAL(validReturnPressed()), this, SLOT(slotActivated()));
connect(d->m_ui.projectComboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(slotChanged()));
setProperty(SHORT_TITLE_PROPERTY, tr("Location"));
}
void ProjectIntroPage::insertControl(int row, QWidget *label, QWidget *control)

View File

@@ -32,6 +32,7 @@
#include <QMap>
#include <QHash>
#include <QVariant>
#include <QLabel>
#include <QVBoxLayout>
@@ -389,7 +390,10 @@ void Wizard::_q_pageAdded(int pageId)
if (!d->m_automaticProgressCreation)
return;
WizardProgressItem *item = d->m_wizardProgress->addItem(page(pageId)->title());
QWizardPage *p = page(pageId);
QVariant property = p->property(SHORT_TITLE_PROPERTY);
const QString title = property.isNull() ? p->title() : property.toString();
WizardProgressItem *item = d->m_wizardProgress->addItem(title);
item->addPage(pageId);
d->m_wizardProgress->setStartPage(startId());
if (!d->m_wizardProgress->startItem())

View File

@@ -40,6 +40,8 @@ class Wizard;
class WizardProgress;
class WizardPrivate;
const char SHORT_TITLE_PROPERTY[] = "shortTitle";
class QTCREATOR_UTILS_EXPORT Wizard : public QWizard
{
Q_OBJECT

View File

@@ -329,26 +329,6 @@ bool BaseFileWizardFactory::writeFiles(const GeneratedFiles &files, QString *err
return true;
}
/*!
Reads the \c shortTitle dynamic property of \a pageId and applies it as
the title of corresponding progress item.
*/
void BaseFileWizardFactory::applyExtensionPageShortTitle(Utils::Wizard *wizard, int pageId)
{
if (pageId < 0)
return;
QWizardPage *p = wizard->page(pageId);
if (!p)
return;
Utils::WizardProgressItem *item = wizard->wizardProgress()->item(pageId);
if (!item)
return;
const QString shortTitle = p->property("shortTitle").toString();
if (!shortTitle.isEmpty())
item->setTitle(shortTitle);
}
/*!
Overwrite to perform steps to be done after files are actually created.
@@ -529,7 +509,7 @@ BaseFileWizard *StandardFileWizardFactory::create(QWidget *parent, const WizardD
wizard->setWindowTitle(tr("New %1").arg(displayName()));
wizard->setPath(parameters.defaultPath());
foreach (QWizardPage *p, parameters.extensionPages())
BaseFileWizardFactory::applyExtensionPageShortTitle(wizard, wizard->addPage(p));
wizard->addPage(p);
return wizard;
}

View File

@@ -112,7 +112,6 @@ public:
void runWizard(const QString &path, QWidget *parent, const QString &platform, const QVariantMap &extraValues);
static QString buildFileName(const QString &path, const QString &baseName, const QString &extension);
static void applyExtensionPageShortTitle(Utils::Wizard *wizard, int pageId);
protected:
typedef QList<QWizardPage *> WizardPageList;

View File

@@ -39,6 +39,7 @@
#include <utils/codegeneration.h>
#include <utils/newclasswidget.h>
#include <utils/qtcassert.h>
#include <utils/wizard.h>
#include <QDebug>
#include <QTextStream>
@@ -81,6 +82,8 @@ ClassNamePage::ClassNamePage(QWidget *parent) :
pageLayout->addItem(vSpacer);
initParameters();
setProperty(Utils::SHORT_TITLE_PROPERTY, tr("Details"));
}
// Retrieve settings of CppTools plugin.
@@ -115,8 +118,7 @@ CppClassWizardDialog::CppClassWizardDialog(QWidget *parent) :
m_classNamePage(new ClassNamePage(this))
{
setWindowTitle(tr("C++ Class Wizard"));
const int classNameId = addPage(m_classNamePage);
wizardProgress()->item(classNameId)->setTitle(tr("Details"));
addPage(m_classNamePage);
}
void CppClassWizardDialog::setPath(const QString &path)
@@ -157,7 +159,7 @@ Core::BaseFileWizard *CppClassWizard::create(QWidget *parent, const Core::Wizard
{
CppClassWizardDialog *wizard = new CppClassWizardDialog(parent);
foreach (QWizardPage *p, parameters.extensionPages())
BaseFileWizardFactory::applyExtensionPageShortTitle(wizard, wizard->addPage(p));
wizard->addPage(p);
wizard->setPath(parameters.defaultPath());
return wizard;
}

View File

@@ -51,13 +51,10 @@ FormClassWizardDialog::FormClassWizardDialog(const WizardPageList &extensionPage
setWindowTitle(tr("Qt Designer Form Class"));
setPage(FormPageId, m_formPage);
wizardProgress()->item(FormPageId)->setTitle(tr("Form Template"));
setPage(ClassPageId, m_classPage);
wizardProgress()->item(ClassPageId)->setTitle(tr("Class Details"));
foreach (QWizardPage *p, extensionPages)
Core::BaseFileWizardFactory::applyExtensionPageShortTitle(this, addPage(p));
addPage(p);
}
QString FormClassWizardDialog::path() const

View File

@@ -31,6 +31,8 @@
#include "ui_formclasswizardpage.h"
#include "formclasswizardparameters.h"
#include <utils/wizard.h>
#include <coreplugin/icore.h>
#include <coreplugin/mimedatabase.h>
#include <cpptools/cpptoolsconstants.h>
@@ -59,6 +61,8 @@ FormClassWizardPage::FormClassWizardPage(QWidget * parent) :
connect(m_ui->newClassWidget, SIGNAL(validChanged()), this, SLOT(slotValidChanged()));
initFileGenerationSettings();
setProperty(Utils::SHORT_TITLE_PROPERTY, tr("Class Details"));
}
FormClassWizardPage::~FormClassWizardPage()

View File

@@ -30,6 +30,8 @@
#include "formtemplatewizardpage.h"
#include "formeditorw.h"
#include <utils/wizard.h>
#if QT_VERSION >= 0x050000
# include <QDesignerNewFormWidgetInterface>
#else
@@ -71,6 +73,7 @@ FormTemplateWizardPage::FormTemplateWizardPage(QWidget * parent) :
layout->addWidget(m_newFormWidget);
setLayout(layout);
setProperty(Utils::SHORT_TITLE_PROPERTY, tr("Form Template"));
}
bool FormTemplateWizardPage::isComplete() const

View File

@@ -56,15 +56,11 @@ void FormWizardDialog::init(const WizardPageList &extensionPages)
{
setWindowTitle(tr("Qt Designer Form"));
setPage(FormPageId, m_formPage);
wizardProgress()->item(FormPageId)->setTitle(tr("Form Template"));
if (!extensionPages.empty()) {
int id = FirstExtensionPageId;
foreach (QWizardPage *p, extensionPages) {
setPage(id, p);
Core::BaseFileWizardFactory::applyExtensionPageShortTitle(this, id);
id++;
}
int id = FirstExtensionPageId;
foreach (QWizardPage *p, extensionPages) {
setPage(id, p);
++id;
}
}
@@ -83,7 +79,6 @@ FormFileWizardDialog::FormFileWizardDialog(const WizardPageList &extensionPages,
m_filePage(new Utils::FileWizardPage)
{
setPage(FilePageId, m_filePage);
wizardProgress()->item(FilePageId)->setTitle(tr("Location"));
connect(m_filePage, SIGNAL(activated()),
button(QWizard::FinishButton), SLOT(animateClick()));

View File

@@ -36,6 +36,8 @@
#include <coreplugin/icore.h>
#include <projectexplorer/selectablefilesmodel.h>
#include <utils/wizard.h>
#include <QVBoxLayout>
#include <QLineEdit>
#include <QPushButton>
@@ -61,6 +63,8 @@ FilesSelectionWizardPage::FilesSelectionWizardPage(GenericProjectWizardDialog *g
layout->addWidget(m_view);
layout->addWidget(m_label);
setProperty(Utils::SHORT_TITLE_PROPERTY, tr("Files"));
}
void FilesSelectionWizardPage::createHideFileFilterControls(QVBoxLayout *layout)

View File

@@ -69,16 +69,12 @@ GenericProjectWizardDialog::GenericProjectWizardDialog(QWidget *parent) :
m_firstPage->setTitle(tr("Project Name and Location"));
m_firstPage->setFileNameLabel(tr("Project name:"));
m_firstPage->setPathLabel(tr("Location:"));
addPage(m_firstPage);
// second page
m_secondPage = new FilesSelectionWizardPage(this);
m_secondPage->setTitle(tr("File Selection"));
const int firstPageId = addPage(m_firstPage);
wizardProgress()->item(firstPageId)->setTitle(tr("Location"));
const int secondPageId = addPage(m_secondPage);
wizardProgress()->item(secondPageId)->setTitle(tr("Files"));
addPage(m_secondPage);
}
QString GenericProjectWizardDialog::path() const
@@ -139,7 +135,7 @@ Core::BaseFileWizard *GenericProjectWizard::create(QWidget *parent, const Core::
wizard->setPath(parameters.defaultPath());
foreach (QWizardPage *p, parameters.extensionPages())
BaseFileWizardFactory::applyExtensionPageShortTitle(wizard, wizard->addPage(p));
wizard->addPage(p);
return wizard;
}

View File

@@ -122,7 +122,7 @@ Core::BaseFileWizard *GLSLFileWizard::create(QWidget *parent, const Core::Wizard
wizard->setWindowTitle(tr("New %1").arg(displayName()));
wizard->setPath(parameters.defaultPath());
foreach (QWizardPage *p, parameters.extensionPages())
BaseFileWizardFactory::applyExtensionPageShortTitle(wizard, wizard->addPage(p));
wizard->addPage(p);
return wizard;
}

View File

@@ -94,7 +94,6 @@ void BaseProjectWizardDialog::init()
d->introPageId = d->desiredIntroPageId;
setPage(d->desiredIntroPageId, d->introPage);
}
wizardProgress()->item(d->introPageId)->setTitle(tr("Location"));
connect(this, SIGNAL(accepted()), this, SLOT(slotAccepted()));
connect(this, SIGNAL(nextClicked()), this, SLOT(nextClicked()));
}
@@ -184,7 +183,7 @@ QString BaseProjectWizardDialog::uniqueProjectName(const QString &path)
void BaseProjectWizardDialog::addExtensionPages(const QList<QWizardPage *> &wizardPageList)
{
foreach (QWizardPage *p,wizardPageList)
Core::BaseFileWizardFactory::applyExtensionPageShortTitle(this, addPage(p));
addPage(p);
}
QString BaseProjectWizardDialog::selectedPlatform() const

View File

@@ -146,7 +146,7 @@ Core::BaseFileWizard *CustomWizard::create(QWidget *parent, const Core::WizardDi
if (!parameters()->fieldPageTitle.isEmpty())
customPage->setTitle(parameters()->fieldPageTitle);
foreach (QWizardPage *ep, p.extensionPages())
BaseFileWizardFactory::applyExtensionPageShortTitle(wizard, wizard->addPage(ep));
wizard->addPage(ep);
if (CustomWizardPrivate::verbose)
qDebug() << "initWizardDialog" << wizard << wizard->pageIds();
@@ -525,7 +525,7 @@ void CustomProjectWizard::initProjectWizardDialog(BaseProjectWizardDialog *w,
cp->setTitle(pa->fieldPageTitle);
}
foreach (QWizardPage *ep, extensionPages)
BaseFileWizardFactory::applyExtensionPageShortTitle(w, w->addPage(ep));
w->addPage(ep);
w->setPath(defaultPath);
w->setProjectName(BaseProjectWizardDialog::uniqueProjectName(defaultPath));

View File

@@ -33,6 +33,7 @@
#include <coreplugin/icore.h>
#include <utils/fileutils.h>
#include <utils/wizard.h>
#include <vcsbase/vcsbaseconstants.h>
#include <QDir>
@@ -61,7 +62,7 @@ ProjectWizardPage::ProjectWizardPage(QWidget *parent) :
connect(m_ui->projectComboBox, SIGNAL(currentIndexChanged(int)),
this, SLOT(slotProjectChanged(int)));
connect(m_ui->vcsManageButton, SIGNAL(clicked()), this, SLOT(slotManageVcs()));
setProperty("shortTitle", tr("Summary"));
setProperty(Utils::SHORT_TITLE_PROPERTY, tr("Summary"));
}
ProjectWizardPage::~ProjectWizardPage()

View File

@@ -43,6 +43,7 @@
#include <projectexplorer/ipotentialkit.h>
#include <utils/qtcassert.h>
#include <utils/qtcprocess.h>
#include <utils/wizard.h>
#include <QFileInfo>
#include <QLabel>
@@ -179,6 +180,8 @@ TargetSetupPage::TargetSetupPage(QWidget *parent) :
this, SLOT(handleKitUpdate(ProjectExplorer::Kit*)));
connect(m_importWidget, SIGNAL(importFrom(Utils::FileName)),
this, SLOT(import(Utils::FileName)));
setProperty(Utils::SHORT_TITLE_PROPERTY, tr("Kits"));
}
void TargetSetupPage::initializePage()

View File

@@ -30,6 +30,8 @@
#include "pythonclassnamepage.h"
#include "../pythoneditorconstants.h"
#include <utils/wizard.h>
#include <coreplugin/icore.h>
#include <coreplugin/mimedatabase.h>
#include <utils/newclasswidget.h>
@@ -72,6 +74,8 @@ ClassNamePage::ClassNamePage(QWidget *parent)
pageLayout->addItem(vSpacer);
initParameters();
setProperty(Utils::SHORT_TITLE_PROPERTY, tr("Details"));
}
ClassNamePage::~ClassNamePage()

View File

@@ -59,7 +59,7 @@ Core::BaseFileWizard *ClassWizard::create(QWidget *parent, const Core::WizardDia
{
ClassWizardDialog *wizard = new ClassWizardDialog(parent);
foreach (QWizardPage *p, parameters.extensionPages())
BaseFileWizardFactory::applyExtensionPageShortTitle(wizard, wizard->addPage(p));
wizard->addPage(p);
wizard->setPath(parameters.defaultPath());
wizard->setExtraValues(parameters.extraValues());
return wizard;

View File

@@ -41,8 +41,7 @@ ClassWizardDialog::ClassWizardDialog(QWidget *parent) :
m_classNamePage(new ClassNamePage(this))
{
setWindowTitle(tr("Python Class Wizard"));
const int classNameId = addPage(m_classNamePage.data());
wizardProgress()->item(classNameId)->setTitle(tr("Details"));
addPage(m_classNamePage.data());
}
ClassWizardDialog::~ClassWizardDialog()

View File

@@ -67,7 +67,7 @@ Core::BaseFileWizard *FileWizard::create(QWidget *parent, const Core::WizardDial
wizard->setWindowTitle(tr("New %1").arg(displayName()));
wizard->setPath(parameters.defaultPath());
foreach (QWizardPage *p, parameters.extensionPages())
applyExtensionPageShortTitle(wizard, wizard->addPage(p));
wizard->addPage(p);
return wizard;
}

View File

@@ -90,17 +90,11 @@ AddLibraryWizard::AddLibraryWizard(const QString &fileName, QWidget *parent) :
{
setWindowTitle(tr("Add Library"));
m_libraryTypePage = new LibraryTypePage(this);
addPage(m_libraryTypePage);
m_detailsPage = new DetailsPage(this);
addPage(m_detailsPage);
m_summaryPage = new SummaryPage(this);
const int libraryTypePageId = addPage(m_libraryTypePage);
const int detailsPageId = addPage(m_detailsPage);
const int summaryPageId = addPage(m_summaryPage);
Utils::WizardProgress *progress = wizardProgress();
progress->item(libraryTypePageId)->setTitle(tr("Type"));
progress->item(detailsPageId)->setTitle(tr("Details"));
progress->item(summaryPageId)->setTitle(tr("Summary"));
addPage(m_summaryPage);
}
AddLibraryWizard::~AddLibraryWizard()
@@ -184,6 +178,8 @@ LibraryTypePage::LibraryTypePage(AddLibraryWizard *parent)
// select the default
m_internalRadio->setChecked(true);
setProperty(Utils::SHORT_TITLE_PROPERTY, tr("Type"));
}
AddLibraryWizard::LibraryKind LibraryTypePage::libraryKind() const
@@ -204,6 +200,8 @@ DetailsPage::DetailsPage(AddLibraryWizard *parent)
{
m_libraryDetailsWidget = new Ui::LibraryDetailsWidget();
m_libraryDetailsWidget->setupUi(this);
setProperty(Utils::SHORT_TITLE_PROPERTY, tr("Details"));
}
bool DetailsPage::isComplete() const
@@ -281,6 +279,8 @@ SummaryPage::SummaryPage(AddLibraryWizard *parent)
m_summaryLabel->setTextFormat(Qt::RichText);
m_snippetLabel->setTextFormat(Qt::RichText);
m_snippetLabel->setTextInteractionFlags(Qt::TextBrowserInteraction);
setProperty(Utils::SHORT_TITLE_PROPERTY, tr("Summary"));
}
void SummaryPage::initializePage()

View File

@@ -31,6 +31,8 @@
#include "customwidgetwidgetswizardpage.h"
#include "ui_customwidgetpluginwizardpage.h"
#include <utils/wizard.h>
namespace QmakeProjectManager {
namespace Internal {
@@ -43,6 +45,8 @@ CustomWidgetPluginWizardPage::CustomWidgetPluginWizardPage(QWidget *parent) :
m_ui->setupUi(this);
connect(m_ui->collectionClassEdit, SIGNAL(textEdited(QString)), this, SLOT(slotCheckCompleteness()));
connect(m_ui->pluginNameEdit, SIGNAL(textEdited(QString)), this, SLOT(slotCheckCompleteness()));
setProperty(Utils::SHORT_TITLE_PROPERTY, tr("Plugin Details"));
}
CustomWidgetPluginWizardPage::~CustomWidgetPluginWizardPage()

View File

@@ -33,6 +33,8 @@
#include <coreplugin/coreconstants.h>
#include <utils/wizard.h>
#include <QTimer>
#include <QStackedLayout>
@@ -63,6 +65,8 @@ CustomWidgetWidgetsWizardPage::CustomWidgetWidgetsWizardPage(QWidget *parent) :
connect(m_ui->classList, SIGNAL(currentRowChanged(int)),
this, SLOT(slotCurrentRowChanged(int)));
setProperty(Utils::SHORT_TITLE_PROPERTY, tr("Custom Widgets"));
}
CustomWidgetWidgetsWizardPage::~CustomWidgetWidgetsWizardPage()

View File

@@ -64,8 +64,7 @@ CustomWidgetWizardDialog::CustomWidgetWizardDialog(const QString &templateName,
const Core::WizardDialogParameters &parameters) :
BaseQmakeProjectWizardDialog(false, parent, parameters),
m_widgetsPage(new CustomWidgetWidgetsWizardPage),
m_pluginPage(new CustomWidgetPluginWizardPage),
m_widgetPageId(-1), m_pluginPageId(-1)
m_pluginPage(new CustomWidgetPluginWizardPage)
{
setWindowIcon(icon);
setWindowTitle(templateName);
@@ -75,10 +74,8 @@ CustomWidgetWizardDialog::CustomWidgetWizardDialog(const QString &templateName,
if (!parameters.extraValues().contains(QLatin1String(ProjectExplorer::Constants::PROJECT_KIT_IDS)))
addTargetSetupPage();
m_widgetPageId = addPage(m_widgetsPage);
addPage(m_widgetsPage);
m_pluginPageId = addPage(m_pluginPage);
wizardProgress()->item(m_widgetPageId)->setTitle(tr("Custom Widgets"));
wizardProgress()->item(m_pluginPageId)->setTitle(tr("Plugin Details"));
addExtensionPages(parameters.extensionPages());
connect(this, SIGNAL(currentIdChanged(int)), this, SLOT(slotCurrentIdChanged(int)));

View File

@@ -63,7 +63,6 @@ private slots:
private:
CustomWidgetWidgetsWizardPage *m_widgetsPage;
CustomWidgetPluginWizardPage *m_pluginPage;
int m_widgetPageId;
int m_pluginPageId;
};

View File

@@ -66,7 +66,7 @@ AbstractMobileAppWizardDialog::AbstractMobileAppWizardDialog(QWidget *parent,
void AbstractMobileAppWizardDialog::addKitsPage()
{
if (m_kitsPage)
addPageWithTitle(m_kitsPage, tr("Kits"));
addPage(m_kitsPage);
}
void AbstractMobileAppWizardDialog::updateKitsPage()
@@ -91,13 +91,6 @@ ProjectExplorer::TargetSetupPage *AbstractMobileAppWizardDialog::kitsPage() cons
return m_kitsPage;
}
int AbstractMobileAppWizardDialog::addPageWithTitle(QWizardPage *page, const QString &title)
{
const int pageId = addPage(page);
wizardProgress()->item(pageId)->setTitle(title);
return pageId;
}
Core::BaseFileWizard *AbstractMobileAppWizard::create(QWidget *parent, const Core::WizardDialogParameters &parameters) const
{
AbstractMobileAppWizardDialog * const wdlg = createInternal(parent, parameters);

View File

@@ -55,7 +55,6 @@ public:
ProjectExplorer::TargetSetupPage *kitsPage() const;
protected:
int addPageWithTitle(QWizardPage *page, const QString &title);
void addKitsPage();
void updateKitsPage();

View File

@@ -30,9 +30,11 @@
#include "filespage.h"
#include <utils/newclasswidget.h>
#include <utils/wizard.h>
#include <QLabel>
#include <QLayout>
#include <QVariant>
namespace QmakeProjectManager {
namespace Internal {
@@ -61,6 +63,8 @@ FilesPage::FilesPage(QWidget *parent) :
setLayout(vlayout);
connect(m_newClassWidget, SIGNAL(validChanged()), this, SIGNAL(completeChanged()));
setProperty(Utils::SHORT_TITLE_PROPERTY, tr("Details"));
}
void FilesPage::setSuffixes(const QString &header, const QString &source, const QString &form)

View File

@@ -66,8 +66,7 @@ GuiAppWizardDialog::GuiAppWizardDialog(const QString &templateName,
m_filesPage->setFormInputCheckable(true);
m_filesPage->setClassTypeComboVisible(false);
const int filesPageId = addPage(m_filesPage);
wizardProgress()->item(filesPageId)->setTitle(tr("Details"));
addPage(m_filesPage);
addExtensionPages(parameters.extensionPages());
}

View File

@@ -29,6 +29,8 @@
#include "modulespage.h"
#include <utils/wizard.h>
#include <qmakeprojectmanager/qtmodulesinfo.h>
#include <QDebug>
@@ -73,6 +75,8 @@ ModulesPage::ModulesPage(QWidget *parent)
vlayout->addLayout(layout);
setLayout(vlayout);
setProperty(Utils::SHORT_TITLE_PROPERTY, tr("Modules"));
}
// Return the key that goes into the Qt config line for a module

View File

@@ -68,7 +68,7 @@ QtQuickAppWizardDialog::QtQuickAppWizardDialog(QWidget *parent,
setIntroDescription(tr("This wizard generates a Qt Quick Application project."));
m_componentSetPage = new Internal::QtQuickComponentSetPage;
addPageWithTitle(m_componentSetPage, tr("Component Set"));
addPage(m_componentSetPage);
addKitsPage();
}

View File

@@ -28,6 +28,9 @@
****************************************************************************/
#include "qtquickappwizardpages.h"
#include <utils/wizard.h>
#include <QComboBox>
#include <QLabel>
#include <QVBoxLayout>
@@ -67,6 +70,8 @@ QtQuickComponentSetPage::QtQuickComponentSetPage(QWidget *parent)
mainLayout->addLayout(l);
mainLayout->addWidget(d->m_descriptionLabel);
setProperty(Utils::SHORT_TITLE_PROPERTY, tr("Component Set"));
}
QtQuickComponentSetPage::~QtQuickComponentSetPage()

View File

@@ -197,11 +197,9 @@ int BaseQmakeProjectWizardDialog::addModulesPage(int id)
return -1;
if (id >= 0) {
setPage(id, m_modulesPage);
wizardProgress()->item(id)->setTitle(tr("Modules"));
return id;
}
const int newId = addPage(m_modulesPage);
wizardProgress()->item(newId)->setTitle(tr("Modules"));
return newId;
}
@@ -222,7 +220,6 @@ int BaseQmakeProjectWizardDialog::addTargetSetupPage(int id)
setPage(id, m_targetSetupPage);
else
id = addPage(m_targetSetupPage);
wizardProgress()->item(id)->setTitle(tr("Kits"));
return id;
}
@@ -305,7 +302,7 @@ QList<Core::Id> BaseQmakeProjectWizardDialog::selectedKits() const
void BaseQmakeProjectWizardDialog::addExtensionPages(const QList<QWizardPage *> &wizardPageList)
{
foreach (QWizardPage *p,wizardPageList)
Core::BaseFileWizardFactory::applyExtensionPageShortTitle(this, addPage(p));
addPage(p);
}
void BaseQmakeProjectWizardDialog::generateProfileName(const QString &name, const QString &path)

View File

@@ -53,8 +53,7 @@ TestWizardDialog::TestWizardDialog(const QString &templateName,
QWidget *parent,
const Core::WizardDialogParameters &parameters) :
BaseQmakeProjectWizardDialog(true, parent, parameters),
m_testPage(new TestWizardPage),
m_testPageId(-1), m_modulesPageId(-1)
m_testPage(new TestWizardPage)
{
setIntroDescription(tr("This wizard generates a Qt Unit Test "
"consisting of a single source file with a test class."));
@@ -63,9 +62,8 @@ TestWizardDialog::TestWizardDialog(const QString &templateName,
setSelectedModules(QLatin1String("core testlib"), true);
if (!parameters.extraValues().contains(QLatin1String(ProjectExplorer::Constants::PROJECT_KIT_IDS)))
addTargetSetupPage();
m_modulesPageId = addModulesPage();
addModulesPage();
m_testPageId = addPage(m_testPage);
wizardProgress()->item(m_testPageId)->setTitle(tr("Details"));
addExtensionPages(parameters.extensionPages());
connect(this, SIGNAL(currentIdChanged(int)), this, SLOT(slotCurrentIdChanged(int)));
}

View File

@@ -76,7 +76,6 @@ private slots:
private:
TestWizardPage *m_testPage;
int m_testPageId;
int m_modulesPageId;
};
} // namespace Internal

View File

@@ -32,6 +32,8 @@
#include "qtwizard.h"
#include "ui_testwizardpage.h"
#include <utils/wizard.h>
namespace QmakeProjectManager {
namespace Internal {
@@ -58,6 +60,8 @@ TestWizardPage::TestWizardPage(QWidget *parent) :
this, SLOT(slotUpdateValid()));
connect(ui->fileLineEdit, SIGNAL(validChanged()),
this, SLOT(slotUpdateValid()));
setProperty(Utils::SHORT_TITLE_PROPERTY, tr("Details"));
}
TestWizardPage::~TestWizardPage()

View File

@@ -129,7 +129,7 @@ Core::BaseFileWizard *JsFileWizard::create(QWidget *parent, const Core::WizardDi
wizardDialog->setWindowTitle(tr("New %1").arg(displayName()));
wizardDialog->setPath(parameters.defaultPath());
foreach (QWizardPage *p, parameters.extensionPages())
BaseFileWizardFactory::applyExtensionPageShortTitle(wizardDialog, wizardDialog->addPage(p));
wizardDialog->addPage(p);
return wizardDialog;
}

View File

@@ -59,8 +59,7 @@ QmlApplicationWizardDialog::QmlApplicationWizardDialog(QWidget *parent, const Wi
setWindowTitle(tr("New Qt Quick UI Project"));
setIntroDescription(tr("This wizard generates a Qt Quick UI project."));
m_componentSetPage = new QmlComponentSetPage;
const int pageId = addPage(m_componentSetPage);
wizardProgress()->item(pageId)->setTitle(tr("Component Set"));
addPage(m_componentSetPage);
}
TemplateInfo QmlApplicationWizardDialog::templateInfo() const
@@ -94,7 +93,7 @@ Core::BaseFileWizard *QmlApplicationWizard::create(QWidget *parent, const Wizard
wizardDialog->setProjectName(QmlApplicationWizardDialog::uniqueProjectName(parameters.defaultPath()));
foreach (QWizardPage *page, parameters.extensionPages())
applyExtensionPageShortTitle(wizardDialog, wizardDialog->addPage(page));
wizardDialog->addPage(page);
return wizardDialog;
}

View File

@@ -29,6 +29,9 @@
#include "qmlapplicationwizardpages.h"
#include "qmlapp.h"
#include <utils/wizard.h>
#include <QComboBox>
#include <QLabel>
#include <QVBoxLayout>
@@ -69,6 +72,8 @@ QmlComponentSetPage::QmlComponentSetPage(QWidget *parent)
mainLayout->addLayout(l);
mainLayout->addWidget(d->m_detailedDescriptionLabel);
setProperty(Utils::SHORT_TITLE_PROPERTY, tr("Component Set"));
}
QmlComponentSetPage::~QmlComponentSetPage()

View File

@@ -69,16 +69,13 @@ CascadesImportWizardDialog::CascadesImportWizardDialog(QWidget *parent) :
m_srcProjectPage = new SrcProjectWizardPage(this);
m_srcProjectPage->setTitle(tr("Momentics Cascades Project Name and Location"));
addPage(m_srcProjectPage);
m_destProjectPage = new Utils::ProjectIntroPage(this);
m_destProjectPage->setTitle(tr("Project Name and Location"));
m_destProjectPage->setPath(Core::DocumentManager::projectsDirectory());
const int srcProjectPageId = addPage(m_srcProjectPage);
wizardProgress()->item(srcProjectPageId)->setTitle(tr("Momentics"));
const int destProjectPageId = addPage(m_destProjectPage);
wizardProgress()->item(destProjectPageId)->setTitle(tr("Qt Creator"));
wizardProgress()->item(destProjectPageId)->setTitle(tr("Qt Creator")); // Override default name
connect(m_srcProjectPage, SIGNAL(validPathChanged(QString)), this, SLOT(onSrcProjectPathChanged(QString)));
}
@@ -130,7 +127,7 @@ Core::BaseFileWizard *CascadesImportWizard::create(QWidget *parent,
CascadesImportWizardDialog *wizard = new CascadesImportWizardDialog(parent);
foreach (QWizardPage *p, parameters.extensionPages())
BaseFileWizardFactory::applyExtensionPageShortTitle(wizard, wizard->addPage(p));
wizard->addPage(p);
return wizard;
}

View File

@@ -30,6 +30,8 @@
#include "srcprojectwizardpage.h"
#include "ui_srcprojectwizardpage.h"
#include <utils/wizard.h>
#include <QDir>
namespace Qnx {
@@ -44,6 +46,8 @@ SrcProjectWizardPage::SrcProjectWizardPage(QWidget *parent)
connect(ui->pathChooser, SIGNAL(pathChanged(QString)), this, SLOT(onPathChooserPathChanged(QString)));
setPath(QDir::homePath());
setProperty(Utils::SHORT_TITLE_PROPERTY, tr("Momentics"));
}
SrcProjectWizardPage::~SrcProjectWizardPage()