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