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), Wizard(parent),
m_filePage(new FileWizardPage) m_filePage(new FileWizardPage)
{ {
const int filePageId = addPage(m_filePage); addPage(m_filePage);
wizardProgress()->item(filePageId)->setTitle(tr("Location"));
connect(m_filePage, SIGNAL(activated()), button(QWizard::FinishButton), SLOT(animateClick())); connect(m_filePage, SIGNAL(activated()), button(QWizard::FinishButton), SLOT(animateClick()));
} }

View File

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

View File

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

View File

@@ -32,6 +32,7 @@
#include <QMap> #include <QMap>
#include <QHash> #include <QHash>
#include <QVariant>
#include <QLabel> #include <QLabel>
#include <QVBoxLayout> #include <QVBoxLayout>
@@ -389,7 +390,10 @@ void Wizard::_q_pageAdded(int pageId)
if (!d->m_automaticProgressCreation) if (!d->m_automaticProgressCreation)
return; 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); item->addPage(pageId);
d->m_wizardProgress->setStartPage(startId()); d->m_wizardProgress->setStartPage(startId());
if (!d->m_wizardProgress->startItem()) if (!d->m_wizardProgress->startItem())

View File

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

View File

@@ -329,26 +329,6 @@ bool BaseFileWizardFactory::writeFiles(const GeneratedFiles &files, QString *err
return true; 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. 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->setWindowTitle(tr("New %1").arg(displayName()));
wizard->setPath(parameters.defaultPath()); wizard->setPath(parameters.defaultPath());
foreach (QWizardPage *p, parameters.extensionPages()) foreach (QWizardPage *p, parameters.extensionPages())
BaseFileWizardFactory::applyExtensionPageShortTitle(wizard, wizard->addPage(p)); wizard->addPage(p);
return wizard; return wizard;
} }

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -36,6 +36,8 @@
#include <coreplugin/icore.h> #include <coreplugin/icore.h>
#include <projectexplorer/selectablefilesmodel.h> #include <projectexplorer/selectablefilesmodel.h>
#include <utils/wizard.h>
#include <QVBoxLayout> #include <QVBoxLayout>
#include <QLineEdit> #include <QLineEdit>
#include <QPushButton> #include <QPushButton>
@@ -61,6 +63,8 @@ FilesSelectionWizardPage::FilesSelectionWizardPage(GenericProjectWizardDialog *g
layout->addWidget(m_view); layout->addWidget(m_view);
layout->addWidget(m_label); layout->addWidget(m_label);
setProperty(Utils::SHORT_TITLE_PROPERTY, tr("Files"));
} }
void FilesSelectionWizardPage::createHideFileFilterControls(QVBoxLayout *layout) 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->setTitle(tr("Project Name and Location"));
m_firstPage->setFileNameLabel(tr("Project name:")); m_firstPage->setFileNameLabel(tr("Project name:"));
m_firstPage->setPathLabel(tr("Location:")); m_firstPage->setPathLabel(tr("Location:"));
addPage(m_firstPage);
// second page // second page
m_secondPage = new FilesSelectionWizardPage(this); m_secondPage = new FilesSelectionWizardPage(this);
m_secondPage->setTitle(tr("File Selection")); m_secondPage->setTitle(tr("File Selection"));
addPage(m_secondPage);
const int firstPageId = addPage(m_firstPage);
wizardProgress()->item(firstPageId)->setTitle(tr("Location"));
const int secondPageId = addPage(m_secondPage);
wizardProgress()->item(secondPageId)->setTitle(tr("Files"));
} }
QString GenericProjectWizardDialog::path() const QString GenericProjectWizardDialog::path() const
@@ -139,7 +135,7 @@ Core::BaseFileWizard *GenericProjectWizard::create(QWidget *parent, const Core::
wizard->setPath(parameters.defaultPath()); wizard->setPath(parameters.defaultPath());
foreach (QWizardPage *p, parameters.extensionPages()) foreach (QWizardPage *p, parameters.extensionPages())
BaseFileWizardFactory::applyExtensionPageShortTitle(wizard, wizard->addPage(p)); wizard->addPage(p);
return wizard; 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->setWindowTitle(tr("New %1").arg(displayName()));
wizard->setPath(parameters.defaultPath()); wizard->setPath(parameters.defaultPath());
foreach (QWizardPage *p, parameters.extensionPages()) foreach (QWizardPage *p, parameters.extensionPages())
BaseFileWizardFactory::applyExtensionPageShortTitle(wizard, wizard->addPage(p)); wizard->addPage(p);
return wizard; return wizard;
} }

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -41,8 +41,7 @@ ClassWizardDialog::ClassWizardDialog(QWidget *parent) :
m_classNamePage(new ClassNamePage(this)) m_classNamePage(new ClassNamePage(this))
{ {
setWindowTitle(tr("Python Class Wizard")); setWindowTitle(tr("Python Class Wizard"));
const int classNameId = addPage(m_classNamePage.data()); addPage(m_classNamePage.data());
wizardProgress()->item(classNameId)->setTitle(tr("Details"));
} }
ClassWizardDialog::~ClassWizardDialog() 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->setWindowTitle(tr("New %1").arg(displayName()));
wizard->setPath(parameters.defaultPath()); wizard->setPath(parameters.defaultPath());
foreach (QWizardPage *p, parameters.extensionPages()) foreach (QWizardPage *p, parameters.extensionPages())
applyExtensionPageShortTitle(wizard, wizard->addPage(p)); wizard->addPage(p);
return wizard; return wizard;
} }

