aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/vcsbase
diff options
context:
space:
mode:
authorTobias Hunger <tobias.hunger@theqtcompany.com>2015-05-12 16:12:48 +0200
committerTobias Hunger <tobias.hunger@theqtcompany.com>2015-05-18 13:43:39 +0000
commit3d0b690d315e4006caf505a91143b75f492b6ecc (patch)
treea949a59dd657684d5580d0522598329f047771df /src/plugins/vcsbase
parentbf249dc66094ff71a4d2f65b7504d0f5048af809 (diff)
Git: Replace CloneWizard with a Json wizard
Change-Id: I2188c083665acc239bc98bf857ff57b071805fbc Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Diffstat (limited to 'src/plugins/vcsbase')
-rw-r--r--src/plugins/vcsbase/basecheckoutwizard.cpp136
-rw-r--r--src/plugins/vcsbase/basecheckoutwizard.h80
-rw-r--r--src/plugins/vcsbase/basecheckoutwizardfactory.cpp163
-rw-r--r--src/plugins/vcsbase/basecheckoutwizardfactory.h64
-rw-r--r--src/plugins/vcsbase/basecheckoutwizardpage.cpp262
-rw-r--r--src/plugins/vcsbase/basecheckoutwizardpage.h110
-rw-r--r--src/plugins/vcsbase/basecheckoutwizardpage.ui156
-rw-r--r--src/plugins/vcsbase/vcsbase.pro7
-rw-r--r--src/plugins/vcsbase/vcsbase.qbs7
9 files changed, 0 insertions, 985 deletions
diff --git a/src/plugins/vcsbase/basecheckoutwizard.cpp b/src/plugins/vcsbase/basecheckoutwizard.cpp
deleted file mode 100644
index 6717a2d71d..0000000000
--- a/src/plugins/vcsbase/basecheckoutwizard.cpp
+++ /dev/null
@@ -1,136 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing
-**
-** This file is part of Qt Creator.
-**
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms and
-** conditions see http://www.qt.io/terms-conditions. For further information
-** use the contact form at http://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 2.1 or version 3 as published by the Free
-** Software Foundation and appearing in the file LICENSE.LGPLv21 and
-** LICENSE.LGPLv3 included in the packaging of this file. Please review the
-** following information to ensure the GNU Lesser General Public License
-** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
-** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, The Qt Company gives you certain additional
-** rights. These rights are described in The Qt Company LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-****************************************************************************/
-
-#include "basecheckoutwizard.h"
-#include "basecheckoutwizardfactory.h"
-#include "vcscommand.h"
-#include "wizard/vcsconfigurationpage.h"
-
-#include <coreplugin/iversioncontrol.h>
-#include <coreplugin/vcsmanager.h>
-
-#include <utils/qtcassert.h>
-#include <utils/shellcommandpage.h>
-
-#include <QPushButton>
-
-/*!
- \class VcsBase::Internal::CheckoutWizardDialog
-
- Dialog used by \sa VcsBase::BaseCheckoutWizard. Overwrites reject() to first
- kill the checkout and then close.
- */
-
-namespace VcsBase {
-
-BaseCheckoutWizard::BaseCheckoutWizard(Core::Id vcsId, QWidget *parent) :
- Utils::Wizard(parent),
- m_progressPage(new Utils::ShellCommandPage),
- m_progressPageId(-1),
- m_vcsId(vcsId)
-{
- connect(this, &QWizard::currentIdChanged, this, &BaseCheckoutWizard::slotPageChanged);
- connect(m_progressPage, &Utils::ShellCommandPage::finished,
- this, &BaseCheckoutWizard::slotTerminated);
- setOption(QWizard::NoBackButtonOnLastPage);
-
- const Core::IVersionControl *vc = Core::VcsManager::versionControl(vcsId);
- QTC_ASSERT(vc, return);
-
- if (!vc->isConfigured()) {
- auto configPage = new VcsConfigurationPage;
- configPage->setVersionControl(vc);
- addPage(configPage);
- }
-}
-
-void BaseCheckoutWizard::setTitle(const QString &title)
-{
- m_progressPage->setTitle(title);
-}
-
-void BaseCheckoutWizard::setStartedStatus(const QString &title)
-{
- m_progressPage->setStartedStatus(title);
-}
-
-void BaseCheckoutWizard::slotPageChanged(int id)
-{
- if (id != m_progressPageId)
- return;
-
- VcsBase::VcsCommand *cmd = createCommand(&m_checkoutDir);
- QTC_ASSERT(cmd, done(QDialog::Rejected));
-
- // No "back" available while running.
- button(QWizard::BackButton)->setEnabled(false);
- m_progressPage->start(cmd);
-}
-
-void BaseCheckoutWizard::slotTerminated(bool success)
-{
- // Allow to correct parameters
- if (!success)
- button(QWizard::BackButton)->setEnabled(true);
-}
-
-Utils::FileName BaseCheckoutWizard::run()
-{
- m_progressPageId = addPage(m_progressPage);
- if (Utils::Wizard::exec() == QDialog::Accepted)
- return m_checkoutDir;
- else
- return Utils::FileName();
-}
-
-VcsCommand *BaseCheckoutWizard::createCommandImpl(const QString &url,
- const Utils::FileName &baseDirectory,
- const QString &localName,
- const QStringList &extraArgs)
-{
- Core::IVersionControl *vc = Core::VcsManager::versionControl(m_vcsId);
- QTC_ASSERT(vc, return 0);
- QTC_ASSERT(vc->isConfigured(), return 0);
- QTC_ASSERT(vc->supportsOperation(Core::IVersionControl::InitialCheckoutOperation), return 0);
-
- return static_cast<VcsCommand *>(vc->createInitialCheckoutCommand(url, baseDirectory,
- localName, extraArgs));
-}
-
-void BaseCheckoutWizard::reject()
-{
- // First click kills, 2nd closes
- if (currentId() == m_progressPageId && m_progressPage->isRunning())
- m_progressPage->terminate();
- else
- QWizard::reject();
-}
-
-} // namespace VcsBase
diff --git a/src/plugins/vcsbase/basecheckoutwizard.h b/src/plugins/vcsbase/basecheckoutwizard.h
deleted file mode 100644
index e014986117..0000000000
--- a/src/plugins/vcsbase/basecheckoutwizard.h
+++ /dev/null
@@ -1,80 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing
-**
-** This file is part of Qt Creator.
-**
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms and
-** conditions see http://www.qt.io/terms-conditions. For further information
-** use the contact form at http://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 2.1 or version 3 as published by the Free
-** Software Foundation and appearing in the file LICENSE.LGPLv21 and
-** LICENSE.LGPLv3 included in the packaging of this file. Please review the
-** following information to ensure the GNU Lesser General Public License
-** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
-** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, The Qt Company gives you certain additional
-** rights. These rights are described in The Qt Company LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-****************************************************************************/
-
-#ifndef BASECHECKOUTWIZARD_H
-#define BASECHECKOUTWIZARD_H
-
-#include "vcsbase_global.h"
-
-#include <coreplugin/id.h>
-
-#include <utils/fileutils.h>
-#include <utils/wizard.h>
-
-namespace Utils { class ShellCommandPage; }
-
-namespace VcsBase {
-class VcsCommand;
-
-class VCSBASE_EXPORT BaseCheckoutWizard : public Utils::Wizard
-{
- Q_OBJECT
-
-public:
- explicit BaseCheckoutWizard(Core::Id vcsId, QWidget *parent = 0);
-
- void setTitle(const QString &title);
- void setStartedStatus(const QString &title);
-
- Utils::FileName run();
-
-protected:
- virtual VcsBase::VcsCommand *createCommand(Utils::FileName *checkoutDir) = 0;
-
- VcsBase::VcsCommand *createCommandImpl(const QString &url,
- const Utils::FileName &baseDirectory,
- const QString &localName,
- const QStringList &extraArgs);
-
-private slots:
- void slotPageChanged(int id);
- void slotTerminated(bool success);
- virtual void reject();
-
-private:
- Utils::ShellCommandPage *m_progressPage;
- Utils::FileName m_checkoutDir;
- int m_progressPageId;
- Core::Id m_vcsId;
-};
-
-} // namespace VcsBase
-
-#endif // BASECHECKOUTWIZARD_H
diff --git a/src/plugins/vcsbase/basecheckoutwizardfactory.cpp b/src/plugins/vcsbase/basecheckoutwizardfactory.cpp
deleted file mode 100644
index dfb29ccc6b..0000000000
--- a/src/plugins/vcsbase/basecheckoutwizardfactory.cpp
+++ /dev/null
@@ -1,163 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing
-**
-** This file is part of Qt Creator.
-**
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms and
-** conditions see http://www.qt.io/terms-conditions. For further information
-** use the contact form at http://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 2.1 or version 3 as published by the Free
-** Software Foundation and appearing in the file LICENSE.LGPLv21 and
-** LICENSE.LGPLv3 included in the packaging of this file. Please review the
-** following information to ensure the GNU Lesser General Public License
-** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
-** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, The Qt Company gives you certain additional
-** rights. These rights are described in The Qt Company LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-****************************************************************************/
-
-#include "basecheckoutwizardfactory.h"
-#include "basecheckoutwizard.h"
-
-#include <coreplugin/icontext.h>
-#include <coreplugin/icore.h>
-#include <coreplugin/featureprovider.h>
-
-#include <projectexplorer/projectexplorer.h>
-
-#include <utils/fileutils.h>
-#include <utils/qtcassert.h>
-
-#include <QCoreApplication>
-#include <QDir>
-#include <QMessageBox>
-#include <QScopedPointer>
-
-/*!
- \class VcsBase::BaseCheckoutWizard
-
- \brief The BaseCheckoutWizard class implements a wizard for initially
- checking out a project using a version control system.
-
- Implements all of Core::IWizard with the exception of
- name()/description() and icon().
-
- Pops up a QWizard consisting of a Parameter Page which is created
- by a virtual factory function and a progress
- page containing a log text. The factory function createJob()
- creates a job with the output connected to the log window,
- returning the path to the checkout.
-
- On success, the wizard tries to locate a project file
- and open it.
-
- \sa VcsBase::BaseCheckoutWizardPage
-*/
-
-namespace VcsBase {
-
-BaseCheckoutWizardFactory::BaseCheckoutWizardFactory()
-{
- setWizardKind(IWizardFactory::ProjectWizard);
- setCategory(QLatin1String(ProjectExplorer::Constants::IMPORT_WIZARD_CATEGORY));
- setDisplayCategory(QCoreApplication::translate("ProjectExplorer",
- ProjectExplorer::Constants::IMPORT_WIZARD_CATEGORY_DISPLAY));
- setFlags(Core::IWizardFactory::PlatformIndependent);
-}
-
-void BaseCheckoutWizardFactory::runWizard(const QString &path, QWidget *parent, const QString &platform,
- const QVariantMap &extraValues)
-{
- Q_UNUSED(platform);
- Q_UNUSED(extraValues);
- // Create dialog and launch
-
- Utils::FileName checkoutPath;
- {
- QScopedPointer<BaseCheckoutWizard> wizard(m_wizardCreator(Utils::FileName::fromString(path), parent));
- wizard->setWindowTitle(displayName());
- Core::ICore::registerWindow(wizard.data(), Core::Context("New.CheckoutWizard"));
- checkoutPath = wizard->run();
- }
-
- if (checkoutPath.isEmpty())
- return;
-
- // Now try to find the project file and open
- QString errorMessage;
- const QString projectFile = openProject(checkoutPath, &errorMessage);
- if (projectFile.isEmpty()) {
- QMessageBox msgBox(QMessageBox::Warning, tr("Cannot Open Project"),
- tr("Failed to open project in \"%1\".").arg(checkoutPath.toUserOutput()));
- msgBox.setDetailedText(errorMessage);
- msgBox.addButton(QMessageBox::Ok);
- msgBox.exec();
- }
-}
-
-static inline QString msgNoProjectFiles(const QDir &dir, const QStringList &patterns)
-{
- return BaseCheckoutWizardFactory::tr("Could not find any project files matching (%1) in the directory \"%2\".").arg(patterns.join(QLatin1String(", ")), QDir::toNativeSeparators(dir.absolutePath()));
-}
-
-// Try to find the project files in a project directory with some smartness
-static QFileInfoList findProjectFiles(const QDir &projectDir, QString *errorMessage)
-{
- const QStringList projectFilePatterns = ProjectExplorer::ProjectExplorerPlugin::projectFilePatterns();
- // Project directory
- QFileInfoList projectFiles = projectDir.entryInfoList(projectFilePatterns, QDir::Files|QDir::NoDotAndDotDot|QDir::Readable);
- if (!projectFiles.empty())
- return projectFiles;
- // Try a 'src' directory
- QFileInfoList srcDirs = projectDir.entryInfoList(QStringList(QLatin1String("src")), QDir::Dirs|QDir::NoDotAndDotDot|QDir::Readable);
- if (srcDirs.empty()) {
- *errorMessage = msgNoProjectFiles(projectDir, projectFilePatterns);
- return QFileInfoList();
- }
- const QDir srcDir = QDir(srcDirs.front().absoluteFilePath());
- projectFiles = srcDir.entryInfoList(projectFilePatterns, QDir::Files|QDir::NoDotAndDotDot|QDir::Readable);
- if (projectFiles.empty()) {
- *errorMessage = msgNoProjectFiles(srcDir, projectFilePatterns);
- return QFileInfoList();
- }
- return projectFiles;
-}
-
-QString BaseCheckoutWizardFactory::openProject(const Utils::FileName &path, QString *errorMessage)
-{
- // Search the directory for project files
- const QDir dir(path.toString());
- if (!dir.exists()) {
- *errorMessage = tr("\"%1\" does not exist.").
- arg(path.toUserOutput()); // Should not happen
- return QString();
- }
- QFileInfoList projectFiles = findProjectFiles(dir, errorMessage);
- if (projectFiles.empty())
- return QString();
- // Open. Do not use a busy cursor here as additional wizards might pop up
- const QString projectFile = projectFiles.front().absoluteFilePath();
- if (!ProjectExplorer::ProjectExplorerPlugin::instance()->openProject(projectFile, errorMessage))
- return QString();
-
- return projectFile;
-}
-
-void BaseCheckoutWizardFactory::setWizardCreator(const BaseCheckoutWizardFactory::WizardCreator &creator)
-{
- m_wizardCreator = creator;
-}
-
-} // namespace VcsBase
diff --git a/src/plugins/vcsbase/basecheckoutwizardfactory.h b/src/plugins/vcsbase/basecheckoutwizardfactory.h
deleted file mode 100644
index 46dcb74563..0000000000
--- a/src/plugins/vcsbase/basecheckoutwizardfactory.h
+++ /dev/null
@@ -1,64 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing
-**
-** This file is part of Qt Creator.
-**
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms and
-** conditions see http://www.qt.io/terms-conditions. For further information
-** use the contact form at http://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 2.1 or version 3 as published by the Free
-** Software Foundation and appearing in the file LICENSE.LGPLv21 and
-** LICENSE.LGPLv3 included in the packaging of this file. Please review the
-** following information to ensure the GNU Lesser General Public License
-** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
-** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, The Qt Company gives you certain additional
-** rights. These rights are described in The Qt Company LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-****************************************************************************/
-
-#ifndef BASECHECKOUTWIZARDFACTORY_H
-#define BASECHECKOUTWIZARDFACTORY_H
-
-#include "vcsbase_global.h"
-#include <coreplugin/iwizardfactory.h>
-
-#include <functional>
-
-namespace Utils { class FileName; }
-namespace VcsBase {
-class BaseCheckoutWizard;
-class VcsCommand;
-
-class VCSBASE_EXPORT BaseCheckoutWizardFactory : public Core::IWizardFactory
-{
- Q_OBJECT
-
-public:
- BaseCheckoutWizardFactory();
-
- void runWizard(const QString &path, QWidget *parent, const QString &platform, const QVariantMap &extraValues);
-
- static QString openProject(const Utils::FileName &path, QString *errorMessage);
-
- typedef std::function<BaseCheckoutWizard *(const Utils::FileName &path, QWidget *parent)> WizardCreator;
- void setWizardCreator(const WizardCreator &creator);
-
-private:
- WizardCreator m_wizardCreator;
-};
-
-} // namespace VcsBase
-
-#endif // BASECHECKOUTWIZARDFACTORY_H
diff --git a/src/plugins/vcsbase/basecheckoutwizardpage.cpp b/src/plugins/vcsbase/basecheckoutwizardpage.cpp
deleted file mode 100644
index 82e061d689..0000000000
--- a/src/plugins/vcsbase/basecheckoutwizardpage.cpp
+++ /dev/null
@@ -1,262 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing
-**
-** This file is part of Qt Creator.
-**
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms and
-** conditions see http://www.qt.io/terms-conditions. For further information
-** use the contact form at http://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 2.1 or version 3 as published by the Free
-** Software Foundation and appearing in the file LICENSE.LGPLv21 and
-** LICENSE.LGPLv3 included in the packaging of this file. Please review the
-** following information to ensure the GNU Lesser General Public License
-** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
-** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, The Qt Company gives you certain additional
-** rights. These rights are described in The Qt Company LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-****************************************************************************/
-
-#include "basecheckoutwizardpage.h"
-#include "ui_basecheckoutwizardpage.h"
-
-#include <QDir>
-#include <QIcon>
-
-/*!
- \class VcsBase::BaseCheckoutWizardPage
-
- \brief The BaseCheckoutWizardPage class is the base class for a parameter
- page of a checkout wizard.
-
- Lets the user specify the repository, a checkout directory and
- the path. Contains a virtual to derive the checkout directory
- from the repository as it is entered.
-
- \sa VcsBase::BaseCheckoutWizard
-*/
-
-namespace VcsBase {
-namespace Internal {
-
-class BaseCheckoutWizardPagePrivate
-{
-public:
- BaseCheckoutWizardPagePrivate() : m_valid(false), m_directoryEdited(false) {}
-
- Internal::Ui::BaseCheckoutWizardPage ui;
- bool m_valid;
- bool m_directoryEdited;
-};
-
-} // namespace Internal
-
-BaseCheckoutWizardPage::BaseCheckoutWizardPage(QWidget *parent) :
- QWizardPage(parent),
- d(new Internal::BaseCheckoutWizardPagePrivate)
-{
- d->ui.setupUi(this);
-
- connect(d->ui.repositoryLineEdit, &QLineEdit::textChanged,
- this, &BaseCheckoutWizardPage::slotRepositoryChanged);
-
- connect(d->ui.checkoutDirectoryLineEdit, &QLineEdit::textChanged,
- this, &BaseCheckoutWizardPage::slotChanged);
- connect(d->ui.checkoutDirectoryLineEdit, &QLineEdit::textEdited,
- this, &BaseCheckoutWizardPage::slotDirectoryEdited);
- connect(d->ui.branchComboBox,
- static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged),
- this, &BaseCheckoutWizardPage::slotChanged);
-
- d->ui.pathChooser->setExpectedKind(Utils::PathChooser::ExistingDirectory);
- d->ui.pathChooser->setHistoryCompleter(QLatin1String("Vcs.CheckoutDir.History"));
- connect(d->ui.pathChooser, &Utils::PathChooser::validChanged,
- this, &BaseCheckoutWizardPage::slotChanged);
-
- d->ui.branchComboBox->setEnabled(false);
- d->ui.branchRefreshToolButton->setIcon(QIcon(QLatin1String(":/locator/images/reload.png")));
- connect(d->ui.branchRefreshToolButton, &QAbstractButton::clicked,
- this, &BaseCheckoutWizardPage::slotRefreshBranches);
-}
-
-BaseCheckoutWizardPage::~BaseCheckoutWizardPage()
-{
- delete d;
-}
-
-void BaseCheckoutWizardPage::addLocalControl(QWidget *w)
-{
- d->ui.localLayout->addRow(w);
-}
-
-void BaseCheckoutWizardPage::addLocalControl(QString &description, QWidget *w)
-{
- d->ui.localLayout->addRow(description, w);
-}
-
-void BaseCheckoutWizardPage::addRepositoryControl(QWidget *w)
-{
- d->ui.repositoryLayout->addRow(w);
-}
-
-bool BaseCheckoutWizardPage::checkIsValid() const
-{
- if (!d->ui.pathChooser->isValid() || d->ui.repositoryLineEdit->text().isEmpty())
- return false;
-
- const QString checkoutDirectory = d->ui.checkoutDirectoryLineEdit->text();
- if (checkoutDirectory.isEmpty())
- return false;
- const QDir dir(d->ui.pathChooser->path() + QLatin1Char('/') + checkoutDirectory);
- return !dir.exists() || (dir.count() <= 2);
-}
-
-void BaseCheckoutWizardPage::addRepositoryControl(QString &description, QWidget *w)
-{
- d->ui.repositoryLayout->addRow(description, w);
-}
-
-bool BaseCheckoutWizardPage::isBranchSelectorVisible() const
-{
- return d->ui.branchComboBox->isVisible();
-}
-
-void BaseCheckoutWizardPage::setBranchSelectorVisible(bool v)
-{
- d->ui.branchComboBox->setVisible(v);
- d->ui.branchRefreshToolButton->setVisible(v);
- d->ui.branchLabel->setVisible(v);
-}
-
-void BaseCheckoutWizardPage::setRepositoryLabel(const QString &l)
-{
- d->ui.repositoryLabel->setText(l);
-}
-
-bool BaseCheckoutWizardPage::isRepositoryReadOnly() const
-{
- return d->ui.repositoryLineEdit->isReadOnly();
-}
-
-void BaseCheckoutWizardPage::setRepositoryReadOnly(bool v)
-{
- d->ui.repositoryLineEdit->setReadOnly(v);
-}
-
-QString BaseCheckoutWizardPage::path() const
-{
- return d->ui.pathChooser->path();
-}
-
-void BaseCheckoutWizardPage::setPath(const QString &p)
-{
- d->ui.pathChooser->setPath(p);
-}
-
-QString BaseCheckoutWizardPage::directory() const
-{
- return d->ui.checkoutDirectoryLineEdit->text();
-}
-
-void BaseCheckoutWizardPage::setDirectory(const QString &dir)
-{
- d->ui.checkoutDirectoryLineEdit->setText(dir);
-}
-
-void BaseCheckoutWizardPage::setDirectoryVisible(bool v)
-{
- d->ui.checkoutDirectoryLabel->setVisible(v);
- d->ui.checkoutDirectoryLineEdit->setVisible(v);
-}
-
-QString BaseCheckoutWizardPage::repository() const
-{
- return d->ui.repositoryLineEdit->text().trimmed();
-}
-
-void BaseCheckoutWizardPage::setRepository(const QString &r)
-{
- d->ui.repositoryLineEdit->setText(r);
-}
-
-QString BaseCheckoutWizardPage::branch() const
-{
- return d->ui.branchComboBox->currentText();
-}
-
-void BaseCheckoutWizardPage::setBranch(const QString &b)
-{
- const int index = d->ui.branchComboBox->findText(b);
- if (index != -1)
- d->ui.branchComboBox->setCurrentIndex(index);
-}
-
-void BaseCheckoutWizardPage::slotRefreshBranches()
-{
- if (!isBranchSelectorVisible())
- return;
- // Refresh branch list on demand. This is hard to make
- // automagically since there can be network slowness/timeouts, etc.
- int current;
- const QStringList branchList = branches(repository(), &current);
- d->ui.branchComboBox->clear();
- d->ui.branchComboBox->setEnabled(branchList.size() > 1);
- if (!branchList.isEmpty()) {
- d->ui.branchComboBox->addItems(branchList);
- if (current >= 0 && current < branchList.size())
- d->ui.branchComboBox->setCurrentIndex(current);
- }
- slotChanged();
-}
-
-void BaseCheckoutWizardPage::slotRepositoryChanged(const QString &repo)
-{
- // Derive directory name from repository unless user manually edited it.
- if (!d->m_directoryEdited)
- d->ui.checkoutDirectoryLineEdit->setText(directoryFromRepository(repo));
- slotChanged();
-}
-
-QString BaseCheckoutWizardPage::directoryFromRepository(const QString &r) const
-{
- return r;
-}
-
-QStringList BaseCheckoutWizardPage::branches(const QString &, int *)
-{
- return QStringList();
-}
-
-void BaseCheckoutWizardPage::slotDirectoryEdited()
-{
- d->m_directoryEdited = true;
- slotChanged();
-}
-
-bool BaseCheckoutWizardPage::isComplete() const
-{
- return d->m_valid;
-}
-
-void BaseCheckoutWizardPage::slotChanged()
-{
- const bool valid = checkIsValid();
-
- if (valid != d->m_valid) {
- d->m_valid = valid;
- emit completeChanged();
- }
-}
-
-} // namespace VcsBase
diff --git a/src/plugins/vcsbase/basecheckoutwizardpage.h b/src/plugins/vcsbase/basecheckoutwizardpage.h
deleted file mode 100644
index b4074ce772..0000000000
--- a/src/plugins/vcsbase/basecheckoutwizardpage.h
+++ /dev/null
@@ -1,110 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing
-**
-** This file is part of Qt Creator.
-**
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms and
-** conditions see http://www.qt.io/terms-conditions. For further information
-** use the contact form at http://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 2.1 or version 3 as published by the Free
-** Software Foundation and appearing in the file LICENSE.LGPLv21 and
-** LICENSE.LGPLv3 included in the packaging of this file. Please review the
-** following information to ensure the GNU Lesser General Public License
-** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
-** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, The Qt Company gives you certain additional
-** rights. These rights are described in The Qt Company LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-****************************************************************************/
-
-#ifndef VCSBASE_CHECKOUTWIZARDPAGE_H
-#define VCSBASE_CHECKOUTWIZARDPAGE_H
-
-#include "vcsbase_global.h"
-
-#include <QWizardPage>
-
-namespace VcsBase {
-
-namespace Internal {
-class BaseCheckoutWizardPagePrivate;
-
-namespace Ui { class BaseCheckoutWizardPage; }
-} // namespace Internal
-
-
-class VCSBASE_EXPORT BaseCheckoutWizardPage : public QWizardPage
-{
- Q_OBJECT
- Q_PROPERTY(bool isBranchSelectorVisible READ isBranchSelectorVisible
- WRITE setBranchSelectorVisible)
-
-public:
- BaseCheckoutWizardPage(QWidget *parent = 0);
- ~BaseCheckoutWizardPage();
-
- QString path() const;
- void setPath(const QString &);
-
- QString directory() const;
- void setDirectory(const QString &d);
-
- QString repository() const;
- void setRepository(const QString &r);
-
- bool isRepositoryReadOnly() const;
- void setRepositoryReadOnly(bool v);
-
- QString branch() const;
- void setBranch(const QString &);
-
- virtual bool isComplete() const;
-
- bool isBranchSelectorVisible() const;
-
-protected:
- void setRepositoryLabel(const QString &l);
- void setDirectoryVisible(bool v);
- void setBranchSelectorVisible(bool v);
-
- // Determine a checkout directory name from
- // repository URL, that is, "protocol:/project" -> "project".
- virtual QString directoryFromRepository(const QString &r) const;
-
- // Return list of branches of that repository, defaults to empty.
- virtual QStringList branches(const QString &repository, int *current);
-
- // Add additional controls.
- void addLocalControl(QWidget *w);
- void addLocalControl(QString &description, QWidget *w);
-
- void addRepositoryControl(QWidget *w);
- void addRepositoryControl(QString &description, QWidget *w);
-
- // Override validity information.
- virtual bool checkIsValid() const;
-
-private slots:
- void slotRepositoryChanged(const QString &url);
- void slotDirectoryEdited();
- void slotChanged();
- void slotRefreshBranches();
-
-private:
- Internal::BaseCheckoutWizardPagePrivate *const d;
-};
-
-} // namespace VcsBase
-
-#endif // VCSBASE_CHECKOUTWIZARDPAGE_H
diff --git a/src/plugins/vcsbase/basecheckoutwizardpage.ui b/src/plugins/vcsbase/basecheckoutwizardpage.ui
deleted file mode 100644
index edf34f080b..0000000000
--- a/src/plugins/vcsbase/basecheckoutwizardpage.ui
+++ /dev/null
@@ -1,156 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<ui version="4.0">
- <class>VcsBase::Internal::BaseCheckoutWizardPage</class>
- <widget class="QWizardPage" name="VcsBase::Internal::BaseCheckoutWizardPage">
- <property name="geometry">
- <rect>
- <x>0</x>
- <y>0</y>
- <width>483</width>
- <height>237</height>
- </rect>
- </property>
- <property name="windowTitle">
- <string>WizardPage</string>
- </property>
- <layout class="QVBoxLayout" name="verticalLayout">
- <item>
- <widget class="QGroupBox" name="repositoryGroupBox">
- <property name="title">
- <string>Repository</string>
- </property>
- <property name="flat">
- <bool>true</bool>
- </property>
- <property name="checkable">
- <bool>false</bool>
- </property>
- <layout class="QFormLayout" name="repositoryLayout">
- <item row="0" column="0">
- <widget class="QLabel" name="repositoryLabel"/>
- </item>
- <item row="0" column="1">
- <widget class="QLineEdit" name="repositoryLineEdit">
- <property name="toolTip">
- <string>The remote repository to check out.</string>
- </property>
- <property name="whatsThis">
- <string/>
- </property>
- </widget>
- </item>
- <item row="1" column="0">
- <widget class="QLabel" name="branchLabel">
- <property name="text">
- <string>Branch:</string>
- </property>
- </widget>
- </item>
- <item row="1" column="1">
- <layout class="QHBoxLayout" name="branchHorizontalLayout">
- <item>
- <widget class="QComboBox" name="branchComboBox">
- <property name="sizePolicy">
- <sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="toolTip">
- <string>The development branch in the remote repository to check out.</string>
- </property>
- <property name="whatsThis">
- <string/>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QToolButton" name="branchRefreshToolButton">
- <property name="toolTip">
- <string>Retrieve list of branches in repository.</string>
- </property>
- <property name="text">
- <string>...</string>
- </property>
- </widget>
- </item>
- </layout>
- </item>
- </layout>
- </widget>
- </item>
- <item>
- <widget class="QGroupBox" name="localGroupBox">
- <property name="title">
- <string>Working Copy</string>
- </property>
- <property name="flat">
- <bool>true</bool>
- </property>
- <layout class="QFormLayout" name="localLayout">
- <item row="0" column="0">
- <widget class="QLabel" name="pathLabel">
- <property name="toolTip">
- <string>The path in which the directory containing the checkout will be created.</string>
- </property>
- <property name="text">
- <string>Path:</string>
- </property>
- </widget>
- </item>
- <item row="0" column="1">
- <widget class="Utils::PathChooser" name="pathChooser" native="true"/>
- </item>
- <item row="1" column="0">
- <widget class="QLabel" name="checkoutDirectoryLabel">
- <property name="toolTip">
- <string>The local directory that will contain the code after the checkout.</string>
- </property>
- <property name="text">
- <string>Directory:</string>
- </property>
- </widget>
- </item>
- <item row="1" column="1">
- <widget class="QLineEdit" name="checkoutDirectoryLineEdit">
- <property name="toolTip">
- <string>The local directory that will contain the code after the checkout.</string>
- </property>
- <property name="whatsThis">
- <string/>
- </property>
- </widget>
- </item>
- </layout>
- </widget>
- </item>
- <item>
- <spacer name="verticalSpacer">
- <property name="orientation">
- <enum>Qt::Vertical</enum>
- </property>
- <property name="sizeHint" stdset="0">
- <size>
- <width>20</width>
- <height>0</height>
- </size>
- </property>
- </spacer>
- </item>
- </layout>
- </widget>
- <customwidgets>
- <customwidget>
- <class>Utils::PathChooser</class>
- <extends>QWidget</extends>
- <header location="global">utils/pathchooser.h</header>
- <container>1</container>
- <slots>
- <signal>editingFinished()</signal>
- <signal>browsingFinished()</signal>
- </slots>
- </customwidget>
- </customwidgets>
- <resources/>
- <connections/>
-</ui>
diff --git a/src/plugins/vcsbase/vcsbase.pro b/src/plugins/vcsbase/vcsbase.pro
index fb44846f2f..b433f81743 100644
--- a/src/plugins/vcsbase/vcsbase.pro
+++ b/src/plugins/vcsbase/vcsbase.pro
@@ -20,9 +20,6 @@ HEADERS += vcsbase_global.h \
commonvcssettings.h \
commonsettingspage.h \
nicknamedialog.h \
- basecheckoutwizardfactory.h \
- basecheckoutwizard.h \
- basecheckoutwizardpage.h \
vcsoutputwindow.h \
cleandialog.h \
vcsbaseoptionspage.h \
@@ -51,9 +48,6 @@ SOURCES += vcsplugin.cpp \
commonvcssettings.cpp \
commonsettingspage.cpp \
nicknamedialog.cpp \
- basecheckoutwizardfactory.cpp \
- basecheckoutwizard.cpp \
- basecheckoutwizardpage.cpp \
vcsoutputwindow.cpp \
cleandialog.cpp \
vcsbaseoptionspage.cpp \
@@ -68,6 +62,5 @@ RESOURCES += vcsbase.qrc
FORMS += commonsettingspage.ui \
nicknamedialog.ui \
- basecheckoutwizardpage.ui \
cleandialog.ui \
submiteditorwidget.ui
diff --git a/src/plugins/vcsbase/vcsbase.qbs b/src/plugins/vcsbase/vcsbase.qbs
index dcc28012a0..d278208224 100644
--- a/src/plugins/vcsbase/vcsbase.qbs
+++ b/src/plugins/vcsbase/vcsbase.qbs
@@ -16,13 +16,6 @@ QtcPlugin {
files: [
"baseannotationhighlighter.cpp",
"baseannotationhighlighter.h",
- "basecheckoutwizard.cpp",
- "basecheckoutwizard.h",
- "basecheckoutwizardfactory.cpp",
- "basecheckoutwizardfactory.h",
- "basecheckoutwizardpage.cpp",
- "basecheckoutwizardpage.h",
- "basecheckoutwizardpage.ui",
"basevcseditorfactory.cpp",
"basevcseditorfactory.h",
"basevcssubmiteditorfactory.cpp",