2022-08-19 15:59:36 +02:00
|
|
|
// Copyright (C) 2016 The Qt Company Ltd.
|
|
|
|
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0+ OR GPL-3.0 WITH Qt-GPL-exception-1.0
|
2009-07-15 12:28:40 +02:00
|
|
|
|
|
|
|
|
#include "cvssettings.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
|
|
|
|
2012-01-07 16:55:09 +01:00
|
|
|
namespace Cvs {
|
2010-04-12 16:34:21 +02:00
|
|
|
namespace Internal {
|
2009-07-15 12:28:40 +02:00
|
|
|
|
2021-03-16 16:55:02 +01:00
|
|
|
// CvsSettings
|
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
|
|
|
{
|
2021-03-16 16:55:02 +01:00
|
|
|
setSettingsGroup("CVS");
|
2009-07-15 12:28:40 +02:00
|
|
|
|
2021-03-16 16:55:02 +01:00
|
|
|
registerAspect(&binaryPath);
|
|
|
|
|
binaryPath.setDefaultValue("cvs" QTC_HOST_EXE_SUFFIX);
|
|
|
|
|
binaryPath.setDisplayStyle(StringAspect::PathChooserDisplay);
|
|
|
|
|
binaryPath.setExpectedKind(PathChooser::ExistingCommand);
|
|
|
|
|
binaryPath.setHistoryCompleter(QLatin1String("Cvs.Command.History"));
|
|
|
|
|
binaryPath.setDisplayName(tr("CVS Command"));
|
|
|
|
|
binaryPath.setLabelText(tr("CVS command:"));
|
|
|
|
|
|
|
|
|
|
registerAspect(&cvsRoot);
|
|
|
|
|
cvsRoot.setDisplayStyle(StringAspect::LineEditDisplay);
|
|
|
|
|
cvsRoot.setSettingsKey("Root");
|
|
|
|
|
cvsRoot.setLabelText(tr("CVS root:"));
|
|
|
|
|
|
|
|
|
|
registerAspect(&diffOptions);
|
|
|
|
|
diffOptions.setDisplayStyle(StringAspect::LineEditDisplay);
|
|
|
|
|
diffOptions.setSettingsKey("DiffOptions");
|
|
|
|
|
diffOptions.setDefaultValue("-du");
|
|
|
|
|
diffOptions.setLabelText("Diff options:");
|
|
|
|
|
|
|
|
|
|
registerAspect(&describeByCommitId);
|
|
|
|
|
describeByCommitId.setSettingsKey("DescribeByCommitId");
|
|
|
|
|
describeByCommitId.setDefaultValue(true);
|
|
|
|
|
describeByCommitId.setLabelText(tr("Describe all files matching commit id"));
|
|
|
|
|
describeByCommitId.setToolTip(tr("When checked, all files touched by a commit will be "
|
|
|
|
|
"displayed when clicking on a revision number in the annotation view "
|
|
|
|
|
"(retrieved via commit ID). Otherwise, only the respective file will be displayed."));
|
|
|
|
|
|
|
|
|
|
registerAspect(&diffIgnoreWhiteSpace);
|
|
|
|
|
diffIgnoreWhiteSpace.setSettingsKey("DiffIgnoreWhiteSpace");
|
|
|
|
|
|
|
|
|
|
registerAspect(&diffIgnoreBlankLines);
|
|
|
|
|
diffIgnoreBlankLines.setSettingsKey("DiffIgnoreBlankLines");
|
2009-07-15 12:28:40 +02:00
|
|
|
}
|
|
|
|
|
|
2012-01-07 16:55:09 +01:00
|
|
|
QStringList CvsSettings::addOptions(const QStringList &args) const
|
2009-07-15 12:28:40 +02:00
|
|
|
{
|
2021-03-16 16:55:02 +01:00
|
|
|
const QString cvsRoot = this->cvsRoot.value();
|
2009-07-15 12:28:40 +02:00
|
|
|
if (cvsRoot.isEmpty())
|
|
|
|
|
return args;
|
|
|
|
|
|
|
|
|
|
QStringList rc;
|
|
|
|
|
rc.push_back(QLatin1String("-d"));
|
|
|
|
|
rc.push_back(cvsRoot);
|
|
|
|
|
rc.append(args);
|
|
|
|
|
return rc;
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-31 14:28:48 +02:00
|
|
|
CvsSettingsPage::CvsSettingsPage(CvsSettings *settings)
|
2021-03-16 16:55:02 +01:00
|
|
|
{
|
|
|
|
|
setId(VcsBase::Constants::VCS_ID_CVS);
|
2021-03-31 14:28:48 +02:00
|
|
|
setDisplayName(CvsSettings::tr("CVS"));
|
2021-03-16 16:55:02 +01:00
|
|
|
setCategory(VcsBase::Constants::VCS_SETTINGS_CATEGORY);
|
2021-03-31 14:28:48 +02:00
|
|
|
setSettings(settings);
|
|
|
|
|
|
|
|
|
|
setLayouter([settings](QWidget *widget) {
|
|
|
|
|
CvsSettings &s = *settings;
|
|
|
|
|
using namespace Layouting;
|
|
|
|
|
|
|
|
|
|
Column {
|
|
|
|
|
Group {
|
2022-07-26 13:46:27 +02:00
|
|
|
title(CvsSettings::tr("Configuration")),
|
2021-03-31 14:28:48 +02:00
|
|
|
Form {
|
|
|
|
|
s.binaryPath,
|
|
|
|
|
s.cvsRoot
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
Group {
|
2022-07-26 13:46:27 +02:00
|
|
|
title(CvsSettings::tr("Miscellaneous")),
|
2022-07-21 11:10:34 +02:00
|
|
|
Column {
|
|
|
|
|
Form {
|
|
|
|
|
s.timeout,
|
|
|
|
|
s.diffOptions,
|
|
|
|
|
},
|
|
|
|
|
s.promptOnSubmit,
|
|
|
|
|
s.describeByCommitId,
|
|
|
|
|
}
|
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
|
|
|
}
|
|
|
|
|
|
|
|
|
|
} // Internal
|
|
|
|
|
} // Cvs
|