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