Unify wizards with TOC and cancel button.

QTBUG-28385 is biting us over and over (QWizard doesn't have close
button nor cancel button on Mac in Qt 5), and actually there's no reason
for us having a wizard without the features from Utils::Wizard.

Task-number: QTCREATORBUG-10346
Task-number: QTBUG-28385
Change-Id: I80c0d82fe6738496c2ac03c31a1c2757ade8e266
Reviewed-by: Jarek Kobus <jaroslaw.kobus@digia.com>
Reviewed-by: Daniel Teske <daniel.teske@digia.com>
This commit is contained in:
Eike Ziller
2013-10-09 11:20:26 +02:00
parent 1ba9c8ef14
commit 56c3d8ffab
33 changed files with 41 additions and 92 deletions

View File

@@ -37,7 +37,6 @@
#include <utils/filewizarddialog.h>
#include <utils/qtcassert.h>
#include <utils/stringutils.h>
#include <utils/hostosinfo.h>
#include <QDir>
#include <QFileInfo>
@@ -345,28 +344,6 @@ bool BaseFileWizard::writeFiles(const GeneratedFiles &files, QString *errorMessa
return true;
}
/*!
Sets some standard options on a QWizard.
*/
void BaseFileWizard::setupWizard(QWizard *w)
{
w->setOption(QWizard::NoCancelButton, false);
w->setOption(QWizard::NoDefaultButton, false);
w->setOption(QWizard::NoBackButtonOnStartPage, true);
w->setWindowFlags(w->windowFlags() & ~Qt::WindowContextHelpButtonHint);
if (Utils::HostOsInfo::isMacHost()) {
w->setButtonLayout(QList<QWizard::WizardButton>()
<< QWizard::CancelButton
<< QWizard::Stretch
<< QWizard::BackButton
<< QWizard::NextButton
<< QWizard::CommitButton
<< QWizard::FinishButton);
}
}
/*!
Reads the \c shortTitle dynamic property of \a pageId and applies it as
the title of corresponding progress item.
@@ -571,7 +548,6 @@ QWizard *StandardFileWizard::createWizardDialog(QWidget *parent,
if (wizardDialogParameters.flags().testFlag(WizardDialogParameters::ForceCapitalLetterForFileName))
standardWizardDialog->setForceFirstCapitalLetterForFileName(true);
standardWizardDialog->setWindowTitle(tr("New %1").arg(displayName()));
setupWizard(standardWizardDialog);
standardWizardDialog->setPath(wizardDialogParameters.defaultPath());
foreach (QWizardPage *p, wizardDialogParameters.extensionPages())
BaseFileWizard::applyExtensionPageShortTitle(standardWizardDialog, standardWizardDialog->addPage(p));