forked from qt-creator/qt-creator
Vcs: Use PagedSettings for all plugin settings
Hopefully the last structural change for a while. Settings lifetime is again tied to the plugin private. Change-Id: I221e8b8baa69422306191b48a9f034ef5b1a0dc2 Reviewed-by: Orgad Shaneh <orgads@gmail.com>
This commit is contained in:
@@ -215,8 +215,8 @@ public:
|
|||||||
void createRepositoryActions(const Core::Context &context);
|
void createRepositoryActions(const Core::Context &context);
|
||||||
|
|
||||||
// Variables
|
// Variables
|
||||||
|
BazaarSettings m_setting;
|
||||||
BazaarClient m_client;
|
BazaarClient m_client;
|
||||||
BazaarSettingsPage m_settingPage;
|
|
||||||
|
|
||||||
VcsSubmitEditorFactory m_submitEditorFactory {
|
VcsSubmitEditorFactory m_submitEditorFactory {
|
||||||
submitEditorParameters,
|
submitEditorParameters,
|
||||||
|
@@ -16,10 +16,21 @@ using namespace Utils;
|
|||||||
|
|
||||||
namespace Bazaar::Internal {
|
namespace Bazaar::Internal {
|
||||||
|
|
||||||
|
static BazaarSettings *theSettings;
|
||||||
|
|
||||||
|
BazaarSettings &settings()
|
||||||
|
{
|
||||||
|
return *theSettings;
|
||||||
|
}
|
||||||
|
|
||||||
BazaarSettings::BazaarSettings()
|
BazaarSettings::BazaarSettings()
|
||||||
{
|
{
|
||||||
|
theSettings = this;
|
||||||
|
|
||||||
setSettingsGroup(Constants::BAZAAR);
|
setSettingsGroup(Constants::BAZAAR);
|
||||||
setAutoApply(false);
|
setId(VcsBase::Constants::VCS_ID_BAZAAR);
|
||||||
|
setDisplayName(Tr::tr("Bazaar"));
|
||||||
|
setCategory(VcsBase::Constants::VCS_SETTINGS_CATEGORY);
|
||||||
|
|
||||||
registerAspect(&binaryPath);
|
registerAspect(&binaryPath);
|
||||||
binaryPath.setDisplayStyle(StringAspect::PathChooserDisplay);
|
binaryPath.setDisplayStyle(StringAspect::PathChooserDisplay);
|
||||||
@@ -66,52 +77,31 @@ BazaarSettings::BazaarSettings()
|
|||||||
registerAspect(&logCount);
|
registerAspect(&logCount);
|
||||||
timeout.setLabelText(Tr::tr("Timeout:"));
|
timeout.setLabelText(Tr::tr("Timeout:"));
|
||||||
timeout.setSuffix(Tr::tr("s"));
|
timeout.setSuffix(Tr::tr("s"));
|
||||||
}
|
|
||||||
|
|
||||||
// BazaarSettingsPage
|
setLayouter([this](QWidget *widget) {
|
||||||
|
|
||||||
BazaarSettingsPage::BazaarSettingsPage()
|
|
||||||
{
|
|
||||||
setId(VcsBase::Constants::VCS_ID_BAZAAR);
|
|
||||||
setDisplayName(Tr::tr("Bazaar"));
|
|
||||||
setCategory(VcsBase::Constants::VCS_SETTINGS_CATEGORY);
|
|
||||||
setSettings(&settings());
|
|
||||||
|
|
||||||
setLayouter([](QWidget *widget) {
|
|
||||||
BazaarSettings &s = settings();
|
|
||||||
using namespace Layouting;
|
using namespace Layouting;
|
||||||
|
|
||||||
Column {
|
Column {
|
||||||
Group {
|
Group {
|
||||||
title(Tr::tr("Configuration")),
|
title(Tr::tr("Configuration")),
|
||||||
Row { s.binaryPath }
|
Row { binaryPath }
|
||||||
},
|
},
|
||||||
|
|
||||||
Group {
|
Group {
|
||||||
title(Tr::tr("User")),
|
title(Tr::tr("User")),
|
||||||
Form {
|
Form {
|
||||||
s.userName, br,
|
userName, br,
|
||||||
s.userEmail
|
userEmail
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
Group {
|
Group {
|
||||||
title(Tr::tr("Miscellaneous")),
|
title(Tr::tr("Miscellaneous")),
|
||||||
Row {
|
Row { logCount, timeout, st }
|
||||||
s.logCount,
|
|
||||||
s.timeout,
|
|
||||||
st
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
st
|
st
|
||||||
}.attachTo(widget);
|
}.attachTo(widget);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
BazaarSettings &settings()
|
|
||||||
{
|
|
||||||
static BazaarSettings theSettings;
|
|
||||||
return theSettings;
|
|
||||||
}
|
|
||||||
|
|
||||||
} // Bazaar::Internal
|
} // Bazaar::Internal
|
||||||
|
@@ -3,8 +3,6 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <coreplugin/dialogs/ioptionspage.h>
|
|
||||||
|
|
||||||
#include <vcsbase/vcsbaseclientsettings.h>
|
#include <vcsbase/vcsbaseclientsettings.h>
|
||||||
|
|
||||||
namespace Bazaar::Internal {
|
namespace Bazaar::Internal {
|
||||||
@@ -24,10 +22,4 @@ public:
|
|||||||
|
|
||||||
BazaarSettings &settings();
|
BazaarSettings &settings();
|
||||||
|
|
||||||
class BazaarSettingsPage final : public Core::IOptionsPage
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
BazaarSettingsPage();
|
|
||||||
};
|
|
||||||
|
|
||||||
} // Bazaar::Internal
|
} // Bazaar::Internal
|
||||||
|
@@ -288,6 +288,7 @@ private:
|
|||||||
bool commit(const QString &messageFile, const QStringList &subVersionFileList);
|
bool commit(const QString &messageFile, const QStringList &subVersionFileList);
|
||||||
void cleanCommitMessageFile();
|
void cleanCommitMessageFile();
|
||||||
|
|
||||||
|
CvsSettings m_setting;
|
||||||
CvsClient *m_client = nullptr;
|
CvsClient *m_client = nullptr;
|
||||||
|
|
||||||
QString m_commitMessageFileName;
|
QString m_commitMessageFileName;
|
||||||
@@ -320,8 +321,6 @@ private:
|
|||||||
|
|
||||||
QAction *m_menuAction = nullptr;
|
QAction *m_menuAction = nullptr;
|
||||||
|
|
||||||
CvsSettingsPage m_settingsPage;
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
VcsSubmitEditorFactory submitEditorFactory {
|
VcsSubmitEditorFactory submitEditorFactory {
|
||||||
submitParameters,
|
submitParameters,
|
||||||
|
@@ -17,12 +17,22 @@ using namespace Utils;
|
|||||||
|
|
||||||
namespace Cvs::Internal {
|
namespace Cvs::Internal {
|
||||||
|
|
||||||
// CvsSettings
|
static CvsSettings *theSettings;
|
||||||
|
|
||||||
|
CvsSettings &settings()
|
||||||
|
{
|
||||||
|
return *theSettings;
|
||||||
|
}
|
||||||
|
|
||||||
CvsSettings::CvsSettings()
|
CvsSettings::CvsSettings()
|
||||||
{
|
{
|
||||||
|
theSettings = this;
|
||||||
setSettingsGroup("CVS");
|
setSettingsGroup("CVS");
|
||||||
|
|
||||||
|
setId(VcsBase::Constants::VCS_ID_CVS);
|
||||||
|
setDisplayName(Tr::tr("CVS"));
|
||||||
|
setCategory(VcsBase::Constants::VCS_SETTINGS_CATEGORY);
|
||||||
|
|
||||||
registerAspect(&binaryPath);
|
registerAspect(&binaryPath);
|
||||||
binaryPath.setDefaultValue("cvs" QTC_HOST_EXE_SUFFIX);
|
binaryPath.setDefaultValue("cvs" QTC_HOST_EXE_SUFFIX);
|
||||||
binaryPath.setDisplayStyle(StringAspect::PathChooserDisplay);
|
binaryPath.setDisplayStyle(StringAspect::PathChooserDisplay);
|
||||||
@@ -55,6 +65,30 @@ CvsSettings::CvsSettings()
|
|||||||
|
|
||||||
registerAspect(&diffIgnoreBlankLines);
|
registerAspect(&diffIgnoreBlankLines);
|
||||||
diffIgnoreBlankLines.setSettingsKey("DiffIgnoreBlankLines");
|
diffIgnoreBlankLines.setSettingsKey("DiffIgnoreBlankLines");
|
||||||
|
|
||||||
|
setLayouter([this](QWidget *widget) {
|
||||||
|
using namespace Layouting;
|
||||||
|
Column {
|
||||||
|
Group {
|
||||||
|
title(Tr::tr("Configuration")),
|
||||||
|
Form {
|
||||||
|
binaryPath, br,
|
||||||
|
cvsRoot
|
||||||
|
}
|
||||||
|
},
|
||||||
|
Group {
|
||||||
|
title(Tr::tr("Miscellaneous")),
|
||||||
|
Column {
|
||||||
|
Form {
|
||||||
|
timeout, br,
|
||||||
|
diffOptions,
|
||||||
|
},
|
||||||
|
describeByCommitId,
|
||||||
|
}
|
||||||
|
},
|
||||||
|
st
|
||||||
|
}.attachTo(widget);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
QStringList CvsSettings::addOptions(const QStringList &args) const
|
QStringList CvsSettings::addOptions(const QStringList &args) const
|
||||||
@@ -70,44 +104,4 @@ QStringList CvsSettings::addOptions(const QStringList &args) const
|
|||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
CvsSettingsPage::CvsSettingsPage()
|
|
||||||
{
|
|
||||||
setId(VcsBase::Constants::VCS_ID_CVS);
|
|
||||||
setDisplayName(Tr::tr("CVS"));
|
|
||||||
setCategory(VcsBase::Constants::VCS_SETTINGS_CATEGORY);
|
|
||||||
setSettings(&settings());
|
|
||||||
|
|
||||||
setLayouter([](QWidget *widget) {
|
|
||||||
CvsSettings &s = settings();
|
|
||||||
using namespace Layouting;
|
|
||||||
|
|
||||||
Column {
|
|
||||||
Group {
|
|
||||||
title(Tr::tr("Configuration")),
|
|
||||||
Form {
|
|
||||||
s.binaryPath, br,
|
|
||||||
s.cvsRoot
|
|
||||||
}
|
|
||||||
},
|
|
||||||
Group {
|
|
||||||
title(Tr::tr("Miscellaneous")),
|
|
||||||
Column {
|
|
||||||
Form {
|
|
||||||
s.timeout, br,
|
|
||||||
s.diffOptions,
|
|
||||||
},
|
|
||||||
s.describeByCommitId,
|
|
||||||
}
|
|
||||||
},
|
|
||||||
st
|
|
||||||
}.attachTo(widget);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
CvsSettings &settings()
|
|
||||||
{
|
|
||||||
static CvsSettings theSettings;
|
|
||||||
return theSettings;
|
|
||||||
}
|
|
||||||
|
|
||||||
} // Cvs::Internal
|
} // Cvs::Internal
|
||||||
|
@@ -3,8 +3,6 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <coreplugin/dialogs/ioptionspage.h>
|
|
||||||
|
|
||||||
#include <vcsbase/vcsbaseclientsettings.h>
|
#include <vcsbase/vcsbaseclientsettings.h>
|
||||||
|
|
||||||
namespace Cvs::Internal {
|
namespace Cvs::Internal {
|
||||||
@@ -25,10 +23,4 @@ public:
|
|||||||
|
|
||||||
CvsSettings &settings();
|
CvsSettings &settings();
|
||||||
|
|
||||||
class CvsSettingsPage final : public Core::IOptionsPage
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
CvsSettingsPage();
|
|
||||||
};
|
|
||||||
|
|
||||||
} // Cvs::Internal
|
} // Cvs::Internal
|
||||||
|
@@ -187,10 +187,9 @@ public:
|
|||||||
bool pullOrPush(SyncMode mode);
|
bool pullOrPush(SyncMode mode);
|
||||||
|
|
||||||
// Variables
|
// Variables
|
||||||
|
FossilSettings m_settings;
|
||||||
FossilClient m_client;
|
FossilClient m_client;
|
||||||
|
|
||||||
OptionsPage optionPage;
|
|
||||||
|
|
||||||
VcsSubmitEditorFactory submitEditorFactory {
|
VcsSubmitEditorFactory submitEditorFactory {
|
||||||
submitEditorParameters,
|
submitEditorParameters,
|
||||||
[] { return new CommitEditor; },
|
[] { return new CommitEditor; },
|
||||||
|
@@ -17,10 +17,21 @@ using namespace Utils;
|
|||||||
|
|
||||||
namespace Fossil::Internal {
|
namespace Fossil::Internal {
|
||||||
|
|
||||||
|
static FossilSettings *theSettings;
|
||||||
|
|
||||||
|
FossilSettings &settings()
|
||||||
|
{
|
||||||
|
return *theSettings;
|
||||||
|
}
|
||||||
|
|
||||||
FossilSettings::FossilSettings()
|
FossilSettings::FossilSettings()
|
||||||
{
|
{
|
||||||
|
theSettings = this;
|
||||||
|
|
||||||
setSettingsGroup(Constants::FOSSIL);
|
setSettingsGroup(Constants::FOSSIL);
|
||||||
setAutoApply(false);
|
setId(Constants::VCS_ID_FOSSIL);
|
||||||
|
setDisplayName(Tr::tr("Fossil"));
|
||||||
|
setCategory(VcsBase::Constants::VCS_SETTINGS_CATEGORY);
|
||||||
|
|
||||||
registerAspect(&binaryPath);
|
registerAspect(&binaryPath);
|
||||||
binaryPath.setDisplayStyle(StringAspect::PathChooserDisplay);
|
binaryPath.setDisplayStyle(StringAspect::PathChooserDisplay);
|
||||||
@@ -94,69 +105,38 @@ FossilSettings::FossilSettings()
|
|||||||
logCount.setLabelText(Tr::tr("Log count:"));
|
logCount.setLabelText(Tr::tr("Log count:"));
|
||||||
logCount.setToolTip(Tr::tr("The number of recent commit log entries to show. "
|
logCount.setToolTip(Tr::tr("The number of recent commit log entries to show. "
|
||||||
"Choose 0 to see all entries."));
|
"Choose 0 to see all entries."));
|
||||||
}
|
|
||||||
|
|
||||||
// OptionsPage
|
|
||||||
|
|
||||||
class OptionsPageWidget final : public Core::IOptionsPageWidget
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
OptionsPageWidget()
|
|
||||||
{
|
|
||||||
FossilSettings &s = settings();
|
|
||||||
|
|
||||||
|
setLayouter([this](QWidget *widget) {
|
||||||
using namespace Layouting;
|
using namespace Layouting;
|
||||||
|
|
||||||
Column {
|
Column {
|
||||||
Group {
|
Group {
|
||||||
title(Tr::tr("Configuration")),
|
title(Tr::tr("Configuration")),
|
||||||
Row { s.binaryPath }
|
Row { binaryPath }
|
||||||
},
|
},
|
||||||
|
|
||||||
Group {
|
Group {
|
||||||
title(Tr::tr("Local Repositories")),
|
title(Tr::tr("Local Repositories")),
|
||||||
Row { s.defaultRepoPath }
|
Row { defaultRepoPath }
|
||||||
},
|
},
|
||||||
|
|
||||||
Group {
|
Group {
|
||||||
title(Tr::tr("User")),
|
title(Tr::tr("User")),
|
||||||
Form {
|
Form {
|
||||||
s.userName, br,
|
userName, br,
|
||||||
s.sslIdentityFile
|
sslIdentityFile
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
Group {
|
Group {
|
||||||
title(Tr::tr("Miscellaneous")),
|
title(Tr::tr("Miscellaneous")),
|
||||||
Column {
|
Column {
|
||||||
Row {
|
Row { logCount, timelineWidth, timeout, st },
|
||||||
s.logCount,
|
disableAutosync
|
||||||
s.timelineWidth,
|
|
||||||
s.timeout,
|
|
||||||
st
|
|
||||||
},
|
|
||||||
s.disableAutosync
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
st
|
st
|
||||||
|
}.attachTo(widget);
|
||||||
}.attachTo(this);
|
});
|
||||||
|
|
||||||
setOnApply([] { settings().apply(); });
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
OptionsPage::OptionsPage()
|
|
||||||
{
|
|
||||||
setId(Constants::VCS_ID_FOSSIL);
|
|
||||||
setDisplayName(Tr::tr("Fossil"));
|
|
||||||
setWidgetCreator([] { return new OptionsPageWidget; });
|
|
||||||
setCategory(VcsBase::Constants::VCS_SETTINGS_CATEGORY);
|
|
||||||
}
|
|
||||||
|
|
||||||
FossilSettings &settings()
|
|
||||||
{
|
|
||||||
static FossilSettings theSettings;
|
|
||||||
return theSettings;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
} // Fossil::Internal
|
} // Fossil::Internal
|
||||||
|
@@ -3,7 +3,6 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <coreplugin/dialogs/ioptionspage.h>
|
|
||||||
#include <vcsbase/vcsbaseclientsettings.h>
|
#include <vcsbase/vcsbaseclientsettings.h>
|
||||||
|
|
||||||
namespace Fossil::Internal {
|
namespace Fossil::Internal {
|
||||||
@@ -44,10 +43,4 @@ struct RepositorySettings
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
class OptionsPage : public Core::IOptionsPage
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
OptionsPage();
|
|
||||||
};
|
|
||||||
|
|
||||||
} // Fossil::Internal
|
} // Fossil::Internal
|
||||||
|
@@ -397,6 +397,7 @@ public:
|
|||||||
|
|
||||||
void onApplySettings();
|
void onApplySettings();
|
||||||
|
|
||||||
|
GitSettings setting;
|
||||||
CommandLocator *m_commandLocator = nullptr;
|
CommandLocator *m_commandLocator = nullptr;
|
||||||
|
|
||||||
QAction *m_menuAction = nullptr;
|
QAction *m_menuAction = nullptr;
|
||||||
@@ -433,8 +434,6 @@ public:
|
|||||||
std::unique_ptr<BlameMark> m_blameMark;
|
std::unique_ptr<BlameMark> m_blameMark;
|
||||||
QMetaObject::Connection m_blameCursorPosConn;
|
QMetaObject::Connection m_blameCursorPosConn;
|
||||||
|
|
||||||
GitSettingsPage settingPage;
|
|
||||||
|
|
||||||
GitGrep gitGrep{&m_gitClient};
|
GitGrep gitGrep{&m_gitClient};
|
||||||
|
|
||||||
VcsEditorFactory svnLogEditorFactory {
|
VcsEditorFactory svnLogEditorFactory {
|
||||||
|
@@ -17,8 +17,21 @@ using namespace VcsBase;
|
|||||||
|
|
||||||
namespace Git::Internal {
|
namespace Git::Internal {
|
||||||
|
|
||||||
|
static GitSettings *theSettings;
|
||||||
|
|
||||||
|
GitSettings &settings()
|
||||||
|
{
|
||||||
|
return *theSettings;
|
||||||
|
}
|
||||||
|
|
||||||
GitSettings::GitSettings()
|
GitSettings::GitSettings()
|
||||||
{
|
{
|
||||||
|
theSettings = this;
|
||||||
|
|
||||||
|
setId(VcsBase::Constants::VCS_ID_GIT);
|
||||||
|
setDisplayName(Tr::tr("Git"));
|
||||||
|
setCategory(VcsBase::Constants::VCS_SETTINGS_CATEGORY);
|
||||||
|
|
||||||
setSettingsGroup("Git");
|
setSettingsGroup("Git");
|
||||||
|
|
||||||
path.setDisplayStyle(StringAspect::LineEditDisplay);
|
path.setDisplayStyle(StringAspect::LineEditDisplay);
|
||||||
@@ -117,6 +130,44 @@ GitSettings::GitSettings()
|
|||||||
|
|
||||||
timeout.setDefaultValue(Utils::HostOsInfo::isWindowsHost() ? 60 : 30);
|
timeout.setDefaultValue(Utils::HostOsInfo::isWindowsHost() ? 60 : 30);
|
||||||
|
|
||||||
|
setLayouter([this](QWidget *widget) {
|
||||||
|
using namespace Layouting;
|
||||||
|
|
||||||
|
Column {
|
||||||
|
Group {
|
||||||
|
title(Tr::tr("Configuration")),
|
||||||
|
Column {
|
||||||
|
Row { path },
|
||||||
|
winSetHomeEnvironment,
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
Group {
|
||||||
|
title(Tr::tr("Miscellaneous")),
|
||||||
|
Column {
|
||||||
|
Row { logCount, timeout, st },
|
||||||
|
pullRebase
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
Group {
|
||||||
|
title(Tr::tr("Gitk")),
|
||||||
|
Row { gitkOptions }
|
||||||
|
},
|
||||||
|
|
||||||
|
Group {
|
||||||
|
title(Tr::tr("Repository Browser")),
|
||||||
|
Row { repositoryBrowserCmd }
|
||||||
|
},
|
||||||
|
|
||||||
|
Group {
|
||||||
|
title(Tr::tr("Instant Blame")),
|
||||||
|
Row { instantBlame }
|
||||||
|
},
|
||||||
|
|
||||||
|
st
|
||||||
|
}.attachTo(widget);
|
||||||
|
});
|
||||||
connect(&binaryPath, &StringAspect::valueChanged, this, [this] { tryResolve = true; });
|
connect(&binaryPath, &StringAspect::valueChanged, this, [this] { tryResolve = true; });
|
||||||
connect(&path, &StringAspect::valueChanged, this, [this] { tryResolve = true; });
|
connect(&path, &StringAspect::valueChanged, this, [this] { tryResolve = true; });
|
||||||
}
|
}
|
||||||
@@ -146,60 +197,4 @@ FilePath GitSettings::gitExecutable(bool *ok, QString *errorMessage) const
|
|||||||
return resolvedBinPath;
|
return resolvedBinPath;
|
||||||
}
|
}
|
||||||
|
|
||||||
// GitSettingsPage
|
|
||||||
|
|
||||||
GitSettingsPage::GitSettingsPage()
|
|
||||||
{
|
|
||||||
setId(VcsBase::Constants::VCS_ID_GIT);
|
|
||||||
setDisplayName(Tr::tr("Git"));
|
|
||||||
setCategory(VcsBase::Constants::VCS_SETTINGS_CATEGORY);
|
|
||||||
setSettings(&settings());
|
|
||||||
|
|
||||||
setLayouter([](QWidget *widget) {
|
|
||||||
GitSettings &s = settings();
|
|
||||||
using namespace Layouting;
|
|
||||||
|
|
||||||
Column {
|
|
||||||
Group {
|
|
||||||
title(Tr::tr("Configuration")),
|
|
||||||
Column {
|
|
||||||
Row { s.path },
|
|
||||||
s.winSetHomeEnvironment,
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
Group {
|
|
||||||
title(Tr::tr("Miscellaneous")),
|
|
||||||
Column {
|
|
||||||
Row { s.logCount, s.timeout, st },
|
|
||||||
s.pullRebase
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
Group {
|
|
||||||
title(Tr::tr("Gitk")),
|
|
||||||
Row { s.gitkOptions }
|
|
||||||
},
|
|
||||||
|
|
||||||
Group {
|
|
||||||
title(Tr::tr("Repository Browser")),
|
|
||||||
Row { s.repositoryBrowserCmd }
|
|
||||||
},
|
|
||||||
|
|
||||||
Group {
|
|
||||||
title(Tr::tr("Instant Blame")),
|
|
||||||
Row { s.instantBlame }
|
|
||||||
},
|
|
||||||
|
|
||||||
st
|
|
||||||
}.attachTo(widget);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
GitSettings &settings()
|
|
||||||
{
|
|
||||||
static GitSettings theSettings;
|
|
||||||
return theSettings;
|
|
||||||
}
|
|
||||||
|
|
||||||
} // Git::Internal
|
} // Git::Internal
|
||||||
|
@@ -3,7 +3,6 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <coreplugin/dialogs/ioptionspage.h>
|
|
||||||
#include <vcsbase/vcsbaseclientsettings.h>
|
#include <vcsbase/vcsbaseclientsettings.h>
|
||||||
|
|
||||||
namespace Git::Internal {
|
namespace Git::Internal {
|
||||||
@@ -48,10 +47,4 @@ public:
|
|||||||
|
|
||||||
GitSettings &settings();
|
GitSettings &settings();
|
||||||
|
|
||||||
class GitSettingsPage final : public Core::IOptionsPage
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
GitSettingsPage();
|
|
||||||
};
|
|
||||||
|
|
||||||
} // Git::Internal
|
} // Git::Internal
|
||||||
|
@@ -169,8 +169,8 @@ private:
|
|||||||
void createRepositoryActions(const Core::Context &context);
|
void createRepositoryActions(const Core::Context &context);
|
||||||
|
|
||||||
// Variables
|
// Variables
|
||||||
|
MercurialSettings m_settings;
|
||||||
MercurialClient m_client;
|
MercurialClient m_client;
|
||||||
MercurialSettingsPage m_settingsPage;
|
|
||||||
|
|
||||||
Core::CommandLocator *m_commandLocator = nullptr;
|
Core::CommandLocator *m_commandLocator = nullptr;
|
||||||
Core::ActionContainer *m_mercurialContainer = nullptr;
|
Core::ActionContainer *m_mercurialContainer = nullptr;
|
||||||
|
@@ -14,8 +14,22 @@ using namespace Utils;
|
|||||||
|
|
||||||
namespace Mercurial::Internal {
|
namespace Mercurial::Internal {
|
||||||
|
|
||||||
|
static MercurialSettings *theSettings;
|
||||||
|
|
||||||
|
MercurialSettings &settings()
|
||||||
|
{
|
||||||
|
return *theSettings;
|
||||||
|
}
|
||||||
|
|
||||||
MercurialSettings::MercurialSettings()
|
MercurialSettings::MercurialSettings()
|
||||||
{
|
{
|
||||||
|
theSettings = this;
|
||||||
|
|
||||||
|
setId(VcsBase::Constants::VCS_ID_MERCURIAL);
|
||||||
|
setDisplayName(Tr::tr("Mercurial"));
|
||||||
|
setCategory(VcsBase::Constants::VCS_SETTINGS_CATEGORY);
|
||||||
|
setSettings(&settings());
|
||||||
|
|
||||||
setSettingsGroup("Mercurial");
|
setSettingsGroup("Mercurial");
|
||||||
setAutoApply(false);
|
setAutoApply(false);
|
||||||
|
|
||||||
@@ -42,42 +56,27 @@ MercurialSettings::MercurialSettings()
|
|||||||
|
|
||||||
registerAspect(&diffIgnoreBlankLines);
|
registerAspect(&diffIgnoreBlankLines);
|
||||||
diffIgnoreBlankLines.setSettingsKey("diffIgnoreBlankLines");
|
diffIgnoreBlankLines.setSettingsKey("diffIgnoreBlankLines");
|
||||||
}
|
|
||||||
|
|
||||||
// MercurialSettingsPage
|
setLayouter([this](QWidget *widget) {
|
||||||
|
|
||||||
MercurialSettingsPage::MercurialSettingsPage()
|
|
||||||
{
|
|
||||||
setId(VcsBase::Constants::VCS_ID_MERCURIAL);
|
|
||||||
setDisplayName(Tr::tr("Mercurial"));
|
|
||||||
setCategory(VcsBase::Constants::VCS_SETTINGS_CATEGORY);
|
|
||||||
setSettings(&settings());
|
|
||||||
|
|
||||||
setLayouter([](QWidget *widget) {
|
|
||||||
MercurialSettings &s = settings();
|
|
||||||
using namespace Layouting;
|
using namespace Layouting;
|
||||||
|
|
||||||
Column {
|
Column {
|
||||||
Group {
|
Group {
|
||||||
title(Tr::tr("Configuration")),
|
title(Tr::tr("Configuration")),
|
||||||
Row { s.binaryPath }
|
Row { binaryPath }
|
||||||
},
|
},
|
||||||
|
|
||||||
Group {
|
Group {
|
||||||
title(Tr::tr("User")),
|
title(Tr::tr("User")),
|
||||||
Form {
|
Form {
|
||||||
s.userName, br,
|
userName, br,
|
||||||
s.userEmail
|
userEmail
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
Group {
|
Group {
|
||||||
title(Tr::tr("Miscellaneous")),
|
title(Tr::tr("Miscellaneous")),
|
||||||
Row {
|
Row { logCount, timeout, st }
|
||||||
s.logCount,
|
|
||||||
s.timeout,
|
|
||||||
st
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
|
|
||||||
st
|
st
|
||||||
@@ -85,10 +84,4 @@ MercurialSettingsPage::MercurialSettingsPage()
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
MercurialSettings &settings()
|
|
||||||
{
|
|
||||||
static MercurialSettings theSettings;
|
|
||||||
return theSettings;
|
|
||||||
}
|
|
||||||
|
|
||||||
} // Mercurial::Internal
|
} // Mercurial::Internal
|
||||||
|
@@ -3,8 +3,6 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <coreplugin/dialogs/ioptionspage.h>
|
|
||||||
|
|
||||||
#include <vcsbase/vcsbaseclientsettings.h>
|
#include <vcsbase/vcsbaseclientsettings.h>
|
||||||
|
|
||||||
namespace Mercurial::Internal {
|
namespace Mercurial::Internal {
|
||||||
@@ -20,10 +18,4 @@ public:
|
|||||||
|
|
||||||
MercurialSettings &settings();
|
MercurialSettings &settings();
|
||||||
|
|
||||||
class MercurialSettingsPage final : public Core::IOptionsPage
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
MercurialSettingsPage();
|
|
||||||
};
|
|
||||||
|
|
||||||
} // Mercurial::Internal
|
} // Mercurial::Internal
|
||||||
|
@@ -261,6 +261,7 @@ private:
|
|||||||
|
|
||||||
const QStringList m_svnDirectories;
|
const QStringList m_svnDirectories;
|
||||||
|
|
||||||
|
SubversionSettings m_settings;
|
||||||
SubversionClient *m_client = nullptr;
|
SubversionClient *m_client = nullptr;
|
||||||
QString m_commitMessageFileName;
|
QString m_commitMessageFileName;
|
||||||
FilePath m_commitRepository;
|
FilePath m_commitRepository;
|
||||||
@@ -288,8 +289,6 @@ private:
|
|||||||
|
|
||||||
QAction *m_menuAction = nullptr;
|
QAction *m_menuAction = nullptr;
|
||||||
|
|
||||||
SubversionSettingsPage m_settingsPage;
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
VcsSubmitEditorFactory submitEditorFactory {
|
VcsSubmitEditorFactory submitEditorFactory {
|
||||||
submitParameters,
|
submitParameters,
|
||||||
|
@@ -5,25 +5,31 @@
|
|||||||
|
|
||||||
#include "subversiontr.h"
|
#include "subversiontr.h"
|
||||||
|
|
||||||
#include <utils/environment.h>
|
|
||||||
#include <utils/hostosinfo.h>
|
#include <utils/hostosinfo.h>
|
||||||
#include <utils/layoutbuilder.h>
|
#include <utils/layoutbuilder.h>
|
||||||
#include <utils/pathchooser.h>
|
#include <utils/pathchooser.h>
|
||||||
|
|
||||||
#include <vcsbase/vcsbaseconstants.h>
|
#include <vcsbase/vcsbaseconstants.h>
|
||||||
|
|
||||||
#include <QSettings>
|
|
||||||
|
|
||||||
using namespace Utils;
|
using namespace Utils;
|
||||||
using namespace VcsBase;
|
using namespace VcsBase;
|
||||||
|
|
||||||
namespace Subversion::Internal {
|
namespace Subversion::Internal {
|
||||||
|
|
||||||
// SubversionSettings
|
static SubversionSettings *theSettings;
|
||||||
|
|
||||||
|
SubversionSettings &settings()
|
||||||
|
{
|
||||||
|
return *theSettings;
|
||||||
|
}
|
||||||
|
|
||||||
SubversionSettings::SubversionSettings()
|
SubversionSettings::SubversionSettings()
|
||||||
{
|
{
|
||||||
setAutoApply(false);
|
theSettings = this;
|
||||||
|
|
||||||
|
setId(VcsBase::Constants::VCS_ID_SUBVERSION);
|
||||||
|
setDisplayName(Tr::tr("Subversion"));
|
||||||
|
setCategory(VcsBase::Constants::VCS_SETTINGS_CATEGORY);
|
||||||
setSettingsGroup("Subversion");
|
setSettingsGroup("Subversion");
|
||||||
|
|
||||||
registerAspect(&binaryPath);
|
registerAspect(&binaryPath);
|
||||||
@@ -68,47 +74,33 @@ SubversionSettings::SubversionSettings()
|
|||||||
timeout.setSuffix(Tr::tr("s"));
|
timeout.setSuffix(Tr::tr("s"));
|
||||||
|
|
||||||
QObject::connect(&useAuthentication, &BaseAspect::changed, this, [this] {
|
QObject::connect(&useAuthentication, &BaseAspect::changed, this, [this] {
|
||||||
userName.setEnabled(useAuthentication.value());
|
userName.setEnabled(useAuthentication());
|
||||||
password.setEnabled(useAuthentication.value());
|
password.setEnabled(useAuthentication());
|
||||||
});
|
});
|
||||||
}
|
|
||||||
|
|
||||||
bool SubversionSettings::hasAuthentication() const
|
setLayouter([this](QWidget *widget) {
|
||||||
{
|
|
||||||
return useAuthentication.value() && !userName.value().isEmpty();
|
|
||||||
}
|
|
||||||
|
|
||||||
SubversionSettingsPage::SubversionSettingsPage()
|
|
||||||
{
|
|
||||||
setId(VcsBase::Constants::VCS_ID_SUBVERSION);
|
|
||||||
setDisplayName(Tr::tr("Subversion"));
|
|
||||||
setCategory(VcsBase::Constants::VCS_SETTINGS_CATEGORY);
|
|
||||||
setSettings(&settings());
|
|
||||||
|
|
||||||
setLayouter([](QWidget *widget) {
|
|
||||||
SubversionSettings &s = settings();
|
|
||||||
using namespace Layouting;
|
using namespace Layouting;
|
||||||
|
|
||||||
Column {
|
Column {
|
||||||
Group {
|
Group {
|
||||||
title(Tr::tr("Configuration")),
|
title(Tr::tr("Configuration")),
|
||||||
Column { s.binaryPath }
|
Column { binaryPath }
|
||||||
},
|
},
|
||||||
|
|
||||||
Group {
|
Group {
|
||||||
title(Tr::tr("Authentication")),
|
title(Tr::tr("Authentication")),
|
||||||
s.useAuthentication.groupChecker(),
|
useAuthentication.groupChecker(),
|
||||||
Form {
|
Form {
|
||||||
s.userName, br,
|
userName, br,
|
||||||
s.password,
|
password,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
Group {
|
Group {
|
||||||
title(Tr::tr("Miscellaneous")),
|
title(Tr::tr("Miscellaneous")),
|
||||||
Column {
|
Column {
|
||||||
Row { s.logCount, s.timeout, st },
|
Row { logCount, timeout, st },
|
||||||
s.spaceIgnorantAnnotation,
|
spaceIgnorantAnnotation,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -117,10 +109,9 @@ SubversionSettingsPage::SubversionSettingsPage()
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
SubversionSettings &settings()
|
bool SubversionSettings::hasAuthentication() const
|
||||||
{
|
{
|
||||||
static SubversionSettings theSettings;
|
return useAuthentication() && !userName().isEmpty();
|
||||||
return theSettings;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
} // Subversion::Internal
|
} // Subversion::Internal
|
||||||
|
@@ -3,8 +3,6 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <coreplugin/dialogs/ioptionspage.h>
|
|
||||||
|
|
||||||
#include <vcsbase/vcsbaseclientsettings.h>
|
#include <vcsbase/vcsbaseclientsettings.h>
|
||||||
|
|
||||||
namespace Subversion::Internal {
|
namespace Subversion::Internal {
|
||||||
@@ -25,10 +23,4 @@ public:
|
|||||||
|
|
||||||
SubversionSettings &settings();
|
SubversionSettings &settings();
|
||||||
|
|
||||||
class SubversionSettingsPage final : public Core::IOptionsPage
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
SubversionSettingsPage();
|
|
||||||
};
|
|
||||||
|
|
||||||
} // Subversion::Internal
|
} // Subversion::Internal
|
||||||
|
@@ -5,11 +5,11 @@
|
|||||||
|
|
||||||
#include "vcsbase_global.h"
|
#include "vcsbase_global.h"
|
||||||
|
|
||||||
#include <utils/aspects.h>
|
#include <coreplugin/dialogs/ioptionspage.h>
|
||||||
|
|
||||||
namespace VcsBase {
|
namespace VcsBase {
|
||||||
|
|
||||||
class VCSBASE_EXPORT VcsBaseSettings : public Utils::AspectContainer
|
class VCSBASE_EXPORT VcsBaseSettings : public Core::PagedSettings
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
VcsBaseSettings();
|
VcsBaseSettings();
|
||||||
|
Reference in New Issue
Block a user