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

@@ -6,6 +6,7 @@
#include "constants.h"
#include "fossiltr.h"
#include <coreplugin/dialogs/ioptionspage.h>
#include <coreplugin/icore.h>
#include <utils/layoutbuilder.h>
@@ -17,21 +18,16 @@ using namespace Utils;
namespace Fossil::Internal {
static FossilSettings *theSettings;
FossilSettings &settings()
{
return *theSettings;
static FossilSettings theSettings;
return theSettings;
}
FossilSettings::FossilSettings()
{
theSettings = this;
setAutoApply(false);
setSettingsGroup(Constants::FOSSIL);
setId(Constants::VCS_ID_FOSSIL);
setDisplayName(Tr::tr("Fossil"));
setCategory(VcsBase::Constants::VCS_SETTINGS_CATEGORY);
binaryPath.setExpectedKind(PathChooser::ExistingCommand);
binaryPath.setDefaultValue(Constants::FOSSILDEFAULT);
@@ -121,4 +117,20 @@ FossilSettings::FossilSettings()
});
}
// FossilSettingsPage
class FossilSettingsPage final : public Core::IOptionsPage
{
public:
FossilSettingsPage()
{
setId(Constants::VCS_ID_FOSSIL);
setDisplayName(Tr::tr("Fossil"));
setCategory(VcsBase::Constants::VCS_SETTINGS_CATEGORY);
setSettingsProvider([] { return &settings(); });
}
};
const FossilSettingsPage settingsPage;
} // Fossil::Internal