CVS: Replace CVS checkout wizard with a Json wizard

Change-Id: I27c5c76923bae3e4df514e228873330fd8232c7f
Reviewed-by: Alessandro Portale <alessandro.portale@theqtcompany.com>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@theqtcompany.com>
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
This commit is contained in:
Tobias Hunger
2015-05-08 17:55:28 +02:00
parent 9a5aceb7fd
commit 4f4c6b6288
11 changed files with 90 additions and 252 deletions

View File

@@ -1,77 +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 "checkoutwizard.h"
#include "checkoutwizardpage.h"
#include "cvsclient.h"
#include "cvsplugin.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 Cvs {
namespace Internal {
// --------------------------------------------------------------------
// CheckoutWizard:
// --------------------------------------------------------------------
CheckoutWizard::CheckoutWizard(const Utils::FileName &path, QWidget *parent) :
BaseCheckoutWizard(Constants::VCS_ID_CVS, parent)
{
auto cwp = new CheckoutWizardPage;
cwp->setPath(path.toString());
addPage(cwp);
}
VcsCommand *CheckoutWizard::createCommand(Utils::FileName *checkoutDir)
{
// Collect parameters for the checkout command.
// CVS does not allow for checking out into a different directory.
const CheckoutWizardPage *cwp = find<CheckoutWizardPage>();
QTC_ASSERT(cwp, return 0);
*checkoutDir = Utils::FileName::fromString(cwp->path() + QLatin1Char('/') + cwp->repository());
// cwp->repository() contains the CVS module to check out only.
// The CVSROOT (== actual repository) for that module is part of the CVS settings.
// The checkout will always go into a new subfolder named after the CVS module.
return createCommandImpl(cwp->repository(), Utils::FileName::fromString(cwp->path()),
cwp->repository(), QStringList());
}
} // namespace Internal
} // namespace Cvs

View File

@@ -1,54 +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 CHECKOUTWIZARD_H
#define CHECKOUTWIZARD_H
#include <vcsbase/basecheckoutwizardfactory.h>
#include <vcsbase/basecheckoutwizard.h>
namespace Cvs {
namespace Internal {
class CheckoutWizard : public VcsBase::BaseCheckoutWizard
{
Q_OBJECT
public:
CheckoutWizard(const Utils::FileName &path, QWidget *parent = 0);
protected:
VcsBase::VcsCommand *createCommand(Utils::FileName *checkoutDir);
};
} // namespace Internal
} // namespace Cvs
#endif // CHECKOUTWIZARD_H

View File

@@ -1,47 +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 "checkoutwizardpage.h"
namespace Cvs {
namespace Internal {
CheckoutWizardPage::CheckoutWizardPage(QWidget *parent) :
VcsBase::BaseCheckoutWizardPage(parent)
{
setTitle(tr("Location"));
setSubTitle(tr("Specify repository and path."));
setRepositoryLabel(tr("Repository:"));
setDirectoryVisible(false);
setBranchSelectorVisible(false);
}
} // namespace Internal
} // namespace Cvs

View File

@@ -1,50 +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 CHECKOUTWIZARDPAGE_H
#define CHECKOUTWIZARDPAGE_H
#include <vcsbase/basecheckoutwizardpage.h>
namespace Cvs {
namespace Internal {
class CheckoutWizardPage : public VcsBase::BaseCheckoutWizardPage
{
Q_OBJECT
public:
CheckoutWizardPage(QWidget *parent = 0);
};
} // namespace Internal
} // namespace Cvs
#endif // CHECKOUTWIZARDPAGE_H

View File

@@ -9,9 +9,7 @@ HEADERS += annotationhighlighter.h \
cvssubmiteditor.h \
cvssettings.h \
cvsutils.h \
cvsconstants.h \
checkoutwizard.h \
checkoutwizardpage.h
cvsconstants.h
SOURCES += annotationhighlighter.cpp \
cvsplugin.cpp \
@@ -21,9 +19,7 @@ SOURCES += annotationhighlighter.cpp \
cvseditor.cpp \
cvssubmiteditor.cpp \
cvssettings.cpp \
cvsutils.cpp \
checkoutwizard.cpp \
checkoutwizardpage.cpp
cvsutils.cpp
FORMS += settingspage.ui

View File

@@ -13,10 +13,6 @@ QtcPlugin {
files: [
"annotationhighlighter.cpp",
"annotationhighlighter.h",
"checkoutwizard.cpp",
"checkoutwizard.h",
"checkoutwizardpage.cpp",
"checkoutwizardpage.h",
"cvs.qrc",
"cvsclient.cpp",
"cvsclient.h",

View File

@@ -2,7 +2,4 @@
<qresource prefix="/trolltech.cvs">
<file>CVS.mimetypes.xml</file>
</qresource>
<qresource prefix="/cvs">
<file>images/cvs.png</file>
</qresource>
</RCC>

View File

@@ -149,6 +149,7 @@ Core::ShellCommand *CvsControl::createInitialCheckoutCommand(const QString &url,
auto command = new VcsBase::VcsCommand(baseDirectory.toString(),
QProcessEnvironment::systemEnvironment());
command->setDisplayName(tr("cvs checkout"));
command->addJob(m_plugin->client()->vcsBinary(), settings.addOptions(args), -1);
return command;
}

View File

@@ -35,7 +35,6 @@
#include "cvsclient.h"
#include "cvsconstants.h"
#include "cvscontrol.h"
#include "checkoutwizard.h"
#include <vcsbase/basevcseditorfactory.h>
#include <vcsbase/basevcssubmiteditorfactory.h>
@@ -266,16 +265,6 @@ bool CvsPlugin::initialize(const QStringList &arguments, QString *errorMessage)
for (int i = 0; i < editorCount; i++)
addAutoReleasedObject(new VcsEditorFactory(editorParameters + i, widgetCreator, this, describeSlotC));
auto checkoutWizardFactory = new BaseCheckoutWizardFactory;
checkoutWizardFactory->setId(QLatin1String(VcsBase::Constants::VCS_ID_CVS));
checkoutWizardFactory->setIcon(QIcon(QLatin1String(":/cvs/images/cvs.png")));
checkoutWizardFactory->setDescription(tr("Checks out a CVS repository and tries to load the contained project."));
checkoutWizardFactory->setDisplayName(tr("CVS Checkout"));
checkoutWizardFactory->setWizardCreator([this] (const FileName &path, QWidget *parent) {
return new CheckoutWizard(path, parent);
});
addAutoReleasedObject(checkoutWizardFactory);
const QString prefix = QLatin1String("cvs");
m_commandLocator = new CommandLocator("CVS", prefix, prefix);
addAutoReleasedObject(m_commandLocator);

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB