Git: Use IOptionPage::setWidgetCreator() for gerrit settings

Change-Id: I7402f3342bb11726ec7383c807fa98052cb38bd8
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
This commit is contained in:
hjk
2023-04-20 11:01:18 +02:00
parent 28d1d3ffe1
commit c0bbd29933
2 changed files with 86 additions and 136 deletions

View File

@@ -6,57 +6,20 @@
#include <coreplugin/dialogs/ioptionspage.h>
#include <QSharedPointer>
#include <QPointer>
QT_BEGIN_NAMESPACE
class QLineEdit;
class QSpinBox;
class QCheckBox;
QT_END_NAMESPACE
namespace Utils { class PathChooser; }
namespace Gerrit {
namespace Internal {
namespace Gerrit::Internal {
class GerritParameters;
class GerritOptionsWidget : public QWidget
{
Q_OBJECT
public:
explicit GerritOptionsWidget(QWidget *parent = nullptr);
GerritParameters parameters() const;
void setParameters(const GerritParameters &);
private:
QLineEdit *m_hostLineEdit;
QLineEdit *m_userLineEdit;
Utils::PathChooser *m_sshChooser;
Utils::PathChooser *m_curlChooser;
QSpinBox *m_portSpinBox;
QCheckBox *m_httpsCheckBox;
};
class GerritOptionsPage : public Core::IOptionsPage
{
Q_OBJECT
public:
GerritOptionsPage(const QSharedPointer<GerritParameters> &p, QObject *parent = nullptr);
~GerritOptionsPage() override;
QWidget *widget() override;
void apply() override;
void finish() override;
signals:
void settingsChanged();
private:
const QSharedPointer<GerritParameters> &m_parameters;
QPointer<GerritOptionsWidget> m_widget;
};
} // namespace Internal
} // namespace Gerrit
} // Gerrit::Internal