forked from qt-creator/qt-creator
VcsBase: Remove BaseCheckoutWizard::setCustomLabels()
Also assert that d->wizard is not in use already and use d->wizard consistently. Change-Id: I85599f80e92edb2a0a0fc52c5fed1e484d0beac9 Reviewed-by: Orgad Shaneh <orgads@gmail.com>
This commit is contained in:
@@ -46,7 +46,6 @@ using namespace Bazaar::Internal;
|
||||
CloneWizardFactory::CloneWizardFactory()
|
||||
{
|
||||
setId(QLatin1String(VcsBase::Constants::VCS_ID_BAZAAR));
|
||||
setCustomLabels(tr("Cloning"), tr("Cloning started..."));
|
||||
setIcon(QIcon(QLatin1String(":/bazaar/images/bazaar.png")));
|
||||
setDescription(tr("Clones a Bazaar branch and tries to load the contained project."));
|
||||
setDisplayName(tr("Bazaar Clone (Or Branch)"));
|
||||
@@ -115,4 +114,7 @@ VcsBase::Command *CloneWizardFactory::createCommand(const QList<QWizardPage *> &
|
||||
|
||||
CloneWizard::CloneWizard(const QList<QWizardPage *> ¶meterPages, QWidget *parent) :
|
||||
VcsBase::BaseCheckoutWizard(parameterPages, parent)
|
||||
{ }
|
||||
{
|
||||
setTitle(tr("Cloning"));
|
||||
setStartedStatus(tr("Cloning started..."));
|
||||
}
|
||||
|
||||
@@ -43,7 +43,6 @@ namespace Internal {
|
||||
CloneWizardFactory::CloneWizardFactory()
|
||||
{
|
||||
setId(QLatin1String(VcsBase::Constants::VCS_ID_GIT));
|
||||
setCustomLabels(tr("Cloning"), tr("Cloning started..."));
|
||||
setIcon(QIcon(QLatin1String(":/git/images/git.png")));
|
||||
setDescription(tr("Clones a Git repository and tries to load the contained project."));
|
||||
setDisplayName(tr("Git Repository Clone"));
|
||||
@@ -87,7 +86,10 @@ VcsBase::Command *CloneWizardFactory::createCommand(const QList<QWizardPage*> &p
|
||||
|
||||
CloneWizard::CloneWizard(const QList<QWizardPage *> ¶meterPages, QWidget *parent) :
|
||||
VcsBase::BaseCheckoutWizard(parameterPages, parent)
|
||||
{ }
|
||||
{
|
||||
setTitle(tr("Cloning"));
|
||||
setStartedStatus(tr("Cloning started..."));
|
||||
}
|
||||
|
||||
} // namespace Internal
|
||||
} // namespace Git
|
||||
|
||||
@@ -43,7 +43,6 @@ using namespace VcsBase;
|
||||
CloneWizardFactory::CloneWizardFactory()
|
||||
{
|
||||
setId(QLatin1String(Constants::VCS_ID_MERCURIAL));
|
||||
setCustomLabels(tr("Cloning"), tr("Cloning started..."));
|
||||
setIcon(QIcon(QLatin1String(":/mercurial/images/hg.png")));
|
||||
setDescription(tr("Clones a Mercurial repository and tries to load the contained project."));
|
||||
setDisplayName(tr("Mercurial Clone"));
|
||||
@@ -94,4 +93,7 @@ Command *CloneWizardFactory::createCommand(const QList<QWizardPage *> ¶meter
|
||||
|
||||
CloneWizard::CloneWizard(const QList<QWizardPage *> ¶meterPages, QWidget *parent) :
|
||||
VcsBase::BaseCheckoutWizard(parameterPages, parent)
|
||||
{ }
|
||||
{
|
||||
setTitle(tr("Cloning"));
|
||||
setStartedStatus(tr("Cloning started..."));
|
||||
}
|
||||
|
||||
@@ -34,6 +34,8 @@
|
||||
|
||||
#include <projectexplorer/projectexplorer.h>
|
||||
|
||||
#include <utils/qtcassert.h>
|
||||
|
||||
#include <QCoreApplication>
|
||||
#include <QDir>
|
||||
#include <QMessageBox>
|
||||
@@ -71,8 +73,6 @@ public:
|
||||
BaseCheckoutWizard *wizard;
|
||||
QList<QWizardPage *> parameterPages;
|
||||
QString checkoutPath;
|
||||
QString progressTitle;
|
||||
QString startedStatus;
|
||||
};
|
||||
|
||||
void BaseCheckoutWizardFactoryPrivate::clear()
|
||||
@@ -105,18 +105,14 @@ void BaseCheckoutWizardFactory::runWizard(const QString &path, QWidget *parent,
|
||||
{
|
||||
Q_UNUSED(platform);
|
||||
Q_UNUSED(extraValues);
|
||||
QTC_ASSERT(!d->wizard, return);
|
||||
// Create dialog and launch
|
||||
|
||||
d->parameterPages = createParameterPages(path);
|
||||
BaseCheckoutWizard *wizard = create(d->parameterPages, parent);
|
||||
if (!d->progressTitle.isEmpty())
|
||||
wizard->setTitle(d->progressTitle);
|
||||
if (!d->startedStatus.isEmpty())
|
||||
wizard->setStartedStatus(d->startedStatus);
|
||||
d->wizard = wizard;
|
||||
connect(wizard, SIGNAL(progressPageShown()), this, SLOT(slotProgressPageShown()));
|
||||
wizard->setWindowTitle(displayName());
|
||||
if (wizard->exec() != QDialog::Accepted)
|
||||
d->wizard = create(d->parameterPages, parent);
|
||||
connect(d->wizard, SIGNAL(progressPageShown()), this, SLOT(slotProgressPageShown()));
|
||||
d->wizard->setWindowTitle(displayName());
|
||||
if (d->wizard->exec() != QDialog::Accepted)
|
||||
return;
|
||||
// Now try to find the project file and open
|
||||
const QString checkoutPath = d->checkoutPath;
|
||||
@@ -180,12 +176,6 @@ QString BaseCheckoutWizardFactory::openProject(const QString &path, QString *err
|
||||
return projectFile;
|
||||
}
|
||||
|
||||
void BaseCheckoutWizardFactory::setCustomLabels(const QString &progressTitle, const QString &startedStatus)
|
||||
{
|
||||
d->progressTitle = progressTitle;
|
||||
d->startedStatus = startedStatus;
|
||||
}
|
||||
|
||||
void BaseCheckoutWizardFactory::slotProgressPageShown()
|
||||
{
|
||||
Command *command = createCommand(d->parameterPages, &(d->checkoutPath));
|
||||
|
||||
@@ -61,7 +61,6 @@ public:
|
||||
virtual BaseCheckoutWizard *create(const QList<QWizardPage *> ¶meterPages, QWidget *parent = 0) const = 0;
|
||||
|
||||
protected:
|
||||
void setCustomLabels(const QString &progressTitle, const QString &startedStatus);
|
||||
virtual QList<QWizardPage *> createParameterPages(const QString &path) = 0;
|
||||
virtual Command *createCommand(const QList<QWizardPage *> ¶meterPages,
|
||||
QString *checkoutPath) = 0;
|
||||
|
||||
Reference in New Issue
Block a user