2022-08-19 15:59:36 +02:00
|
|
|
// Copyright (C) 2016 The Qt Company Ltd.
|
2022-12-21 10:12:09 +01:00
|
|
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
|
2009-07-15 12:28:40 +02:00
|
|
|
|
|
|
|
|
#include "cvssettings.h"
|
|
|
|
|
|
2022-09-29 17:59:47 +02:00
|
|
|
#include "cvstr.h"
|
|
|
|
|
|
2021-03-16 16:55:02 +01:00
|
|
|
#include <coreplugin/icore.h>
|
2012-08-21 14:45:42 +03:00
|
|
|
|
2022-05-24 00:40:44 +02:00
|
|
|
#include <utils/hostosinfo.h>
|
2021-03-16 16:55:02 +01:00
|
|
|
#include <utils/layoutbuilder.h>
|
|
|
|
|
#include <utils/pathchooser.h>
|
|
|
|
|
|
|
|
|
|
#include <vcsbase/vcsbaseconstants.h>
|
|
|
|
|
|
|
|
|
|
using namespace Utils;
|
2009-07-15 12:28:40 +02:00
|
|
|
|
2022-09-29 17:59:47 +02:00
|
|
|
namespace Cvs::Internal {
|
2009-07-15 12:28:40 +02:00
|
|
|
|
2023-05-15 14:52:40 +02:00
|
|
|
static CvsSettings *theSettings;
|
|
|
|
|
|
|
|
|
|
CvsSettings &settings()
|
|
|
|
|
{
|
|
|
|
|
return *theSettings;
|
|
|
|
|
}
|
2009-07-15 12:28:40 +02:00
|
|
|
|
2013-10-15 20:03:22 +02:00
|
|
|
CvsSettings::CvsSettings()
|
2009-07-15 12:28:40 +02:00
|
|
|
{
|
2023-05-15 14:52:40 +02:00
|
|
|
theSettings = this;
|
2021-03-16 16:55:02 +01:00
|
|
|
setSettingsGroup("CVS");
|
2009-07-15 12:28:40 +02:00
|
|
|
|
2023-05-15 14:52:40 +02:00
|
|
|
setId(VcsBase::Constants::VCS_ID_CVS);
|
|
|
|
|
setDisplayName(Tr::tr("CVS"));
|
|
|
|
|
setCategory(VcsBase::Constants::VCS_SETTINGS_CATEGORY);
|
|
|
|
|
|
2021-03-16 16:55:02 +01:00
|
|
|
binaryPath.setDefaultValue("cvs" QTC_HOST_EXE_SUFFIX);
|
|
|
|
|
binaryPath.setExpectedKind(PathChooser::ExistingCommand);
|
|
|
|
|
binaryPath.setHistoryCompleter(QLatin1String("Cvs.Command.History"));
|
2022-09-29 17:59:47 +02:00
|
|
|
binaryPath.setDisplayName(Tr::tr("CVS Command"));
|
|
|
|
|
binaryPath.setLabelText(Tr::tr("CVS command:"));
|
2021-03-16 16:55:02 +01:00
|
|
|
|
|
|
|
|
cvsRoot.setDisplayStyle(StringAspect::LineEditDisplay);
|
|
|
|
|
cvsRoot.setSettingsKey("Root");
|
2022-09-29 17:59:47 +02:00
|
|
|
cvsRoot.setLabelText(Tr::tr("CVS root:"));
|
2021-03-16 16:55:02 +01:00
|
|
|
|
|
|
|
|
diffOptions.setDisplayStyle(StringAspect::LineEditDisplay);
|
|
|
|
|
diffOptions.setSettingsKey("DiffOptions");
|
|
|
|
|
diffOptions.setDefaultValue("-du");
|
|
|
|
|
diffOptions.setLabelText("Diff options:");
|
|
|
|
|
|
|
|
|
|
describeByCommitId.setSettingsKey("DescribeByCommitId");
|
|
|
|
|
describeByCommitId.setDefaultValue(true);
|
2022-09-29 17:59:47 +02:00
|
|
|
describeByCommitId.setLabelText(Tr::tr("Describe all files matching commit id"));
|
|
|
|
|
describeByCommitId.setToolTip(Tr::tr("When checked, all files touched by a commit will be "
|
2021-03-16 16:55:02 +01:00
|
|
|
"displayed when clicking on a revision number in the annotation view "
|
|
|
|
|
"(retrieved via commit ID). Otherwise, only the respective file will be displayed."));
|
|
|
|
|
|
|
|
|
|
diffIgnoreWhiteSpace.setSettingsKey("DiffIgnoreWhiteSpace");
|
|
|
|
|
|
|
|
|
|
diffIgnoreBlankLines.setSettingsKey("DiffIgnoreBlankLines");
|
2009-07-15 12:28:40 +02:00
|
|
|
|
2023-05-15 14:52:40 +02:00
|
|
|
setLayouter([this](QWidget *widget) {
|
2021-03-31 14:28:48 +02:00
|
|
|
using namespace Layouting;
|
|
|
|
|
Column {
|
|
|
|
|
Group {
|
2022-09-29 17:59:47 +02:00
|
|
|
title(Tr::tr("Configuration")),
|
2021-03-31 14:28:48 +02:00
|
|
|
Form {
|
2023-05-15 14:52:40 +02:00
|
|
|
binaryPath, br,
|
|
|
|
|
cvsRoot
|
2021-03-31 14:28:48 +02:00
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
Group {
|
2022-09-29 17:59:47 +02:00
|
|
|
title(Tr::tr("Miscellaneous")),
|
2022-07-21 11:10:34 +02:00
|
|
|
Column {
|
|
|
|
|
Form {
|
2023-05-15 14:52:40 +02:00
|
|
|
timeout, br,
|
|
|
|
|
diffOptions,
|
2022-07-21 11:10:34 +02:00
|
|
|
},
|
2023-05-15 14:52:40 +02:00
|
|
|
describeByCommitId,
|
2022-07-21 11:10:34 +02:00
|
|
|
}
|
2021-03-31 14:28:48 +02:00
|
|
|
},
|
2022-07-22 18:54:04 +02:00
|
|
|
st
|
2021-03-31 14:28:48 +02:00
|
|
|
}.attachTo(widget);
|
|
|
|
|
});
|
2021-03-16 16:55:02 +01:00
|
|
|
}
|
|
|
|
|
|
2023-05-15 14:52:40 +02:00
|
|
|
QStringList CvsSettings::addOptions(const QStringList &args) const
|
2023-05-15 13:20:41 +02:00
|
|
|
{
|
2023-05-15 14:52:40 +02:00
|
|
|
const QString cvsRoot = this->cvsRoot.value();
|
|
|
|
|
if (cvsRoot.isEmpty())
|
|
|
|
|
return args;
|
|
|
|
|
|
|
|
|
|
QStringList rc;
|
|
|
|
|
rc.push_back(QLatin1String("-d"));
|
|
|
|
|
rc.push_back(cvsRoot);
|
|
|
|
|
rc.append(args);
|
|
|
|
|
return rc;
|
2023-05-15 13:20:41 +02:00
|
|
|
}
|
|
|
|
|
|
2022-09-29 17:59:47 +02:00
|
|
|
} // Cvs::Internal
|