forked from qt-creator/qt-creator
Fossil: Aspectify settings
Change-Id: I090cf3c63cd705220abb09e5d58eef89e9b55147 Reviewed-by: Orgad Shaneh <orgads@gmail.com>
This commit is contained in:
@@ -23,7 +23,6 @@ add_qtc_plugin(Fossil
|
|||||||
fossileditor.cpp fossileditor.h
|
fossileditor.cpp fossileditor.h
|
||||||
fossilplugin.cpp fossilplugin.h
|
fossilplugin.cpp fossilplugin.h
|
||||||
fossilsettings.cpp fossilsettings.h
|
fossilsettings.cpp fossilsettings.h
|
||||||
optionspage.cpp optionspage.h optionspage.ui
|
|
||||||
pullorpushdialog.cpp pullorpushdialog.h pullorpushdialog.ui
|
pullorpushdialog.cpp pullorpushdialog.h pullorpushdialog.ui
|
||||||
revertdialog.ui
|
revertdialog.ui
|
||||||
revisioninfo.cpp revisioninfo.h
|
revisioninfo.cpp revisioninfo.h
|
||||||
|
|||||||
@@ -8,7 +8,6 @@ include($$IDE_SOURCE_TREE/src/qtcreatorplugin.pri)
|
|||||||
SOURCES += \
|
SOURCES += \
|
||||||
fossilclient.cpp \
|
fossilclient.cpp \
|
||||||
fossilplugin.cpp \
|
fossilplugin.cpp \
|
||||||
optionspage.cpp \
|
|
||||||
fossilsettings.cpp \
|
fossilsettings.cpp \
|
||||||
commiteditor.cpp \
|
commiteditor.cpp \
|
||||||
fossilcommitwidget.cpp \
|
fossilcommitwidget.cpp \
|
||||||
@@ -23,7 +22,6 @@ HEADERS += \
|
|||||||
fossilclient.h \
|
fossilclient.h \
|
||||||
constants.h \
|
constants.h \
|
||||||
fossilplugin.h \
|
fossilplugin.h \
|
||||||
optionspage.h \
|
|
||||||
fossilsettings.h \
|
fossilsettings.h \
|
||||||
commiteditor.h \
|
commiteditor.h \
|
||||||
fossilcommitwidget.h \
|
fossilcommitwidget.h \
|
||||||
@@ -35,7 +33,6 @@ HEADERS += \
|
|||||||
revisioninfo.h \
|
revisioninfo.h \
|
||||||
wizard/fossiljsextension.h
|
wizard/fossiljsextension.h
|
||||||
FORMS += \
|
FORMS += \
|
||||||
optionspage.ui \
|
|
||||||
revertdialog.ui \
|
revertdialog.ui \
|
||||||
fossilcommitpanel.ui \
|
fossilcommitpanel.ui \
|
||||||
pullorpushdialog.ui \
|
pullorpushdialog.ui \
|
||||||
|
|||||||
@@ -15,7 +15,6 @@ QtcPlugin {
|
|||||||
"constants.h",
|
"constants.h",
|
||||||
"fossilclient.cpp", "fossilclient.h",
|
"fossilclient.cpp", "fossilclient.h",
|
||||||
"fossilplugin.cpp", "fossilplugin.h",
|
"fossilplugin.cpp", "fossilplugin.h",
|
||||||
"optionspage.cpp", "optionspage.h", "optionspage.ui",
|
|
||||||
"fossilsettings.cpp", "fossilsettings.h",
|
"fossilsettings.cpp", "fossilsettings.h",
|
||||||
"commiteditor.cpp", "commiteditor.h",
|
"commiteditor.cpp", "commiteditor.h",
|
||||||
"fossilcommitwidget.cpp", "fossilcommitwidget.h",
|
"fossilcommitwidget.cpp", "fossilcommitwidget.h",
|
||||||
|
|||||||
@@ -36,9 +36,7 @@
|
|||||||
#include <utils/algorithm.h>
|
#include <utils/algorithm.h>
|
||||||
#include <utils/fileutils.h>
|
#include <utils/fileutils.h>
|
||||||
#include <utils/hostosinfo.h>
|
#include <utils/hostosinfo.h>
|
||||||
#include <utils/id.h>
|
|
||||||
#include <utils/qtcassert.h>
|
#include <utils/qtcassert.h>
|
||||||
#include <utils/stringutils.h>
|
|
||||||
#include <utils/utilsicons.h>
|
#include <utils/utilsicons.h>
|
||||||
|
|
||||||
#include <QSyntaxHighlighter>
|
#include <QSyntaxHighlighter>
|
||||||
@@ -67,15 +65,14 @@ public:
|
|||||||
{
|
{
|
||||||
QTC_ASSERT(client, return);
|
QTC_ASSERT(client, return);
|
||||||
|
|
||||||
VcsBase::VcsBaseClientSettings &settings = client->settings();
|
|
||||||
FossilClient::SupportedFeatures features = client->supportedFeatures();
|
FossilClient::SupportedFeatures features = client->supportedFeatures();
|
||||||
|
|
||||||
addReloadButton();
|
addReloadButton();
|
||||||
if (features.testFlag(FossilClient::DiffIgnoreWhiteSpaceFeature)) {
|
if (features.testFlag(FossilClient::DiffIgnoreWhiteSpaceFeature)) {
|
||||||
mapSetting(addToggleButton("-w", tr("Ignore All Whitespace")),
|
mapSetting(addToggleButton("-w", tr("Ignore All Whitespace")),
|
||||||
settings.boolPointer(FossilSettings::diffIgnoreAllWhiteSpaceKey));
|
&client->settings().diffIgnoreAllWhiteSpace);
|
||||||
mapSetting(addToggleButton("--strip-trailing-cr", tr("Strip Trailing CR")),
|
mapSetting(addToggleButton("--strip-trailing-cr", tr("Strip Trailing CR")),
|
||||||
settings.boolPointer(FossilSettings::diffStripTrailingCRKey));
|
&client->settings().diffStripTrailingCR);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -91,20 +88,20 @@ public:
|
|||||||
{
|
{
|
||||||
QTC_ASSERT(client, return);
|
QTC_ASSERT(client, return);
|
||||||
|
|
||||||
VcsBase::VcsBaseClientSettings &settings = client->settings();
|
FossilSettings &settings = client->settings();
|
||||||
FossilClient::SupportedFeatures features = client->supportedFeatures();
|
FossilClient::SupportedFeatures features = client->supportedFeatures();
|
||||||
|
|
||||||
if (features.testFlag(FossilClient::AnnotateBlameFeature)) {
|
if (features.testFlag(FossilClient::AnnotateBlameFeature)) {
|
||||||
mapSetting(addToggleButton("|BLAME|", tr("Show Committers")),
|
mapSetting(addToggleButton("|BLAME|", tr("Show Committers")),
|
||||||
settings.boolPointer(FossilSettings::annotateShowCommittersKey));
|
&settings.annotateShowCommitters);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Force listVersions setting to false by default.
|
// Force listVersions setting to false by default.
|
||||||
// This way the annotated line number would not get offset by the version list.
|
// This way the annotated line number would not get offset by the version list.
|
||||||
settings.setValue(FossilSettings::annotateListVersionsKey, false);
|
settings.annotateListVersions.setValue(false);
|
||||||
|
|
||||||
mapSetting(addToggleButton("--log", tr("List Versions")),
|
mapSetting(addToggleButton("--log", tr("List Versions")),
|
||||||
settings.boolPointer(FossilSettings::annotateListVersionsKey));
|
&settings.annotateListVersions);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -141,7 +138,7 @@ public:
|
|||||||
|
|
||||||
void addLineageComboBox()
|
void addLineageComboBox()
|
||||||
{
|
{
|
||||||
VcsBase::VcsBaseClientSettings &settings = m_client->settings();
|
FossilSettings &settings = m_client->settings();
|
||||||
|
|
||||||
// ancestors/descendants filter
|
// ancestors/descendants filter
|
||||||
// This is a positional argument not an option.
|
// This is a positional argument not an option.
|
||||||
@@ -156,22 +153,22 @@ public:
|
|||||||
ChoiceItem(tr("Unfiltered"), "")
|
ChoiceItem(tr("Unfiltered"), "")
|
||||||
};
|
};
|
||||||
mapSetting(addChoices(tr("Lineage"), QStringList("|LINEAGE|%1|current"), lineageFilterChoices),
|
mapSetting(addChoices(tr("Lineage"), QStringList("|LINEAGE|%1|current"), lineageFilterChoices),
|
||||||
settings.stringPointer(FossilSettings::timelineLineageFilterKey));
|
&settings.timelineLineageFilter);
|
||||||
}
|
}
|
||||||
|
|
||||||
void addVerboseToggleButton()
|
void addVerboseToggleButton()
|
||||||
{
|
{
|
||||||
VcsBase::VcsBaseClientSettings &settings = m_client->settings();
|
FossilSettings &settings = m_client->settings();
|
||||||
|
|
||||||
// show files
|
// show files
|
||||||
mapSetting(addToggleButton("-showfiles", tr("Verbose"),
|
mapSetting(addToggleButton("-showfiles", tr("Verbose"),
|
||||||
tr("Show files changed in each revision")),
|
tr("Show files changed in each revision")),
|
||||||
settings.boolPointer(FossilSettings::timelineVerboseKey));
|
&settings.timelineVerbose);
|
||||||
}
|
}
|
||||||
|
|
||||||
void addItemTypeComboBox()
|
void addItemTypeComboBox()
|
||||||
{
|
{
|
||||||
VcsBase::VcsBaseClientSettings &settings = m_client->settings();
|
FossilSettings &settings = m_client->settings();
|
||||||
|
|
||||||
// option: -t <val>
|
// option: -t <val>
|
||||||
const QList<ChoiceItem> itemTypeChoices = {
|
const QList<ChoiceItem> itemTypeChoices = {
|
||||||
@@ -188,7 +185,7 @@ public:
|
|||||||
// Fossil expects separate arguments for option and value ( i.e. "-t" "all")
|
// Fossil expects separate arguments for option and value ( i.e. "-t" "all")
|
||||||
// so we need to handle the splitting explicitly in arguments().
|
// so we need to handle the splitting explicitly in arguments().
|
||||||
mapSetting(addChoices(tr("Item Types"), QStringList("-t %1"), itemTypeChoices),
|
mapSetting(addChoices(tr("Item Types"), QStringList("-t %1"), itemTypeChoices),
|
||||||
settings.stringPointer(FossilSettings::timelineItemTypeKey));
|
&settings.timelineItemType);
|
||||||
}
|
}
|
||||||
|
|
||||||
QStringList arguments() const final
|
QStringList arguments() const final
|
||||||
@@ -244,16 +241,22 @@ QString FossilClient::makeVersionString(unsigned version)
|
|||||||
.arg(versionPart(version));
|
.arg(versionPart(version));
|
||||||
}
|
}
|
||||||
|
|
||||||
FossilClient::FossilClient(FossilSettings *settings) : VcsBase::VcsBaseClient(settings)
|
FossilClient::FossilClient(FossilSettings *settings)
|
||||||
|
: VcsBase::VcsBaseClient(settings), m_settings(settings)
|
||||||
{
|
{
|
||||||
setDiffConfigCreator([this](QToolBar *toolBar) {
|
setDiffConfigCreator([this](QToolBar *toolBar) {
|
||||||
return new FossilDiffConfig(this, toolBar);
|
return new FossilDiffConfig(this, toolBar);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
FossilSettings &FossilClient::settings() const
|
||||||
|
{
|
||||||
|
return *m_settings;
|
||||||
|
}
|
||||||
|
|
||||||
unsigned int FossilClient::synchronousBinaryVersion() const
|
unsigned int FossilClient::synchronousBinaryVersion() const
|
||||||
{
|
{
|
||||||
if (settings().binaryPath().isEmpty())
|
if (settings().binaryPath.value().isEmpty())
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
QStringList args("version");
|
QStringList args("version");
|
||||||
@@ -282,7 +285,7 @@ QList<BranchInfo> FossilClient::branchListFromOutput(const QString &output, cons
|
|||||||
// Branch list format:
|
// Branch list format:
|
||||||
// " branch-name"
|
// " branch-name"
|
||||||
// "* current-branch"
|
// "* current-branch"
|
||||||
return Utils::transform(output.split('\n', Utils::SkipEmptyParts), [=](const QString& l) {
|
return Utils::transform(output.split('\n', Qt::SkipEmptyParts), [=](const QString &l) {
|
||||||
const QString &name = l.mid(2);
|
const QString &name = l.mid(2);
|
||||||
QTC_ASSERT(!name.isEmpty(), return BranchInfo());
|
QTC_ASSERT(!name.isEmpty(), return BranchInfo());
|
||||||
const BranchInfo::BranchFlags flags = (l.startsWith("* ") ? defaultFlags | BranchInfo::Current : defaultFlags);
|
const BranchInfo::BranchFlags flags = (l.startsWith("* ") ? defaultFlags | BranchInfo::Current : defaultFlags);
|
||||||
@@ -395,9 +398,9 @@ RevisionInfo FossilClient::synchronousRevisionQuery(const QString &workingDirect
|
|||||||
const QString hashToken =
|
const QString hashToken =
|
||||||
QString::fromUtf8(supportedFeatures().testFlag(InfoHashFeature) ? "hash: " : "uuid: ");
|
QString::fromUtf8(supportedFeatures().testFlag(InfoHashFeature) ? "hash: " : "uuid: ");
|
||||||
|
|
||||||
for (const QString &l : output.split('\n', Utils::SkipEmptyParts)) {
|
for (const QString &l : output.split('\n', Qt::SkipEmptyParts)) {
|
||||||
if (l.startsWith("checkout: ", Qt::CaseInsensitive)
|
if (l.startsWith("checkout: ", Qt::CaseInsensitive)
|
||||||
|| l.startsWith(hashToken, Qt::CaseInsensitive)) {
|
|| l.startsWith("uuid: ", Qt::CaseInsensitive)) {
|
||||||
const QRegularExpressionMatch idMatch = idRx.match(l);
|
const QRegularExpressionMatch idMatch = idRx.match(l);
|
||||||
QTC_ASSERT(idMatch.hasMatch(), return RevisionInfo());
|
QTC_ASSERT(idMatch.hasMatch(), return RevisionInfo());
|
||||||
revisionId = idMatch.captured(1);
|
revisionId = idMatch.captured(1);
|
||||||
@@ -446,7 +449,7 @@ QStringList FossilClient::synchronousTagQuery(const QString &workingDirectory, c
|
|||||||
|
|
||||||
const QString output = sanitizeFossilOutput(response.stdOut());
|
const QString output = sanitizeFossilOutput(response.stdOut());
|
||||||
|
|
||||||
return output.split('\n', Utils::SkipEmptyParts);
|
return output.split('\n', Qt::SkipEmptyParts);
|
||||||
}
|
}
|
||||||
|
|
||||||
RepositorySettings FossilClient::synchronousSettingsQuery(const QString &workingDirectory)
|
RepositorySettings FossilClient::synchronousSettingsQuery(const QString &workingDirectory)
|
||||||
@@ -458,7 +461,7 @@ RepositorySettings FossilClient::synchronousSettingsQuery(const QString &working
|
|||||||
|
|
||||||
repoSettings.user = synchronousUserDefaultQuery(workingDirectory);
|
repoSettings.user = synchronousUserDefaultQuery(workingDirectory);
|
||||||
if (repoSettings.user.isEmpty())
|
if (repoSettings.user.isEmpty())
|
||||||
repoSettings.user = settings().stringValue(FossilSettings::userNameKey);
|
repoSettings.user = settings().userName.value();
|
||||||
|
|
||||||
const QStringList args("settings");
|
const QStringList args("settings");
|
||||||
|
|
||||||
@@ -468,12 +471,12 @@ RepositorySettings FossilClient::synchronousSettingsQuery(const QString &working
|
|||||||
|
|
||||||
const QString output = sanitizeFossilOutput(response.stdOut());
|
const QString output = sanitizeFossilOutput(response.stdOut());
|
||||||
|
|
||||||
for (const QString &line : output.split('\n', Utils::SkipEmptyParts)) {
|
for (const QString &line : output.split('\n', Qt::SkipEmptyParts)) {
|
||||||
// parse settings line:
|
// parse settings line:
|
||||||
// <property> <(local|global)> <value>
|
// <property> <(local|global)> <value>
|
||||||
// Fossil properties are case-insensitive; force them to lower-case.
|
// Fossil properties are case-insensitive; force them to lower-case.
|
||||||
// Values may be in mixed-case; force lower-case for fixed values.
|
// Values may be in mixed-case; force lower-case for fixed values.
|
||||||
const QStringList fields = line.split(' ', Utils::SkipEmptyParts);
|
const QStringList fields = line.split(' ', Qt::SkipEmptyParts);
|
||||||
|
|
||||||
const QString property = fields.at(0).toLower();
|
const QString property = fields.at(0).toLower();
|
||||||
const QString value = (fields.size() >= 3 ? fields.at(2) : QString());
|
const QString value = (fields.size() >= 3 ? fields.at(2) : QString());
|
||||||
@@ -636,8 +639,8 @@ bool FossilClient::synchronousCreateRepository(const QString &workingDirectory,
|
|||||||
// use the configured default user for admin
|
// use the configured default user for admin
|
||||||
|
|
||||||
const QString repoName = QDir(workingDirectory).dirName().simplified();
|
const QString repoName = QDir(workingDirectory).dirName().simplified();
|
||||||
const QString repoPath = settings().stringValue(FossilSettings::defaultRepoPathKey);
|
const QString repoPath = settings().defaultRepoPath.value();
|
||||||
const QString adminUser = settings().stringValue(FossilSettings::userNameKey);
|
const QString adminUser = settings().userName.value();
|
||||||
|
|
||||||
if (repoName.isEmpty() || repoPath.isEmpty())
|
if (repoName.isEmpty() || repoPath.isEmpty())
|
||||||
return false;
|
return false;
|
||||||
@@ -855,7 +858,7 @@ unsigned int FossilClient::binaryVersion() const
|
|||||||
static unsigned int cachedBinaryVersion = 0;
|
static unsigned int cachedBinaryVersion = 0;
|
||||||
static QString cachedBinaryPath;
|
static QString cachedBinaryPath;
|
||||||
|
|
||||||
const QString currentBinaryPath = settings().binaryPath().toString();
|
const QString currentBinaryPath = settings().binaryPath.value();
|
||||||
|
|
||||||
if (currentBinaryPath.isEmpty())
|
if (currentBinaryPath.isEmpty())
|
||||||
return 0;
|
return 0;
|
||||||
|
|||||||
@@ -64,6 +64,7 @@ public:
|
|||||||
static QString makeVersionString(unsigned version);
|
static QString makeVersionString(unsigned version);
|
||||||
|
|
||||||
explicit FossilClient(FossilSettings *settings);
|
explicit FossilClient(FossilSettings *settings);
|
||||||
|
FossilSettings &settings() const;
|
||||||
|
|
||||||
unsigned int synchronousBinaryVersion() const;
|
unsigned int synchronousBinaryVersion() const;
|
||||||
BranchInfo synchronousCurrentBranch(const QString &workingDirectory);
|
BranchInfo synchronousCurrentBranch(const QString &workingDirectory);
|
||||||
@@ -130,6 +131,7 @@ private:
|
|||||||
VcsBase::VcsBaseEditorConfig *createLogEditor(VcsBase::VcsBaseEditorWidget *editor);
|
VcsBase::VcsBaseEditorConfig *createLogEditor(VcsBase::VcsBaseEditorWidget *editor);
|
||||||
|
|
||||||
friend class FossilPluginPrivate;
|
friend class FossilPluginPrivate;
|
||||||
|
FossilSettings *m_settings = nullptr;
|
||||||
};
|
};
|
||||||
|
|
||||||
Q_DECLARE_OPERATORS_FOR_FLAGS(FossilClient::SupportedFeatures)
|
Q_DECLARE_OPERATORS_FOR_FLAGS(FossilClient::SupportedFeatures)
|
||||||
|
|||||||
@@ -32,7 +32,6 @@
|
|||||||
|
|
||||||
#include <utils/completingtextedit.h>
|
#include <utils/completingtextedit.h>
|
||||||
#include <utils/qtcassert.h>
|
#include <utils/qtcassert.h>
|
||||||
#include <utils/stringutils.h>
|
|
||||||
|
|
||||||
#include <QSyntaxHighlighter>
|
#include <QSyntaxHighlighter>
|
||||||
#include <QTextEdit>
|
#include <QTextEdit>
|
||||||
@@ -123,7 +122,7 @@ QStringList FossilCommitWidget::tags() const
|
|||||||
return QStringList();
|
return QStringList();
|
||||||
|
|
||||||
tagsText.replace(',', ' ');
|
tagsText.replace(',', ' ');
|
||||||
const QStringList tags = tagsText.split(' ', Utils::SkipEmptyParts);
|
const QStringList tags = tagsText.split(' ', Qt::SkipEmptyParts);
|
||||||
return tags;
|
return tags;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -26,7 +26,6 @@
|
|||||||
#include "fossilplugin.h"
|
#include "fossilplugin.h"
|
||||||
#include "constants.h"
|
#include "constants.h"
|
||||||
#include "fossilclient.h"
|
#include "fossilclient.h"
|
||||||
#include "optionspage.h"
|
|
||||||
#include "fossilcommitwidget.h"
|
#include "fossilcommitwidget.h"
|
||||||
#include "fossileditor.h"
|
#include "fossileditor.h"
|
||||||
#include "pullorpushdialog.h"
|
#include "pullorpushdialog.h"
|
||||||
@@ -54,10 +53,8 @@
|
|||||||
#include <projectexplorer/project.h>
|
#include <projectexplorer/project.h>
|
||||||
#include <projectexplorer/jsonwizard/jsonwizardfactory.h>
|
#include <projectexplorer/jsonwizard/jsonwizardfactory.h>
|
||||||
|
|
||||||
#include <utils/id.h>
|
|
||||||
#include <utils/parameteraction.h>
|
#include <utils/parameteraction.h>
|
||||||
#include <utils/qtcassert.h>
|
#include <utils/qtcassert.h>
|
||||||
#include <utils/stringutils.h>
|
|
||||||
|
|
||||||
#include <vcsbase/basevcseditorfactory.h>
|
#include <vcsbase/basevcseditorfactory.h>
|
||||||
#include <vcsbase/basevcssubmiteditorfactory.h>
|
#include <vcsbase/basevcssubmiteditorfactory.h>
|
||||||
@@ -437,10 +434,10 @@ void FossilPluginPrivate::logCurrentFile()
|
|||||||
QTC_ASSERT(state.hasFile(), return);
|
QTC_ASSERT(state.hasFile(), return);
|
||||||
FossilClient::SupportedFeatures features = m_client.supportedFeatures();
|
FossilClient::SupportedFeatures features = m_client.supportedFeatures();
|
||||||
QStringList extraOptions;
|
QStringList extraOptions;
|
||||||
extraOptions << "-n" << QString::number(m_client.settings().intValue(FossilSettings::logCountKey));
|
extraOptions << "-n" << QString::number(m_client.settings().logCount.value());
|
||||||
|
|
||||||
if (features.testFlag(FossilClient::TimelineWidthFeature))
|
if (features.testFlag(FossilClient::TimelineWidthFeature))
|
||||||
extraOptions << "-W" << QString::number(m_client.settings().intValue(FossilSettings::timelineWidthKey));
|
extraOptions << "-W" << QString::number(m_client.settings().timelineWidth.value());
|
||||||
|
|
||||||
// disable annotate context menu for older client versions, used to be supported for current revision only
|
// disable annotate context menu for older client versions, used to be supported for current revision only
|
||||||
bool enableAnnotationContextMenu = features.testFlag(FossilClient::AnnotateRevisionFeature);
|
bool enableAnnotationContextMenu = features.testFlag(FossilClient::AnnotateRevisionFeature);
|
||||||
@@ -520,10 +517,10 @@ void FossilPluginPrivate::logRepository()
|
|||||||
QTC_ASSERT(state.hasTopLevel(), return);
|
QTC_ASSERT(state.hasTopLevel(), return);
|
||||||
FossilClient::SupportedFeatures features = m_client.supportedFeatures();
|
FossilClient::SupportedFeatures features = m_client.supportedFeatures();
|
||||||
QStringList extraOptions;
|
QStringList extraOptions;
|
||||||
extraOptions << "-n" << QString::number(m_client.settings().intValue(FossilSettings::logCountKey));
|
extraOptions << "-n" << QString::number(m_client.settings().logCount.value());
|
||||||
|
|
||||||
if (features.testFlag(FossilClient::TimelineWidthFeature))
|
if (features.testFlag(FossilClient::TimelineWidthFeature))
|
||||||
extraOptions << "-W" << QString::number(m_client.settings().intValue(FossilSettings::timelineWidthKey));
|
extraOptions << "-W" << QString::number(m_client.settings().timelineWidth.value());
|
||||||
|
|
||||||
m_client.log(state.topLevel(), QStringList(), extraOptions);
|
m_client.log(state.topLevel(), QStringList(), extraOptions);
|
||||||
}
|
}
|
||||||
@@ -616,7 +613,7 @@ bool FossilPluginPrivate::pullOrPush(FossilPluginPrivate::SyncMode mode)
|
|||||||
QTC_ASSERT(state.hasTopLevel(), return false);
|
QTC_ASSERT(state.hasTopLevel(), return false);
|
||||||
|
|
||||||
PullOrPushDialog dialog(pullOrPushMode, Core::ICore::dialogParent());
|
PullOrPushDialog dialog(pullOrPushMode, Core::ICore::dialogParent());
|
||||||
dialog.setLocalBaseDirectory(m_client.settings().stringValue(FossilSettings::defaultRepoPathKey));
|
dialog.setLocalBaseDirectory(m_client.settings().defaultRepoPath.value());
|
||||||
const QString defaultURL(m_client.synchronousGetRepositoryURL(state.topLevel()));
|
const QString defaultURL(m_client.synchronousGetRepositoryURL(state.topLevel()));
|
||||||
dialog.setDefaultRemoteLocation(defaultURL);
|
dialog.setDefaultRemoteLocation(defaultURL);
|
||||||
if (dialog.exec() != QDialog::Accepted)
|
if (dialog.exec() != QDialog::Accepted)
|
||||||
@@ -835,7 +832,7 @@ bool FossilPluginPrivate::submitEditorAboutToClose()
|
|||||||
//rewrite entries of the form 'file => newfile' to 'newfile' because
|
//rewrite entries of the form 'file => newfile' to 'newfile' because
|
||||||
//this would mess the commit command
|
//this would mess the commit command
|
||||||
for (QStringList::iterator iFile = files.begin(); iFile != files.end(); ++iFile) {
|
for (QStringList::iterator iFile = files.begin(); iFile != files.end(); ++iFile) {
|
||||||
const QStringList parts = iFile->split(" => ", Utils::SkipEmptyParts);
|
const QStringList parts = iFile->split(" => ", Qt::SkipEmptyParts);
|
||||||
if (!parts.isEmpty())
|
if (!parts.isEmpty())
|
||||||
*iFile = parts.last();
|
*iFile = parts.last();
|
||||||
}
|
}
|
||||||
@@ -932,7 +929,7 @@ bool FossilPluginPrivate::isConfigured() const
|
|||||||
return false;
|
return false;
|
||||||
|
|
||||||
// Local repositories default path must be set and exist
|
// Local repositories default path must be set and exist
|
||||||
const QString repoPath = m_client.settings().stringValue(FossilSettings::defaultRepoPathKey);
|
const QString repoPath = m_client.settings().defaultRepoPath.value();
|
||||||
if (repoPath.isEmpty())
|
if (repoPath.isEmpty())
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
|||||||
@@ -31,17 +31,10 @@
|
|||||||
#include <vcsbase/vcsbaseplugin.h>
|
#include <vcsbase/vcsbaseplugin.h>
|
||||||
#include <coreplugin/icontext.h>
|
#include <coreplugin/icontext.h>
|
||||||
|
|
||||||
namespace Core {
|
|
||||||
class ActionContainer;
|
|
||||||
class CommandLocator;
|
|
||||||
} // namespace Core
|
|
||||||
|
|
||||||
namespace Fossil {
|
namespace Fossil {
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
|
||||||
class OptionsPage;
|
|
||||||
class FossilClient;
|
class FossilClient;
|
||||||
class FossilEditorWidget;
|
|
||||||
|
|
||||||
class FossilPlugin final : public ExtensionSystem::IPlugin
|
class FossilPlugin final : public ExtensionSystem::IPlugin
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -24,47 +24,179 @@
|
|||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#include "fossilsettings.h"
|
#include "fossilsettings.h"
|
||||||
#include "constants.h"
|
|
||||||
|
|
||||||
#include <QSettings>
|
#include "constants.h"
|
||||||
|
#include "fossilclient.h"
|
||||||
|
|
||||||
|
#include <coreplugin/icore.h>
|
||||||
|
|
||||||
|
#include <utils/layoutbuilder.h>
|
||||||
|
#include <utils/pathchooser.h>
|
||||||
|
|
||||||
|
#include <vcsbase/vcsbaseconstants.h>
|
||||||
|
|
||||||
|
using namespace Utils;
|
||||||
|
|
||||||
namespace Fossil {
|
namespace Fossil {
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
|
||||||
const QString FossilSettings::defaultRepoPathKey("defaultRepoPath");
|
|
||||||
const QString FossilSettings::sslIdentityFileKey("sslIdentityFile");
|
|
||||||
const QString FossilSettings::diffIgnoreAllWhiteSpaceKey("diffIgnoreAllWhiteSpace");
|
|
||||||
const QString FossilSettings::diffStripTrailingCRKey("diffStripTrailingCR");
|
|
||||||
const QString FossilSettings::annotateShowCommittersKey("annotateShowCommitters");
|
|
||||||
const QString FossilSettings::annotateListVersionsKey("annotateListVersions");
|
|
||||||
const QString FossilSettings::timelineWidthKey("timelineWidth");
|
|
||||||
const QString FossilSettings::timelineLineageFilterKey("timelineLineageFilter");
|
|
||||||
const QString FossilSettings::timelineVerboseKey("timelineVerbose");
|
|
||||||
const QString FossilSettings::timelineItemTypeKey("timelineItemType");
|
|
||||||
const QString FossilSettings::disableAutosyncKey("disableAutosync");
|
|
||||||
|
|
||||||
FossilSettings::FossilSettings()
|
FossilSettings::FossilSettings()
|
||||||
{
|
{
|
||||||
setSettingsGroup(Constants::FOSSIL);
|
setSettingsGroup(Constants::FOSSIL);
|
||||||
// Override default binary path
|
setAutoApply(false);
|
||||||
declareKey(binaryPathKey, Constants::FOSSILDEFAULT);
|
|
||||||
declareKey(defaultRepoPathKey, "");
|
registerAspect(&binaryPath);
|
||||||
declareKey(sslIdentityFileKey, "");
|
binaryPath.setDisplayStyle(StringAspect::PathChooserDisplay);
|
||||||
declareKey(diffIgnoreAllWhiteSpaceKey, false);
|
binaryPath.setExpectedKind(PathChooser::ExistingCommand);
|
||||||
declareKey(diffStripTrailingCRKey, false);
|
binaryPath.setDefaultValue(Constants::FOSSILDEFAULT);
|
||||||
declareKey(annotateShowCommittersKey, false);
|
binaryPath.setDisplayName(tr("Fossil Command"));
|
||||||
declareKey(annotateListVersionsKey, false);
|
binaryPath.setHistoryCompleter("Fossil.Command.History");
|
||||||
declareKey(timelineWidthKey, 0);
|
binaryPath.setLabelText(tr("Command:"));
|
||||||
declareKey(timelineLineageFilterKey, "");
|
|
||||||
declareKey(timelineVerboseKey, false);
|
registerAspect(&defaultRepoPath);
|
||||||
declareKey(timelineItemTypeKey, "all");
|
defaultRepoPath.setSettingsKey("defaultRepoPath");
|
||||||
declareKey(disableAutosyncKey, true);
|
defaultRepoPath.setDisplayStyle(StringAspect::PathChooserDisplay);
|
||||||
}
|
defaultRepoPath.setExpectedKind(PathChooser::Directory);
|
||||||
|
defaultRepoPath.setDisplayName(tr("Fossil Repositories"));
|
||||||
|
defaultRepoPath.setLabelText(tr("Default path:"));
|
||||||
|
defaultRepoPath.setToolTip(tr("Directory to store local repositories by default."));
|
||||||
|
|
||||||
|
registerAspect(&userName);
|
||||||
|
userName.setDisplayStyle(StringAspect::LineEditDisplay);
|
||||||
|
userName.setLabelText(tr("Default user:"));
|
||||||
|
userName.setToolTip(tr("Existing user to become an author of changes made to the repository."));
|
||||||
|
|
||||||
|
registerAspect(&sslIdentityFile);
|
||||||
|
sslIdentityFile.setSettingsKey("sslIdentityFile");
|
||||||
|
sslIdentityFile.setDisplayStyle(StringAspect::PathChooserDisplay);
|
||||||
|
sslIdentityFile.setExpectedKind(PathChooser::File);
|
||||||
|
sslIdentityFile.setDisplayName(tr("SSL/TLS Identity Key"));
|
||||||
|
sslIdentityFile.setLabelText(tr("SSL/TLS identity:"));
|
||||||
|
sslIdentityFile.setToolTip(tr("SSL/TLS client identity key to use if requested by the server."));
|
||||||
|
|
||||||
|
registerAspect(&diffIgnoreAllWhiteSpace);
|
||||||
|
diffIgnoreAllWhiteSpace.setSettingsKey("diffIgnoreAllWhiteSpace");
|
||||||
|
|
||||||
|
registerAspect(&diffStripTrailingCR);
|
||||||
|
diffStripTrailingCR.setSettingsKey("diffStripTrailingCR");
|
||||||
|
|
||||||
|
registerAspect(&annotateShowCommitters);
|
||||||
|
annotateShowCommitters.setSettingsKey("annotateShowCommitters");
|
||||||
|
|
||||||
|
registerAspect(&annotateListVersions);
|
||||||
|
annotateListVersions.setSettingsKey("annotateListVersions");
|
||||||
|
|
||||||
|
registerAspect(&timelineWidth);
|
||||||
|
timelineWidth.setSettingsKey("timelineWidth");
|
||||||
|
timelineWidth.setLabelText(tr("Log width:"));
|
||||||
|
timelineWidth.setToolTip(tr("The width of log entry line (>20). "
|
||||||
|
"Choose 0 to see a single line per entry."));
|
||||||
|
|
||||||
|
registerAspect(&timelineLineageFilter);
|
||||||
|
timelineLineageFilter.setSettingsKey("timelineLineageFilter");
|
||||||
|
|
||||||
|
registerAspect(&timelineVerbose);
|
||||||
|
timelineVerbose.setSettingsKey("timelineVerbose");
|
||||||
|
|
||||||
|
registerAspect(&timelineItemType);
|
||||||
|
timelineItemType.setDefaultValue("all");
|
||||||
|
timelineItemType.setSettingsKey("timelineItemType");
|
||||||
|
|
||||||
|
registerAspect(&disableAutosync);
|
||||||
|
disableAutosync.setSettingsKey("disableAutosync");
|
||||||
|
disableAutosync.setDefaultValue(true);
|
||||||
|
disableAutosync.setLabelText(tr("Disable auto-sync"));
|
||||||
|
disableAutosync.setToolTip(tr("Disable automatic pull prior to commit or update and "
|
||||||
|
"automatic push after commit or tag or branch creation."));
|
||||||
|
|
||||||
|
registerAspect(&timeout);
|
||||||
|
timeout.setLabelText(tr("Timeout:"));
|
||||||
|
timeout.setSuffix(tr("s"));
|
||||||
|
|
||||||
|
registerAspect(&logCount);
|
||||||
|
logCount.setLabelText(tr("Log count:"));
|
||||||
|
logCount.setToolTip(tr("The number of recent commit log entries to show. "
|
||||||
|
"Choose 0 to see all entries."));
|
||||||
|
};
|
||||||
|
|
||||||
RepositorySettings::RepositorySettings()
|
RepositorySettings::RepositorySettings()
|
||||||
: autosync(AutosyncOn)
|
: autosync(AutosyncOn)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace Internal
|
// OptionsPage
|
||||||
} // namespace Fossil
|
|
||||||
|
class OptionsPageWidget final : public Core::IOptionsPageWidget
|
||||||
|
{
|
||||||
|
Q_DECLARE_TR_FUNCTIONS(Fossil::Internal::OptionsPageWidget)
|
||||||
|
|
||||||
|
public:
|
||||||
|
OptionsPageWidget(const std::function<void()> &onApply, FossilSettings *settings);
|
||||||
|
void apply() final;
|
||||||
|
|
||||||
|
private:
|
||||||
|
const std::function<void()> m_onApply;
|
||||||
|
FossilSettings *m_settings;
|
||||||
|
};
|
||||||
|
|
||||||
|
void OptionsPageWidget::apply()
|
||||||
|
{
|
||||||
|
if (!m_settings->isDirty())
|
||||||
|
return;
|
||||||
|
|
||||||
|
m_settings->apply();
|
||||||
|
m_onApply();
|
||||||
|
}
|
||||||
|
|
||||||
|
OptionsPageWidget::OptionsPageWidget(const std::function<void()> &onApply, FossilSettings *settings) :
|
||||||
|
m_onApply(onApply),
|
||||||
|
m_settings(settings)
|
||||||
|
{
|
||||||
|
FossilSettings &s = *m_settings;
|
||||||
|
|
||||||
|
using namespace Layouting;
|
||||||
|
const Break nl;
|
||||||
|
|
||||||
|
Column {
|
||||||
|
Group {
|
||||||
|
Title(tr("Configuration")),
|
||||||
|
Row { s.binaryPath }
|
||||||
|
},
|
||||||
|
|
||||||
|
Group {
|
||||||
|
Title(tr("Local Repositories")),
|
||||||
|
Row { s.defaultRepoPath }
|
||||||
|
},
|
||||||
|
Group {
|
||||||
|
Title(tr("User")),
|
||||||
|
Form {
|
||||||
|
s.userName, nl,
|
||||||
|
s.sslIdentityFile
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
Group {
|
||||||
|
Title(tr("Miscellaneous")),
|
||||||
|
Row {
|
||||||
|
s.logCount,
|
||||||
|
s.timelineWidth,
|
||||||
|
s.timeout,
|
||||||
|
Stretch()
|
||||||
|
},
|
||||||
|
s.disableAutosync
|
||||||
|
},
|
||||||
|
Stretch()
|
||||||
|
|
||||||
|
}.attachTo(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
OptionsPage::OptionsPage(const std::function<void()> &onApply, FossilSettings *settings)
|
||||||
|
{
|
||||||
|
setId(Constants::VCS_ID_FOSSIL);
|
||||||
|
setDisplayName(OptionsPageWidget::tr("Fossil"));
|
||||||
|
setWidgetCreator([onApply, settings]() { return new OptionsPageWidget(onApply, settings); });
|
||||||
|
setCategory(VcsBase::Constants::VCS_SETTINGS_CATEGORY);
|
||||||
|
}
|
||||||
|
|
||||||
|
} // Internal
|
||||||
|
} // Fossil
|
||||||
|
|||||||
@@ -25,25 +25,26 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#include <coreplugin/dialogs/ioptionspage.h>
|
||||||
#include <vcsbase/vcsbaseclientsettings.h>
|
#include <vcsbase/vcsbaseclientsettings.h>
|
||||||
|
|
||||||
namespace Fossil {
|
namespace Fossil {
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
|
||||||
class FossilSettings : public VcsBase::VcsBaseClientSettings
|
class FossilSettings : public VcsBase::VcsBaseSettings
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
static const QString defaultRepoPathKey;
|
Utils::StringAspect defaultRepoPath;
|
||||||
static const QString sslIdentityFileKey;
|
Utils::StringAspect sslIdentityFile;
|
||||||
static const QString diffIgnoreAllWhiteSpaceKey;
|
Utils::BoolAspect diffIgnoreAllWhiteSpace;
|
||||||
static const QString diffStripTrailingCRKey;
|
Utils::BoolAspect diffStripTrailingCR;
|
||||||
static const QString annotateShowCommittersKey;
|
Utils::BoolAspect annotateShowCommitters;
|
||||||
static const QString annotateListVersionsKey;
|
Utils::BoolAspect annotateListVersions;
|
||||||
static const QString timelineWidthKey;
|
Utils::IntegerAspect timelineWidth;
|
||||||
static const QString timelineLineageFilterKey;
|
Utils::StringAspect timelineLineageFilter;
|
||||||
static const QString timelineVerboseKey;
|
Utils::BoolAspect timelineVerbose;
|
||||||
static const QString timelineItemTypeKey;
|
Utils::StringAspect timelineItemType;
|
||||||
static const QString disableAutosyncKey;
|
Utils::BoolAspect disableAutosync;
|
||||||
|
|
||||||
FossilSettings();
|
FossilSettings();
|
||||||
};
|
};
|
||||||
@@ -66,5 +67,11 @@ inline bool operator== (const RepositorySettings &lh, const RepositorySettings &
|
|||||||
&& lh.sslIdentityFile == rh.sslIdentityFile);
|
&& lh.sslIdentityFile == rh.sslIdentityFile);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
class OptionsPage : public Core::IOptionsPage
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
OptionsPage(const std::function<void()> &onApply, FossilSettings *settings);
|
||||||
|
};
|
||||||
|
|
||||||
} // namespace Internal
|
} // namespace Internal
|
||||||
} // namespace Fossil
|
} // namespace Fossil
|
||||||
|
|||||||
@@ -1,103 +0,0 @@
|
|||||||
/****************************************************************************
|
|
||||||
**
|
|
||||||
** Copyright (c) 2018 Artur Shepilko
|
|
||||||
** Contact: https://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 https://www.qt.io/terms-conditions. For further
|
|
||||||
** information use the contact form at https://www.qt.io/contact-us.
|
|
||||||
**
|
|
||||||
** GNU General Public License Usage
|
|
||||||
** Alternatively, this file may be used under the terms of the GNU
|
|
||||||
** General Public License version 3 as published by the Free Software
|
|
||||||
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
|
|
||||||
** included in the packaging of this file. Please review the following
|
|
||||||
** information to ensure the GNU General Public License requirements will
|
|
||||||
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
|
|
||||||
**
|
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
#include "optionspage.h"
|
|
||||||
#include "constants.h"
|
|
||||||
#include "fossilclient.h"
|
|
||||||
#include "fossilsettings.h"
|
|
||||||
#include "fossilplugin.h"
|
|
||||||
#include "ui_optionspage.h"
|
|
||||||
|
|
||||||
#include <coreplugin/icore.h>
|
|
||||||
#include <utils/pathchooser.h>
|
|
||||||
#include <vcsbase/vcsbaseconstants.h>
|
|
||||||
|
|
||||||
namespace Fossil {
|
|
||||||
namespace Internal {
|
|
||||||
|
|
||||||
class OptionsPageWidget final : public Core::IOptionsPageWidget
|
|
||||||
{
|
|
||||||
Q_DECLARE_TR_FUNCTIONS(Fossil::Internal::OptionsPageWidget)
|
|
||||||
|
|
||||||
public:
|
|
||||||
OptionsPageWidget(const std::function<void()> &onApply, FossilSettings *settings);
|
|
||||||
void apply() final;
|
|
||||||
|
|
||||||
private:
|
|
||||||
Ui::OptionsPage m_ui;
|
|
||||||
const std::function<void()> m_onApply;
|
|
||||||
FossilSettings *m_settings;
|
|
||||||
};
|
|
||||||
|
|
||||||
void OptionsPageWidget::apply()
|
|
||||||
{
|
|
||||||
FossilSettings s = *m_settings;
|
|
||||||
s.setValue(FossilSettings::binaryPathKey, m_ui.commandChooser->rawPath());
|
|
||||||
s.setValue(FossilSettings::defaultRepoPathKey, m_ui.defaultRepoPathChooser->path());
|
|
||||||
s.setValue(FossilSettings::userNameKey, m_ui.defaultUsernameLineEdit->text().trimmed());
|
|
||||||
s.setValue(FossilSettings::sslIdentityFileKey, m_ui.sslIdentityFilePathChooser->path());
|
|
||||||
s.setValue(FossilSettings::logCountKey, m_ui.logEntriesCount->value());
|
|
||||||
s.setValue(FossilSettings::timelineWidthKey, m_ui.logEntriesWidth->value());
|
|
||||||
s.setValue(FossilSettings::timeoutKey, m_ui.timeout->value());
|
|
||||||
s.setValue(FossilSettings::disableAutosyncKey, m_ui.disableAutosyncCheckBox->isChecked());
|
|
||||||
if (*m_settings == s)
|
|
||||||
return;
|
|
||||||
|
|
||||||
*m_settings = s;
|
|
||||||
m_onApply();
|
|
||||||
}
|
|
||||||
|
|
||||||
OptionsPageWidget::OptionsPageWidget(const std::function<void()> &onApply, FossilSettings *settings) :
|
|
||||||
m_onApply(onApply),
|
|
||||||
m_settings(settings)
|
|
||||||
{
|
|
||||||
m_ui.setupUi(this);
|
|
||||||
m_ui.commandChooser->setExpectedKind(Utils::PathChooser::ExistingCommand);
|
|
||||||
m_ui.commandChooser->setPromptDialogTitle(tr("Fossil Command"));
|
|
||||||
m_ui.commandChooser->setHistoryCompleter("Fossil.Command.History");
|
|
||||||
m_ui.commandChooser->setPath(m_settings->stringValue(FossilSettings::binaryPathKey));
|
|
||||||
m_ui.defaultRepoPathChooser->setExpectedKind(Utils::PathChooser::ExistingDirectory);
|
|
||||||
m_ui.defaultRepoPathChooser->setPromptDialogTitle(tr("Fossil Repositories"));
|
|
||||||
m_ui.defaultRepoPathChooser->setPath(m_settings->stringValue(FossilSettings::defaultRepoPathKey));
|
|
||||||
m_ui.sslIdentityFilePathChooser->setExpectedKind(Utils::PathChooser::File);
|
|
||||||
m_ui.sslIdentityFilePathChooser->setPromptDialogTitle(tr("SSL/TLS Identity Key"));
|
|
||||||
m_ui.sslIdentityFilePathChooser->setPath(m_settings->stringValue(FossilSettings::sslIdentityFileKey));
|
|
||||||
m_ui.defaultUsernameLineEdit->setText(m_settings->stringValue(FossilSettings::userNameKey));
|
|
||||||
m_ui.logEntriesCount->setValue(m_settings->intValue(FossilSettings::logCountKey));
|
|
||||||
m_ui.logEntriesWidth->setValue(m_settings->intValue(FossilSettings::timelineWidthKey));
|
|
||||||
m_ui.timeout->setValue(m_settings->intValue(FossilSettings::timeoutKey));
|
|
||||||
m_ui.disableAutosyncCheckBox->setChecked(m_settings->boolValue(FossilSettings::disableAutosyncKey));
|
|
||||||
}
|
|
||||||
|
|
||||||
OptionsPage::OptionsPage(const std::function<void()> &onApply, FossilSettings *settings)
|
|
||||||
{
|
|
||||||
setId(Constants::VCS_ID_FOSSIL);
|
|
||||||
setDisplayName(OptionsPageWidget::tr("Fossil"));
|
|
||||||
setWidgetCreator([onApply, settings]() { return new OptionsPageWidget(onApply, settings); });
|
|
||||||
setCategory(VcsBase::Constants::VCS_SETTINGS_CATEGORY);
|
|
||||||
}
|
|
||||||
|
|
||||||
} // Internal
|
|
||||||
} // Fossil
|
|
||||||
@@ -1,42 +0,0 @@
|
|||||||
/****************************************************************************
|
|
||||||
**
|
|
||||||
** Copyright (c) 2018 Artur Shepilko
|
|
||||||
** Contact: https://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 https://www.qt.io/terms-conditions. For further
|
|
||||||
** information use the contact form at https://www.qt.io/contact-us.
|
|
||||||
**
|
|
||||||
** GNU General Public License Usage
|
|
||||||
** Alternatively, this file may be used under the terms of the GNU
|
|
||||||
** General Public License version 3 as published by the Free Software
|
|
||||||
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
|
|
||||||
** included in the packaging of this file. Please review the following
|
|
||||||
** information to ensure the GNU General Public License requirements will
|
|
||||||
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
|
|
||||||
**
|
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
#pragma once
|
|
||||||
|
|
||||||
#include <coreplugin/dialogs/ioptionspage.h>
|
|
||||||
|
|
||||||
namespace Fossil {
|
|
||||||
namespace Internal {
|
|
||||||
|
|
||||||
class FossilSettings;
|
|
||||||
|
|
||||||
class OptionsPage : public Core::IOptionsPage
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
OptionsPage(const std::function<void()> &onApply, FossilSettings *settings);
|
|
||||||
};
|
|
||||||
|
|
||||||
} // namespace Internal
|
|
||||||
} // namespace Fossil
|
|
||||||
@@ -1,229 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<ui version="4.0">
|
|
||||||
<class>Fossil::Internal::OptionsPage</class>
|
|
||||||
<widget class="QWidget" name="Fossil::Internal::OptionsPage">
|
|
||||||
<property name="geometry">
|
|
||||||
<rect>
|
|
||||||
<x>0</x>
|
|
||||||
<y>0</y>
|
|
||||||
<width>649</width>
|
|
||||||
<height>336</height>
|
|
||||||
</rect>
|
|
||||||
</property>
|
|
||||||
<property name="windowTitle">
|
|
||||||
<string/>
|
|
||||||
</property>
|
|
||||||
<layout class="QVBoxLayout" name="verticalLayout">
|
|
||||||
<item>
|
|
||||||
<widget class="QGroupBox" name="configGroupBox">
|
|
||||||
<property name="title">
|
|
||||||
<string>Configuration</string>
|
|
||||||
</property>
|
|
||||||
<layout class="QFormLayout" name="formLayout_3">
|
|
||||||
<property name="fieldGrowthPolicy">
|
|
||||||
<enum>QFormLayout::ExpandingFieldsGrow</enum>
|
|
||||||
</property>
|
|
||||||
<item row="0" column="0">
|
|
||||||
<widget class="QLabel" name="commandLabel">
|
|
||||||
<property name="text">
|
|
||||||
<string>Command:</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="0" column="1">
|
|
||||||
<widget class="Utils::PathChooser" name="commandChooser" native="true"/>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QGroupBox" name="repoGroupBox">
|
|
||||||
<property name="title">
|
|
||||||
<string>Local Repositories</string>
|
|
||||||
</property>
|
|
||||||
<layout class="QFormLayout" name="formLayout_4">
|
|
||||||
<item row="0" column="0">
|
|
||||||
<widget class="QLabel" name="defaultRepoPathLabel">
|
|
||||||
<property name="toolTip">
|
|
||||||
<string>Directory to store local repositories by default.</string>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>Default path:</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="0" column="1">
|
|
||||||
<widget class="Utils::PathChooser" name="defaultRepoPathChooser" native="true">
|
|
||||||
<property name="toolTip">
|
|
||||||
<string>Directory to store local repositories by default.</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QGroupBox" name="userGroupBox">
|
|
||||||
<property name="title">
|
|
||||||
<string>User</string>
|
|
||||||
</property>
|
|
||||||
<layout class="QFormLayout" name="formLayout">
|
|
||||||
<property name="fieldGrowthPolicy">
|
|
||||||
<enum>QFormLayout::ExpandingFieldsGrow</enum>
|
|
||||||
</property>
|
|
||||||
<item row="0" column="0">
|
|
||||||
<widget class="QLabel" name="defaultUsernameLabel">
|
|
||||||
<property name="text">
|
|
||||||
<string>Default user:</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="0" column="1">
|
|
||||||
<widget class="QLineEdit" name="defaultUsernameLineEdit">
|
|
||||||
<property name="toolTip">
|
|
||||||
<string>Existing user to become an author of changes made to the repository.</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="1" column="0">
|
|
||||||
<widget class="QLabel" name="sslIdentityFileLabel">
|
|
||||||
<property name="text">
|
|
||||||
<string>SSL/TLS identity:</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="1" column="1">
|
|
||||||
<widget class="Utils::PathChooser" name="sslIdentityFilePathChooser" native="true">
|
|
||||||
<property name="toolTip">
|
|
||||||
<string>SSL/TLS client identity key to use if requested by the server.</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QGroupBox" name="miscGroupBox">
|
|
||||||
<property name="title">
|
|
||||||
<string>Miscellaneous</string>
|
|
||||||
</property>
|
|
||||||
<layout class="QGridLayout" name="gridLayout">
|
|
||||||
<item row="0" column="0">
|
|
||||||
<widget class="QLabel" name="showLogEntriesLabel">
|
|
||||||
<property name="text">
|
|
||||||
<string>Log count:</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="0" column="1">
|
|
||||||
<widget class="QSpinBox" name="logEntriesCount">
|
|
||||||
<property name="toolTip">
|
|
||||||
<string>The number of recent commit log entries to show. Choose 0 to see all entries.</string>
|
|
||||||
</property>
|
|
||||||
<property name="maximum">
|
|
||||||
<number>1000</number>
|
|
||||||
</property>
|
|
||||||
<property name="value">
|
|
||||||
<number>300</number>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="0" column="2">
|
|
||||||
<widget class="QLabel" name="logEntriesWidthLabel">
|
|
||||||
<property name="text">
|
|
||||||
<string>Log width:</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="0" column="3">
|
|
||||||
<widget class="QSpinBox" name="logEntriesWidth">
|
|
||||||
<property name="toolTip">
|
|
||||||
<string>The width of log entry line (>20). Choose 0 to see a single line per entry.</string>
|
|
||||||
</property>
|
|
||||||
<property name="maximum">
|
|
||||||
<number>300</number>
|
|
||||||
</property>
|
|
||||||
<property name="value">
|
|
||||||
<number>0</number>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="0" column="4">
|
|
||||||
<widget class="QLabel" name="timeoutSecondsLabel">
|
|
||||||
<property name="text">
|
|
||||||
<string>Timeout:</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="0" column="5">
|
|
||||||
<widget class="QSpinBox" name="timeout">
|
|
||||||
<property name="suffix">
|
|
||||||
<string>s</string>
|
|
||||||
</property>
|
|
||||||
<property name="maximum">
|
|
||||||
<number>360</number>
|
|
||||||
</property>
|
|
||||||
<property name="value">
|
|
||||||
<number>30</number>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="0" column="6">
|
|
||||||
<spacer name="horizontalSpacer">
|
|
||||||
<property name="orientation">
|
|
||||||
<enum>Qt::Horizontal</enum>
|
|
||||||
</property>
|
|
||||||
<property name="sizeHint" stdset="0">
|
|
||||||
<size>
|
|
||||||
<width>213</width>
|
|
||||||
<height>20</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
</spacer>
|
|
||||||
</item>
|
|
||||||
<item row="2" column="0" colspan="5">
|
|
||||||
<widget class="QCheckBox" name="disableAutosyncCheckBox">
|
|
||||||
<property name="toolTip">
|
|
||||||
<string>Disable automatic pull prior to commit or update and automatic push after commit or tag or branch creation.</string>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>Disable auto-sync</string>
|
|
||||||
</property>
|
|
||||||
<property name="checked">
|
|
||||||
<bool>false</bool>
|
|
||||||
</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>40</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>
|
|
||||||
@@ -48,7 +48,7 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
Utils::Id m_vscId;
|
Utils::Id m_vscId;
|
||||||
VcsBase::VcsBaseClientSettings *m_settings;
|
FossilSettings *m_settings;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@@ -59,7 +59,7 @@ void FossilJsExtension::parseArgOptions(const QStringList &args, QMap<QString, Q
|
|||||||
foreach (const QString &arg, args) {
|
foreach (const QString &arg, args) {
|
||||||
if (arg.isEmpty()) continue;
|
if (arg.isEmpty()) continue;
|
||||||
|
|
||||||
QStringList opt = arg.split('|'); //keep empty parts
|
QStringList opt = arg.split('|', Qt::KeepEmptyParts);
|
||||||
options.insert(opt[0], opt.size() > 1 ? opt[1] : QString());
|
options.insert(opt[0], opt.size() > 1 ? opt[1] : QString());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -90,7 +90,7 @@ QString FossilJsExtension::defaultAdminUser() const
|
|||||||
if (!isConfigured())
|
if (!isConfigured())
|
||||||
return QString();
|
return QString();
|
||||||
|
|
||||||
return d->m_settings->stringValue(FossilSettings::userNameKey);
|
return d->m_settings->userName.value();
|
||||||
}
|
}
|
||||||
|
|
||||||
QString FossilJsExtension::defaultSslIdentityFile() const
|
QString FossilJsExtension::defaultSslIdentityFile() const
|
||||||
@@ -98,7 +98,7 @@ QString FossilJsExtension::defaultSslIdentityFile() const
|
|||||||
if (!isConfigured())
|
if (!isConfigured())
|
||||||
return QString();
|
return QString();
|
||||||
|
|
||||||
return d->m_settings->stringValue(FossilSettings::sslIdentityFileKey);
|
return d->m_settings->sslIdentityFile.value();
|
||||||
}
|
}
|
||||||
|
|
||||||
QString FossilJsExtension::defaultLocalRepoPath() const
|
QString FossilJsExtension::defaultLocalRepoPath() const
|
||||||
@@ -106,7 +106,7 @@ QString FossilJsExtension::defaultLocalRepoPath() const
|
|||||||
if (!isConfigured())
|
if (!isConfigured())
|
||||||
return QString();
|
return QString();
|
||||||
|
|
||||||
return d->m_settings->stringValue(FossilSettings::defaultRepoPathKey);
|
return d->m_settings->defaultRepoPath.value();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool FossilJsExtension::defaultDisableAutosync() const
|
bool FossilJsExtension::defaultDisableAutosync() const
|
||||||
@@ -114,7 +114,7 @@ bool FossilJsExtension::defaultDisableAutosync() const
|
|||||||
if (!isConfigured())
|
if (!isConfigured())
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
return d->m_settings->boolValue(FossilSettings::disableAutosyncKey);
|
return d->m_settings->disableAutosync.value();
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace Internal
|
} // namespace Internal
|
||||||
|
|||||||
Reference in New Issue
Block a user