diff options
author | Tobias Hunger <tobias.hunger@theqtcompany.com> | 2015-05-12 15:26:34 +0200 |
---|---|---|
committer | Tobias Hunger <tobias.hunger@theqtcompany.com> | 2015-05-18 08:14:03 +0000 |
commit | 5aeccb3be64e2292986cdfdf845495b608f4ed2f (patch) | |
tree | 0c99df41d17c033badb2023bdad9404fd82ab265 /src/plugins/mercurial | |
parent | b02b0c8d6df16ed769b4a563d089194b4cda5941 (diff) |
Mercurial: Replace CloneWizard with a Json wizard
Change-Id: Idcf5c523010ecb46d0ec6fa9475d182d14984852
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Diffstat (limited to 'src/plugins/mercurial')
-rw-r--r-- | src/plugins/mercurial/clonewizard.cpp | 77 | ||||
-rw-r--r-- | src/plugins/mercurial/clonewizard.h | 54 | ||||
-rw-r--r-- | src/plugins/mercurial/clonewizardpage.cpp | 59 | ||||
-rw-r--r-- | src/plugins/mercurial/clonewizardpage.h | 52 | ||||
-rw-r--r-- | src/plugins/mercurial/images/hg.png | bin | 1138 -> 0 bytes | |||
-rw-r--r-- | src/plugins/mercurial/mercurial.pro | 5 | ||||
-rw-r--r-- | src/plugins/mercurial/mercurial.qbs | 5 | ||||
-rw-r--r-- | src/plugins/mercurial/mercurial.qrc | 5 | ||||
-rw-r--r-- | src/plugins/mercurial/mercurialplugin.cpp | 11 |
9 files changed, 0 insertions, 268 deletions
diff --git a/src/plugins/mercurial/clonewizard.cpp b/src/plugins/mercurial/clonewizard.cpp deleted file mode 100644 index 1ac5e63fa5..0000000000 --- a/src/plugins/mercurial/clonewizard.cpp +++ /dev/null @@ -1,77 +0,0 @@ -/************************************************************************** -** -** Copyright (C) 2015 Brian McGillion -** 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 "clonewizard.h" -#include "clonewizardpage.h" -#include "mercurialclient.h" -#include "mercurialplugin.h" -#include "mercurialsettings.h" - -#include <coreplugin/iversioncontrol.h> -#include <vcsbase/vcscommand.h> -#include <vcsbase/vcsbaseconstants.h> -#include <vcsbase/wizard/vcsconfigurationpage.h> - -#include <utils/qtcassert.h> - -using namespace VcsBase; - -namespace Mercurial { -namespace Internal { -// -------------------------------------------------------------------- -// CloneWizard: -// -------------------------------------------------------------------- - -CloneWizard::CloneWizard(const Utils::FileName &path, QWidget *parent) : - BaseCheckoutWizard(Constants::VCS_ID_MERCURIAL, parent) -{ - setTitle(tr("Cloning")); - setStartedStatus(tr("Cloning started...")); - - auto page = new CloneWizardPage; - page->setPath(path.toString()); - addPage(page); -} - -VcsCommand *CloneWizard::createCommand(Utils::FileName *checkoutDir) -{ - const CloneWizardPage *cwp = find<CloneWizardPage>(); - QTC_ASSERT(cwp, return 0); - - const Utils::FileName path = Utils::FileName::fromString(cwp->path()); - const QString directory = cwp->directory(); - - *checkoutDir = Utils::FileName::fromString(path.toString() + QLatin1Char('/') + directory); - - return createCommandImpl(cwp->repository(), path, directory, QStringList()); -} - -} // namespace Internal -} // namespace Mercurial diff --git a/src/plugins/mercurial/clonewizard.h b/src/plugins/mercurial/clonewizard.h deleted file mode 100644 index 798f4e962c..0000000000 --- a/src/plugins/mercurial/clonewizard.h +++ /dev/null @@ -1,54 +0,0 @@ -/************************************************************************** -** -** Copyright (C) 2015 Brian McGillion -** 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 CLONEWIZARD_H -#define CLONEWIZARD_H - -#include <vcsbase/basecheckoutwizardfactory.h> -#include <vcsbase/basecheckoutwizard.h> - -namespace Mercurial { -namespace Internal { - -class CloneWizard : public VcsBase::BaseCheckoutWizard -{ - Q_OBJECT - -public: - CloneWizard(const Utils::FileName &path, QWidget *parent = 0); - -protected: - VcsBase::VcsCommand *createCommand(Utils::FileName *checkoutDir); -}; - -} //namespace Internal -} //namespace Mercurial - -#endif // CLONEWIZARD_H diff --git a/src/plugins/mercurial/clonewizardpage.cpp b/src/plugins/mercurial/clonewizardpage.cpp deleted file mode 100644 index 34507a991c..0000000000 --- a/src/plugins/mercurial/clonewizardpage.cpp +++ /dev/null @@ -1,59 +0,0 @@ -/************************************************************************** -** -** Copyright (C) 2015 Brian McGillion -** 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 "clonewizardpage.h" - -namespace Mercurial { -namespace Internal { - -CloneWizardPage::CloneWizardPage(QWidget *parent) - : VcsBase::BaseCheckoutWizardPage(parent) -{ - setTitle(tr("Location")); - setSubTitle(tr("Specify repository URL, checkout directory and path.")); - setRepositoryLabel(tr("Clone URL:")); - setBranchSelectorVisible(false); -} - -QString CloneWizardPage::directoryFromRepository(const QString &repository) const -{ - // Mercurial repositories are generally of the form protocol://repositoryUrl/repository/ - // We are just looking for repository. - const QChar slash = QLatin1Char('/'); - QString repo = repository.trimmed(); - if (repo.endsWith(slash)) - repo.truncate(repo.size() - 1); - - // Take the basename or the repository url. - return repo.mid(repo.lastIndexOf(slash) + 1); -} - -} // namespace Internal -} // namespace Mercurial diff --git a/src/plugins/mercurial/clonewizardpage.h b/src/plugins/mercurial/clonewizardpage.h deleted file mode 100644 index 753b84674c..0000000000 --- a/src/plugins/mercurial/clonewizardpage.h +++ /dev/null @@ -1,52 +0,0 @@ -/************************************************************************** -** -** Copyright (C) 2015 Brian McGillion -** 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 CLONEWIZARDPAGE_H -#define CLONEWIZARDPAGE_H - -#include <vcsbase/basecheckoutwizardpage.h> - -namespace Mercurial { -namespace Internal { - -class CloneWizardPage : public VcsBase::BaseCheckoutWizardPage -{ - Q_OBJECT -public: - CloneWizardPage(QWidget *parent = 0); - -protected: - QString directoryFromRepository(const QString &rrepository) const; -}; - -} //namespace Internal -} //namespace Mercurial - -#endif // CLONEWIZARDPAGE_H diff --git a/src/plugins/mercurial/images/hg.png b/src/plugins/mercurial/images/hg.png Binary files differdeleted file mode 100644 index 1daa4b8222..0000000000 --- a/src/plugins/mercurial/images/hg.png +++ /dev/null diff --git a/src/plugins/mercurial/mercurial.pro b/src/plugins/mercurial/mercurial.pro index a10510d5a1..69f250bd2d 100644 --- a/src/plugins/mercurial/mercurial.pro +++ b/src/plugins/mercurial/mercurial.pro @@ -9,8 +9,6 @@ SOURCES += mercurialplugin.cpp \ srcdestdialog.cpp \ mercurialcommitwidget.cpp \ commiteditor.cpp \ - clonewizardpage.cpp \ - clonewizard.cpp \ mercurialsettings.cpp \ authenticationdialog.cpp HEADERS += mercurialplugin.h \ @@ -24,8 +22,6 @@ HEADERS += mercurialplugin.h \ srcdestdialog.h \ mercurialcommitwidget.h \ commiteditor.h \ - clonewizardpage.h \ - clonewizard.h \ mercurialsettings.h \ authenticationdialog.h FORMS += optionspage.ui \ @@ -33,4 +29,3 @@ FORMS += optionspage.ui \ srcdestdialog.ui \ mercurialcommitpanel.ui \ authenticationdialog.ui -RESOURCES += mercurial.qrc diff --git a/src/plugins/mercurial/mercurial.qbs b/src/plugins/mercurial/mercurial.qbs index 3198da245c..a168c5a431 100644 --- a/src/plugins/mercurial/mercurial.qbs +++ b/src/plugins/mercurial/mercurial.qbs @@ -16,14 +16,9 @@ QtcPlugin { "authenticationdialog.cpp", "authenticationdialog.h", "authenticationdialog.ui", - "clonewizard.cpp", - "clonewizard.h", - "clonewizardpage.cpp", - "clonewizardpage.h", "commiteditor.cpp", "commiteditor.h", "constants.h", - "mercurial.qrc", "mercurialclient.cpp", "mercurialclient.h", "mercurialcommitpanel.ui", diff --git a/src/plugins/mercurial/mercurial.qrc b/src/plugins/mercurial/mercurial.qrc deleted file mode 100644 index b001b7e60b..0000000000 --- a/src/plugins/mercurial/mercurial.qrc +++ /dev/null @@ -1,5 +0,0 @@ -<RCC> - <qresource prefix="/mercurial" > - <file>images/hg.png</file> - </qresource> -</RCC> diff --git a/src/plugins/mercurial/mercurialplugin.cpp b/src/plugins/mercurial/mercurialplugin.cpp index dd13a0f2a9..e9e70c4768 100644 --- a/src/plugins/mercurial/mercurialplugin.cpp +++ b/src/plugins/mercurial/mercurialplugin.cpp @@ -37,7 +37,6 @@ #include "revertdialog.h" #include "srcdestdialog.h" #include "commiteditor.h" -#include "clonewizard.h" #include "mercurialsettings.h" #include <coreplugin/actionmanager/actionmanager.h> @@ -153,16 +152,6 @@ bool MercurialPlugin::initialize(const QStringList & /* arguments */, QString * addAutoReleasedObject(new VcsSubmitEditorFactory(&submitEditorParameters, []() { return new CommitEditor(&submitEditorParameters); })); - auto cloneWizardFactory = new BaseCheckoutWizardFactory; - cloneWizardFactory->setId(QLatin1String(VcsBase::Constants::VCS_ID_MERCURIAL)); - cloneWizardFactory->setIcon(QIcon(QLatin1String(":/mercurial/images/hg.png"))); - cloneWizardFactory->setDescription(tr("Clones a Mercurial repository and tries to load the contained project.")); - cloneWizardFactory->setDisplayName(tr("Mercurial Clone")); - cloneWizardFactory->setWizardCreator([this] (const FileName &path, QWidget *parent) { - return new CloneWizard(path, parent); - }); - addAutoReleasedObject(cloneWizardFactory); - const QString prefix = QLatin1String("hg"); m_commandLocator = new Core::CommandLocator("Mercurial", prefix, prefix); addAutoReleasedObject(m_commandLocator); |