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:
@@ -215,7 +215,6 @@ public:
|
||||
void createRepositoryActions(const Core::Context &context);
|
||||
|
||||
// Variables
|
||||
BazaarSettings m_setting;
|
||||
BazaarClient m_client;
|
||||
|
||||
VcsSubmitEditorFactory m_submitEditorFactory {
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
#include "bazaartr.h"
|
||||
#include "constants.h"
|
||||
|
||||
#include <coreplugin/dialogs/ioptionspage.h>
|
||||
#include <coreplugin/icore.h>
|
||||
|
||||
#include <utils/layoutbuilder.h>
|
||||
@@ -16,21 +17,16 @@ using namespace Utils;
|
||||
|
||||
namespace Bazaar::Internal {
|
||||
|
||||
static BazaarSettings *theSettings;
|
||||
|
||||
BazaarSettings &settings()
|
||||
{
|
||||
return *theSettings;
|
||||
static BazaarSettings theSettings;
|
||||
return theSettings;
|
||||
}
|
||||
|
||||
BazaarSettings::BazaarSettings()
|
||||
{
|
||||
theSettings = this;
|
||||
|
||||
setAutoApply(false);
|
||||
setSettingsGroup(Constants::BAZAAR);
|
||||
setId(VcsBase::Constants::VCS_ID_BAZAAR);
|
||||
setDisplayName(Tr::tr("Bazaar"));
|
||||
setCategory(VcsBase::Constants::VCS_SETTINGS_CATEGORY);
|
||||
|
||||
binaryPath.setExpectedKind(PathChooser::ExistingCommand);
|
||||
binaryPath.setDefaultValue(Constants::BAZAARDEFAULT);
|
||||
@@ -92,4 +88,20 @@ BazaarSettings::BazaarSettings()
|
||||
});
|
||||
}
|
||||
|
||||
// BazaarSettingsPage
|
||||
|
||||
class BazaarSettingsPage final : public Core::IOptionsPage
|
||||
{
|
||||
public:
|
||||
BazaarSettingsPage()
|
||||
{
|
||||
setId(VcsBase::Constants::VCS_ID_BAZAAR);
|
||||
setDisplayName(Tr::tr("Bazaar"));
|
||||
setCategory(VcsBase::Constants::VCS_SETTINGS_CATEGORY);
|
||||
setSettingsProvider([] { return &settings(); });
|
||||
}
|
||||
};
|
||||
|
||||
const BazaarSettingsPage settingsPage;
|
||||
|
||||
} // Bazaar::Internal
|
||||
|
||||
@@ -288,7 +288,6 @@ private:
|
||||
bool commit(const QString &messageFile, const QStringList &subVersionFileList);
|
||||
void cleanCommitMessageFile();
|
||||
|
||||
CvsSettings m_setting;
|
||||
CvsClient *m_client = nullptr;
|
||||
|
||||
QString m_commitMessageFileName;
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -187,7 +187,6 @@ public:
|
||||
bool pullOrPush(SyncMode mode);
|
||||
|
||||
// Variables
|
||||
FossilSettings m_settings;
|
||||
FossilClient m_client;
|
||||
|
||||
VcsSubmitEditorFactory submitEditorFactory {
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
namespace Fossil::Internal {
|
||||
|
||||
class FossilSettings : public VcsBase::VcsBaseSettings
|
||||
class FossilSettings final : public VcsBase::VcsBaseSettings
|
||||
{
|
||||
public:
|
||||
FossilSettings();
|
||||
|
||||
@@ -399,7 +399,6 @@ public:
|
||||
|
||||
void onApplySettings();
|
||||
|
||||
GitSettings setting;
|
||||
CommandLocator *m_commandLocator = nullptr;
|
||||
|
||||
QAction *m_menuAction = nullptr;
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -15,7 +15,7 @@ enum CommitType
|
||||
};
|
||||
|
||||
// Todo: Add user name and password?
|
||||
class GitSettings : public VcsBase::VcsBaseSettings
|
||||
class GitSettings final : public VcsBase::VcsBaseSettings
|
||||
{
|
||||
public:
|
||||
GitSettings();
|
||||
|
||||
@@ -169,7 +169,6 @@ private:
|
||||
void createRepositoryActions(const Core::Context &context);
|
||||
|
||||
// Variables
|
||||
MercurialSettings m_settings;
|
||||
MercurialClient m_client;
|
||||
|
||||
Core::CommandLocator *m_commandLocator = nullptr;
|
||||
|
||||
@@ -6,6 +6,8 @@
|
||||
#include "constants.h"
|
||||
#include "mercurialtr.h"
|
||||
|
||||
#include <coreplugin/dialogs/ioptionspage.h>
|
||||
|
||||
#include <utils/layoutbuilder.h>
|
||||
|
||||
#include <vcsbase/vcsbaseconstants.h>
|
||||
@@ -14,20 +16,15 @@ using namespace Utils;
|
||||
|
||||
namespace Mercurial::Internal {
|
||||
|
||||
static MercurialSettings *theSettings;
|
||||
|
||||
MercurialSettings &settings()
|
||||
{
|
||||
return *theSettings;
|
||||
static MercurialSettings theSettings;
|
||||
return theSettings;
|
||||
}
|
||||
|
||||
MercurialSettings::MercurialSettings()
|
||||
{
|
||||
theSettings = this;
|
||||
|
||||
setId(VcsBase::Constants::VCS_ID_MERCURIAL);
|
||||
setDisplayName(Tr::tr("Mercurial"));
|
||||
setCategory(VcsBase::Constants::VCS_SETTINGS_CATEGORY);
|
||||
setAutoApply(false);
|
||||
setSettingsGroup("Mercurial");
|
||||
|
||||
binaryPath.setExpectedKind(PathChooser::ExistingCommand);
|
||||
@@ -75,4 +72,20 @@ MercurialSettings::MercurialSettings()
|
||||
});
|
||||
}
|
||||
|
||||
// MercurialSettingsPage
|
||||
|
||||
class MercurialSettingsPage final : public Core::IOptionsPage
|
||||
{
|
||||
public:
|
||||
MercurialSettingsPage()
|
||||
{
|
||||
setId(VcsBase::Constants::VCS_ID_MERCURIAL);
|
||||
setDisplayName(Tr::tr("Mercurial"));
|
||||
setCategory(VcsBase::Constants::VCS_SETTINGS_CATEGORY);
|
||||
setSettingsProvider([] { return &settings(); });
|
||||
}
|
||||
};
|
||||
|
||||
const MercurialSettingsPage settingsPage;
|
||||
|
||||
} // Mercurial::Internal
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
namespace Mercurial::Internal {
|
||||
|
||||
class MercurialSettings : public VcsBase::VcsBaseSettings
|
||||
class MercurialSettings final : public VcsBase::VcsBaseSettings
|
||||
{
|
||||
public:
|
||||
MercurialSettings();
|
||||
|
||||
@@ -261,7 +261,6 @@ private:
|
||||
|
||||
const QStringList m_svnDirectories;
|
||||
|
||||
SubversionSettings m_settings;
|
||||
SubversionClient *m_client = nullptr;
|
||||
QString m_commitMessageFileName;
|
||||
FilePath m_commitRepository;
|
||||
|
||||
@@ -5,6 +5,8 @@
|
||||
|
||||
#include "subversiontr.h"
|
||||
|
||||
#include <coreplugin/dialogs/ioptionspage.h>
|
||||
|
||||
#include <utils/hostosinfo.h>
|
||||
#include <utils/layoutbuilder.h>
|
||||
#include <utils/pathchooser.h>
|
||||
@@ -16,20 +18,15 @@ using namespace VcsBase;
|
||||
|
||||
namespace Subversion::Internal {
|
||||
|
||||
static SubversionSettings *theSettings;
|
||||
|
||||
SubversionSettings &settings()
|
||||
{
|
||||
return *theSettings;
|
||||
static SubversionSettings theSettings;
|
||||
return theSettings;
|
||||
}
|
||||
|
||||
SubversionSettings::SubversionSettings()
|
||||
{
|
||||
theSettings = this;
|
||||
|
||||
setId(VcsBase::Constants::VCS_ID_SUBVERSION);
|
||||
setDisplayName(Tr::tr("Subversion"));
|
||||
setCategory(VcsBase::Constants::VCS_SETTINGS_CATEGORY);
|
||||
setAutoApply(false);
|
||||
setSettingsGroup("Subversion");
|
||||
|
||||
binaryPath.setExpectedKind(PathChooser::ExistingCommand);
|
||||
@@ -104,4 +101,19 @@ bool SubversionSettings::hasAuthentication() const
|
||||
return useAuthentication() && !userName().isEmpty();
|
||||
}
|
||||
|
||||
// SubversionSettingsPage
|
||||
|
||||
class SubversionSettingsPage final : public Core::IOptionsPage
|
||||
{
|
||||
public:
|
||||
SubversionSettingsPage()
|
||||
{
|
||||
setId(VcsBase::Constants::VCS_ID_SUBVERSION);
|
||||
setDisplayName(Tr::tr("Subversion"));
|
||||
setCategory(VcsBase::Constants::VCS_SETTINGS_CATEGORY);
|
||||
}
|
||||
};
|
||||
|
||||
const SubversionSettingsPage settingsPage;
|
||||
|
||||
} // Subversion::Internal
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
namespace Subversion::Internal {
|
||||
|
||||
class SubversionSettings : public VcsBase::VcsBaseSettings
|
||||
class SubversionSettings final : public VcsBase::VcsBaseSettings
|
||||
{
|
||||
public:
|
||||
SubversionSettings();
|
||||
|
||||
@@ -5,11 +5,11 @@
|
||||
|
||||
#include "vcsbase_global.h"
|
||||
|
||||
#include <coreplugin/dialogs/ioptionspage.h>
|
||||
#include <utils/aspects.h>
|
||||
|
||||
namespace VcsBase {
|
||||
|
||||
class VCSBASE_EXPORT VcsBaseSettings : public Core::PagedSettings
|
||||
class VCSBASE_EXPORT VcsBaseSettings : public Utils::AspectContainer
|
||||
{
|
||||
public:
|
||||
VcsBaseSettings();
|
||||
|
||||
Reference in New Issue
Block a user