forked from qt-creator/qt-creator
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:
@@ -5,6 +5,7 @@
|
||||
|
||||
#include "cvstr.h"
|
||||
|
||||
#include <coreplugin/dialogs/ioptionspage.h>
|
||||
#include <coreplugin/icore.h>
|
||||
|
||||
#include <utils/hostosinfo.h>
|
||||
@@ -17,22 +18,17 @@ using namespace Utils;
|
||||
|
||||
namespace Cvs::Internal {
|
||||
|
||||
static CvsSettings *theSettings;
|
||||
|
||||
CvsSettings &settings()
|
||||
{
|
||||
return *theSettings;
|
||||
static CvsSettings theSettings;
|
||||
return theSettings;
|
||||
}
|
||||
|
||||
CvsSettings::CvsSettings()
|
||||
{
|
||||
theSettings = this;
|
||||
setAutoApply(false);
|
||||
setSettingsGroup("CVS");
|
||||
|
||||
setId(VcsBase::Constants::VCS_ID_CVS);
|
||||
setDisplayName(Tr::tr("CVS"));
|
||||
setCategory(VcsBase::Constants::VCS_SETTINGS_CATEGORY);
|
||||
|
||||
binaryPath.setDefaultValue("cvs" QTC_HOST_EXE_SUFFIX);
|
||||
binaryPath.setExpectedKind(PathChooser::ExistingCommand);
|
||||
binaryPath.setHistoryCompleter(QLatin1String("Cvs.Command.History"));
|
||||
@@ -97,4 +93,20 @@ QStringList CvsSettings::addOptions(const QStringList &args) const
|
||||
return rc;
|
||||
}
|
||||
|
||||
// CvsSettingsPage
|
||||
|
||||
class CvsSettingsPage final : Core::IOptionsPage
|
||||
{
|
||||
public:
|
||||
CvsSettingsPage()
|
||||
{
|
||||
setId(VcsBase::Constants::VCS_ID_CVS);
|
||||
setDisplayName(Tr::tr("CVS"));
|
||||
setCategory(VcsBase::Constants::VCS_SETTINGS_CATEGORY);
|
||||
setSettingsProvider([] { return &settings(); });
|
||||
}
|
||||
};
|
||||
|
||||
const CvsSettingsPage settingsPage;
|
||||
|
||||
} // Cvs::Internal
|
||||
|
||||
Reference in New Issue
Block a user