forked from qt-creator/qt-creator
Vcs: Move Settings widget definitions to .cpp files
In preparation of replacing the VcsBase* layer by the new IOption* functions, which are almost the same now. Change-Id: I39f7da137434ed33d2d42f09f4213e74b3e29f7e Reviewed-by: Orgad Shaneh <orgads@gmail.com>
This commit is contained in:
@@ -28,6 +28,8 @@
|
||||
#include "gitplugin.h"
|
||||
#include "gitclient.h"
|
||||
|
||||
#include "ui_settingspage.h"
|
||||
|
||||
#include <coreplugin/icore.h>
|
||||
#include <coreplugin/messagebox.h>
|
||||
#include <vcsbase/vcsbaseconstants.h>
|
||||
@@ -36,14 +38,28 @@
|
||||
#include <utils/hostosinfo.h>
|
||||
|
||||
#include <QDir>
|
||||
#include <QDebug>
|
||||
#include <QTextStream>
|
||||
|
||||
using namespace VcsBase;
|
||||
|
||||
namespace Git {
|
||||
namespace Internal {
|
||||
|
||||
class SettingsPageWidget final : public VcsBase::VcsClientOptionsPageWidget
|
||||
{
|
||||
Q_DECLARE_TR_FUNCTIONS(Git::Internal::SettingsPageWidget)
|
||||
|
||||
public:
|
||||
SettingsPageWidget();
|
||||
|
||||
VcsBase::VcsBaseClientSettings settings() const final;
|
||||
void setSettings(const VcsBase::VcsBaseClientSettings &s) final;
|
||||
|
||||
private:
|
||||
void updateNoteField();
|
||||
|
||||
Ui::SettingsPage m_ui;
|
||||
};
|
||||
|
||||
SettingsPageWidget::SettingsPageWidget()
|
||||
{
|
||||
m_ui.setupUi(this);
|
||||
@@ -106,12 +122,13 @@ void SettingsPageWidget::updateNoteField()
|
||||
}
|
||||
|
||||
// -------- SettingsPage
|
||||
|
||||
SettingsPage::SettingsPage(Core::IVersionControl *control, QObject *parent) :
|
||||
VcsClientOptionsPage(control, GitPlugin::client(), parent)
|
||||
{
|
||||
setId(VcsBase::Constants::VCS_ID_GIT);
|
||||
setDisplayName(tr("Git"));
|
||||
setWidgetFactory([]() { return new SettingsPageWidget; });
|
||||
setDisplayName(SettingsPageWidget::tr("Git"));
|
||||
setWidgetFactory([] { return new SettingsPageWidget; });
|
||||
}
|
||||
|
||||
void SettingsPage::apply()
|
||||
|
||||
@@ -27,40 +27,14 @@
|
||||
|
||||
#include <vcsbase/vcsbaseoptionspage.h>
|
||||
|
||||
#include "ui_settingspage.h"
|
||||
|
||||
#include <QPointer>
|
||||
#include <QWidget>
|
||||
|
||||
namespace VcsBase {
|
||||
class VcsBaseClientSettings;
|
||||
} // namespace VcsBase
|
||||
|
||||
namespace Git {
|
||||
namespace Internal {
|
||||
|
||||
class SettingsPageWidget : public VcsBase::VcsClientOptionsPageWidget {
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
SettingsPageWidget();
|
||||
|
||||
VcsBase::VcsBaseClientSettings settings() const override;
|
||||
void setSettings(const VcsBase::VcsBaseClientSettings &s) override;
|
||||
|
||||
private:
|
||||
void updateNoteField();
|
||||
|
||||
Ui::SettingsPage m_ui;
|
||||
};
|
||||
|
||||
class SettingsPage : public VcsBase::VcsClientOptionsPage
|
||||
class SettingsPage final : public VcsBase::VcsClientOptionsPage
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
SettingsPage(Core::IVersionControl *control, QObject *parent);
|
||||
void apply() override;
|
||||
void apply() final;
|
||||
};
|
||||
|
||||
} // namespace Internal
|
||||
|
||||
Reference in New Issue
Block a user