forked from qt-creator/qt-creator
Vcs: Add method to create a Wizard to the WizardFactory and use it
Implement it in all VCS that support this type of wizard Change-Id: I78b0e4a37e6bf6b25d8cee4b1e96bcc76188047a Reviewed-by: Orgad Shaneh <orgads@gmail.com>
This commit is contained in:
@@ -49,6 +49,11 @@ CloneWizardFactory::CloneWizardFactory()
|
||||
setDisplayName(tr("Git Repository Clone"));
|
||||
}
|
||||
|
||||
VcsBase::BaseCheckoutWizard *CloneWizardFactory::create(const QList<QWizardPage *> ¶meterPages, QWidget *parent) const
|
||||
{
|
||||
return new CloneWizard(parameterPages, parent);
|
||||
}
|
||||
|
||||
QList<QWizardPage*> CloneWizardFactory::createParameterPages(const QString &path)
|
||||
{
|
||||
QList<QWizardPage*> rc;
|
||||
@@ -76,5 +81,13 @@ VcsBase::Command *CloneWizardFactory::createCommand(const QList<QWizardPage*> &p
|
||||
return cwp->createCheckoutJob(checkoutPath);
|
||||
}
|
||||
|
||||
// --------------------------------------------------------------------
|
||||
// CloneWizard:
|
||||
// --------------------------------------------------------------------
|
||||
|
||||
CloneWizard::CloneWizard(const QList<QWizardPage *> ¶meterPages, QWidget *parent) :
|
||||
VcsBase::BaseCheckoutWizard(parameterPages, parent)
|
||||
{ }
|
||||
|
||||
} // namespace Internal
|
||||
} // namespace Git
|
||||
|
||||
@@ -31,6 +31,7 @@
|
||||
#define CLONEWIZARD_H
|
||||
|
||||
#include <vcsbase/basecheckoutwizardfactory.h>
|
||||
#include <vcsbase/basecheckoutwizard.h>
|
||||
|
||||
namespace Git {
|
||||
namespace Internal {
|
||||
@@ -42,6 +43,8 @@ class CloneWizardFactory : public VcsBase::BaseCheckoutWizardFactory
|
||||
public:
|
||||
CloneWizardFactory();
|
||||
|
||||
VcsBase::BaseCheckoutWizard *create(const QList<QWizardPage *> ¶meterPages, QWidget *parent = 0) const;
|
||||
|
||||
private:
|
||||
// BaseCheckoutWizard
|
||||
QList<QWizardPage*> createParameterPages(const QString &path);
|
||||
@@ -49,6 +52,14 @@ private:
|
||||
QString *checkoutPath);
|
||||
};
|
||||
|
||||
class CloneWizard : public VcsBase::BaseCheckoutWizard
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
CloneWizard(const QList<QWizardPage *> ¶meterPages, QWidget *parent = 0);
|
||||
};
|
||||
|
||||
} // namespace Internal
|
||||
} // namespace Git
|
||||
|
||||
|
||||
@@ -77,6 +77,11 @@ GitoriousCloneWizardFactory::GitoriousCloneWizardFactory()
|
||||
setDisplayName(tr("Gitorious Repository Clone"));
|
||||
}
|
||||
|
||||
VcsBase::BaseCheckoutWizard *GitoriousCloneWizardFactory::create(const QList<QWizardPage *> ¶meterPages, QWidget *parent) const
|
||||
{
|
||||
return new GitoriousCloneWizard(parameterPages, parent);
|
||||
}
|
||||
|
||||
QList<QWizardPage*> GitoriousCloneWizardFactory::createParameterPages(const QString &path)
|
||||
{
|
||||
QList<QWizardPage*> rc;
|
||||
@@ -102,5 +107,13 @@ VcsBase::Command *GitoriousCloneWizardFactory::createCommand(const QList<QWizard
|
||||
return cwp->createCheckoutJob(checkoutPath);
|
||||
}
|
||||
|
||||
// --------------------------------------------------------------------
|
||||
// GitoriousCloneWizard:
|
||||
// --------------------------------------------------------------------
|
||||
|
||||
GitoriousCloneWizard::GitoriousCloneWizard(const QList<QWizardPage *> ¶meterPages, QWidget *parent) :
|
||||
VcsBase::BaseCheckoutWizard(parameterPages, parent)
|
||||
{ }
|
||||
|
||||
} // namespace Internal
|
||||
} // namespace Gitorius
|
||||
|
||||
@@ -31,6 +31,7 @@
|
||||
#define GITORIOUSCLONEWIZARD_H
|
||||
|
||||
#include <vcsbase/basecheckoutwizardfactory.h>
|
||||
#include <vcsbase/basecheckoutwizard.h>
|
||||
|
||||
namespace Gitorious {
|
||||
namespace Internal {
|
||||
@@ -44,6 +45,8 @@ class GitoriousCloneWizardFactory : public VcsBase::BaseCheckoutWizardFactory
|
||||
public:
|
||||
GitoriousCloneWizardFactory();
|
||||
|
||||
VcsBase::BaseCheckoutWizard *create(const QList<QWizardPage *> ¶meterPages, QWidget *parent = 0) const;
|
||||
|
||||
private:
|
||||
// BaseCheckoutWizard
|
||||
QList<QWizardPage*> createParameterPages(const QString &path);
|
||||
@@ -51,6 +54,15 @@ private:
|
||||
QString *checkoutPath);
|
||||
};
|
||||
|
||||
class GitoriousCloneWizard : public VcsBase::BaseCheckoutWizard
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
GitoriousCloneWizard(const QList<QWizardPage *> ¶meterPages, QWidget *parent = 0);
|
||||
};
|
||||
|
||||
|
||||
} // namespace Internal
|
||||
} // namespace Gitorious
|
||||
|
||||
|
||||
Reference in New Issue
Block a user