diff options
Diffstat (limited to 'src/plugins/vcsbase/basecheckoutwizard.cpp')
-rw-r--r-- | src/plugins/vcsbase/basecheckoutwizard.cpp | 65 |
1 files changed, 20 insertions, 45 deletions
diff --git a/src/plugins/vcsbase/basecheckoutwizard.cpp b/src/plugins/vcsbase/basecheckoutwizard.cpp index 7999c6ea99..48ba1264c8 100644 --- a/src/plugins/vcsbase/basecheckoutwizard.cpp +++ b/src/plugins/vcsbase/basecheckoutwizard.cpp @@ -29,7 +29,6 @@ #include "basecheckoutwizard.h" #include "checkoutwizarddialog.h" -#include "checkoutjobs.h" #include <coreplugin/featureprovider.h> @@ -72,7 +71,8 @@ public: Internal::CheckoutWizardDialog *dialog; QList<QWizardPage *> parameterPages; QString checkoutPath; - QString id; + QString progressTitle; + QString startedStatus; }; void BaseCheckoutWizardPrivate::clear() @@ -88,6 +88,11 @@ BaseCheckoutWizard::BaseCheckoutWizard(QObject *parent) : Core::IWizard(parent), d(new Internal::BaseCheckoutWizardPrivate) { + setWizardKind(IWizard::ProjectWizard); + setCategory(QLatin1String(ProjectExplorer::Constants::IMPORT_WIZARD_CATEGORY)); + setDisplayCategory(QCoreApplication::translate("ProjectExplorer", + ProjectExplorer::Constants::IMPORT_WIZARD_CATEGORY_DISPLAY)); + setFlags(Core::IWizard::PlatformIndependent); } BaseCheckoutWizard::~BaseCheckoutWizard() @@ -95,42 +100,16 @@ BaseCheckoutWizard::~BaseCheckoutWizard() delete d; } -Core::IWizard::WizardKind BaseCheckoutWizard::kind() const -{ - return Core::IWizard::ProjectWizard; -} - -QString BaseCheckoutWizard::category() const -{ - return QLatin1String(ProjectExplorer::Constants::IMPORT_WIZARD_CATEGORY); -} - -QString BaseCheckoutWizard::displayCategory() const -{ - return QCoreApplication::translate("ProjectExplorer", ProjectExplorer::Constants::IMPORT_WIZARD_CATEGORY_DISPLAY); -} - -QString BaseCheckoutWizard::id() const -{ - return d->id; -} - -QString BaseCheckoutWizard::descriptionImage() const -{ - return QString(); -} - -void BaseCheckoutWizard::setId(const QString &id) -{ - d->id = id; -} - void BaseCheckoutWizard::runWizard(const QString &path, QWidget *parent, const QString & /*platform*/, const QVariantMap &extraValues) { Q_UNUSED(extraValues) // Create dialog and launch d->parameterPages = createParameterPages(path); Internal::CheckoutWizardDialog dialog(d->parameterPages, parent); + if (!d->progressTitle.isEmpty()) + dialog.setTitle(d->progressTitle); + if (!d->startedStatus.isEmpty()) + dialog.setStartedStatus(d->startedStatus); d->dialog = &dialog; connect(&dialog, SIGNAL(progressPageShown()), this, SLOT(slotProgressPageShown())); dialog.setWindowTitle(displayName()); @@ -149,16 +128,6 @@ void BaseCheckoutWizard::runWizard(const QString &path, QWidget *parent, const Q } } -Core::FeatureSet BaseCheckoutWizard::requiredFeatures() const -{ - return Core::FeatureSet(); -} - -Core::IWizard::WizardFlags BaseCheckoutWizard::flags() const -{ - return Core::IWizard::PlatformIndependent; -} - static inline QString msgNoProjectFiles(const QDir &dir, const QStringList &patterns) { return BaseCheckoutWizard::tr("Could not find any project files matching (%1) in the directory '%2'.").arg(patterns.join(QLatin1String(", ")), QDir::toNativeSeparators(dir.absolutePath())); @@ -184,7 +153,7 @@ static QFileInfoList findProjectFiles(const QDir &projectDir, QString *errorMess *errorMessage = msgNoProjectFiles(srcDir, projectFilePatterns); return QFileInfoList(); } - return projectFiles;; + return projectFiles; } QString BaseCheckoutWizard::openProject(const QString &path, QString *errorMessage) @@ -213,10 +182,16 @@ QString BaseCheckoutWizard::openProject(const QString &path, QString *errorMessa return projectFile; } +void BaseCheckoutWizard::setCustomLabels(const QString &progressTitle, const QString &startedStatus) +{ + d->progressTitle = progressTitle; + d->startedStatus = startedStatus; +} + void BaseCheckoutWizard::slotProgressPageShown() { - const QSharedPointer<AbstractCheckoutJob> job = createJob(d->parameterPages, &(d->checkoutPath)); - d->dialog->start(job); + Command *command = createCommand(d->parameterPages, &(d->checkoutPath)); + d->dialog->start(command); } } // namespace VcsBase |