View File

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

View File

@@ -31,6 +31,8 @@
#include "customwidgetwidgetswizardpage.h" #include "customwidgetwidgetswizardpage.h"
#include "ui_customwidgetpluginwizardpage.h" #include "ui_customwidgetpluginwizardpage.h"
#include <utils/wizard.h>
namespace QmakeProjectManager { namespace QmakeProjectManager {
namespace Internal { namespace Internal {
@@ -43,6 +45,8 @@ CustomWidgetPluginWizardPage::CustomWidgetPluginWizardPage(QWidget *parent) :
m_ui->setupUi(this); m_ui->setupUi(this);
connect(m_ui->collectionClassEdit, SIGNAL(textEdited(QString)), this, SLOT(slotCheckCompleteness())); connect(m_ui->collectionClassEdit, SIGNAL(textEdited(QString)), this, SLOT(slotCheckCompleteness()));
connect(m_ui->pluginNameEdit, 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() CustomWidgetPluginWizardPage::~CustomWidgetPluginWizardPage()

View File

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

View File

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

View File

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

View File

@@ -66,7 +66,7 @@ AbstractMobileAppWizardDialog::AbstractMobileAppWizardDialog(QWidget *parent,
void AbstractMobileAppWizardDialog::addKitsPage() void AbstractMobileAppWizardDialog::addKitsPage()
{ {
if (m_kitsPage) if (m_kitsPage)
addPageWithTitle(m_kitsPage, tr("Kits")); addPage(m_kitsPage);
} }
void AbstractMobileAppWizardDialog::updateKitsPage() void AbstractMobileAppWizardDialog::updateKitsPage()
@@ -91,13 +91,6 @@ ProjectExplorer::TargetSetupPage *AbstractMobileAppWizardDialog::kitsPage() cons
return m_kitsPage; 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 Core::BaseFileWizard *AbstractMobileAppWizard::create(QWidget *parent, const Core::WizardDialogParameters &parameters) const
{ {
AbstractMobileAppWizardDialog * const wdlg = createInternal(parent, parameters); AbstractMobileAppWizardDialog * const wdlg = createInternal(parent, parameters);

View File

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

View File

@@ -30,9 +30,11 @@
#include "filespage.h" #include "filespage.h"
#include <utils/newclasswidget.h> #include <utils/newclasswidget.h>
#include <utils/wizard.h>
#include <QLabel> #include <QLabel>
#include <QLayout> #include <QLayout>
#include <QVariant>
namespace QmakeProjectManager { namespace QmakeProjectManager {
namespace Internal { namespace Internal {
@@ -61,6 +63,8 @@ FilesPage::FilesPage(QWidget *parent) :
setLayout(vlayout); setLayout(vlayout);
connect(m_newClassWidget, SIGNAL(validChanged()), this, SIGNAL(completeChanged())); 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) 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->setFormInputCheckable(true);
m_filesPage->setClassTypeComboVisible(false); m_filesPage->setClassTypeComboVisible(false);
const int filesPageId = addPage(m_filesPage); addPage(m_filesPage);
wizardProgress()->item(filesPageId)->setTitle(tr("Details"));
addExtensionPages(parameters.extensionPages()); addExtensionPages(parameters.extensionPages());
} }

View File

@@ -29,6 +29,8 @@
#include "modulespage.h" #include "modulespage.h"
#include <utils/wizard.h>
#include <qmakeprojectmanager/qtmodulesinfo.h> #include <qmakeprojectmanager/qtmodulesinfo.h>
#include <QDebug> #include <QDebug>
@@ -73,6 +75,8 @@ ModulesPage::ModulesPage(QWidget *parent)
vlayout->addLayout(layout); vlayout->addLayout(layout);
setLayout(vlayout); setLayout(vlayout);
setProperty(Utils::SHORT_TITLE_PROPERTY, tr("Modules"));
} }
// Return the key that goes into the Qt config line for a module // 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.")); setIntroDescription(tr("This wizard generates a Qt Quick Application project."));
m_componentSetPage = new Internal::QtQuickComponentSetPage; m_componentSetPage = new Internal::QtQuickComponentSetPage;
addPageWithTitle(m_componentSetPage, tr("Component Set")); addPage(m_componentSetPage);
addKitsPage(); addKitsPage();
} }

View File

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

View File

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

View File

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

View File

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

View File

@@ -32,6 +32,8 @@
#include "qtwizard.h" #include "qtwizard.h"
#include "ui_testwizardpage.h" #include "ui_testwizardpage.h"
#include <utils/wizard.h>
namespace QmakeProjectManager { namespace QmakeProjectManager {
namespace Internal { namespace Internal {
@@ -58,6 +60,8 @@ TestWizardPage::TestWizardPage(QWidget *parent) :
this, SLOT(slotUpdateValid())); this, SLOT(slotUpdateValid()));
connect(ui->fileLineEdit, SIGNAL(validChanged()), connect(ui->fileLineEdit, SIGNAL(validChanged()),
this, SLOT(slotUpdateValid())); this, SLOT(slotUpdateValid()));
setProperty(Utils::SHORT_TITLE_PROPERTY, tr("Details"));
} }
TestWizardPage::~TestWizardPage() 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->setWindowTitle(tr("New %1").arg(displayName()));
wizardDialog->setPath(parameters.defaultPath()); wizardDialog->setPath(parameters.defaultPath());
foreach (QWizardPage *p, parameters.extensionPages()) foreach (QWizardPage *p, parameters.extensionPages())
BaseFileWizardFactory::applyExtensionPageShortTitle(wizardDialog, wizardDialog->addPage(p)); wizardDialog->addPage(p);
return wizardDialog; return wizardDialog;
} }

View File

@@ -59,8 +59,7 @@ QmlApplicationWizardDialog::QmlApplicationWizardDialog(QWidget *parent, const Wi
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."));
m_componentSetPage = new QmlComponentSetPage; m_componentSetPage = new QmlComponentSetPage;
const int pageId = addPage(m_componentSetPage); addPage(m_componentSetPage);
wizardProgress()->item(pageId)->setTitle(tr("Component Set"));
} }
TemplateInfo QmlApplicationWizardDialog::templateInfo() const TemplateInfo QmlApplicationWizardDialog::templateInfo() const
@@ -94,7 +93,7 @@ Core::BaseFileWizard *QmlApplicationWizard::create(QWidget *parent, const Wizard
wizardDialog->setProjectName(QmlApplicationWizardDialog::uniqueProjectName(parameters.defaultPath())); wizardDialog->setProjectName(QmlApplicationWizardDialog::uniqueProjectName(parameters.defaultPath()));
foreach (QWizardPage *page, parameters.extensionPages()) foreach (QWizardPage *page, parameters.extensionPages())
applyExtensionPageShortTitle(wizardDialog, wizardDialog->addPage(page)); wizardDialog->addPage(page);
return wizardDialog; return wizardDialog;
} }

View File

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

View File

@@ -69,16 +69,13 @@ CascadesImportWizardDialog::CascadesImportWizardDialog(QWidget *parent) :
m_srcProjectPage = new SrcProjectWizardPage(this); m_srcProjectPage = new SrcProjectWizardPage(this);
m_srcProjectPage->setTitle(tr("Momentics Cascades Project Name and Location")); m_srcProjectPage->setTitle(tr("Momentics Cascades Project Name and Location"));
addPage(m_srcProjectPage);
m_destProjectPage = new Utils::ProjectIntroPage(this); m_destProjectPage = new Utils::ProjectIntroPage(this);
m_destProjectPage->setTitle(tr("Project Name and Location")); m_destProjectPage->setTitle(tr("Project Name and Location"));
m_destProjectPage->setPath(Core::DocumentManager::projectsDirectory()); m_destProjectPage->setPath(Core::DocumentManager::projectsDirectory());
const int srcProjectPageId = addPage(m_srcProjectPage);
wizardProgress()->item(srcProjectPageId)->setTitle(tr("Momentics"));
const int destProjectPageId = addPage(m_destProjectPage); 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))); 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); CascadesImportWizardDialog *wizard = new CascadesImportWizardDialog(parent);
foreach (QWizardPage *p, parameters.extensionPages()) foreach (QWizardPage *p, parameters.extensionPages())
BaseFileWizardFactory::applyExtensionPageShortTitle(wizard, wizard->addPage(p)); wizard->addPage(p);
return wizard; return wizard;
} }

View File

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