Vcs: Convert settings pages to latest style

Last change in that area for this year.

Change-Id: Ibae9f1869cb20faf85c0c1669b84751ad022b8fd
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
This commit is contained in:
hjk
2023-07-18 12:57:17 +02:00
parent 89a64a19e8
commit 9a69c78ca5
17 changed files with 128 additions and 60 deletions

View File

@@ -5,6 +5,8 @@
#include "gittr.h"
#include <coreplugin/dialogs/ioptionspage.h>
#include <utils/environment.h>
#include <utils/layoutbuilder.h>
@@ -17,20 +19,15 @@ using namespace VcsBase;
namespace Git::Internal {
static GitSettings *theSettings;
GitSettings &settings()
{
return *theSettings;
static GitSettings theSettings;
return theSettings;
}
GitSettings::GitSettings()
{
theSettings = this;
setId(VcsBase::Constants::VCS_ID_GIT);
setDisplayName(Tr::tr("Git"));
setCategory(VcsBase::Constants::VCS_SETTINGS_CATEGORY);
setAutoApply(false);
setSettingsGroup("Git");
path.setDisplayStyle(StringAspect::LineEditDisplay);
@@ -175,4 +172,20 @@ FilePath GitSettings::gitExecutable(bool *ok, QString *errorMessage) const
return resolvedBinPath;
}
// GitSettingsPage
class GitSettingsPage final : public Core::IOptionsPage
{
public:
GitSettingsPage()
{
setId(VcsBase::Constants::VCS_ID_GIT);
setDisplayName(Tr::tr("Git"));
setCategory(VcsBase::Constants::VCS_SETTINGS_CATEGORY);
setSettingsProvider([] { return &settings(); });
}
};
const GitSettingsPage settingsPage;
} // Git::Internal