From 674cca18a77813521b1271a1a71441d9243a2a10 Mon Sep 17 00:00:00 2001 From: Christian Stenger Date: Wed, 6 Jul 2022 21:51:02 +0200 Subject: [PATCH] GitLab: Use IntegerAspect instead of QSpinBox Change-Id: I06e9d907a6a65f8cf135031f0aed3cd3eca9281b Reviewed-by: David Schulz --- src/plugins/gitlab/gitlaboptionspage.cpp | 8 ++------ src/plugins/gitlab/gitlaboptionspage.h | 3 +-- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/src/plugins/gitlab/gitlaboptionspage.cpp b/src/plugins/gitlab/gitlaboptionspage.cpp index 5687eb9ec83..6df8373402f 100644 --- a/src/plugins/gitlab/gitlaboptionspage.cpp +++ b/src/plugins/gitlab/gitlaboptionspage.cpp @@ -80,9 +80,9 @@ GitLabServerWidget::GitLabServerWidget(Mode m, QWidget *parent) : Utils::StringAspect::LineEditDisplay); m_token.setVisible(m == Edit); + m_port.setLabelText(GitLabOptionsPage::tr("Port:")); m_port.setRange(1, 65535); m_port.setValue(GitLabServer::defaultPort); - auto portLabel = new QLabel(GitLabOptionsPage::tr("Port:"), this); m_port.setEnabled(m == Edit); m_secure.setLabelText(GitLabOptionsPage::tr("HTTPS:")); m_secure.setLabelPlacement(Utils::BoolAspect::LabelPlacement::InExtraLabel); @@ -90,17 +90,15 @@ GitLabServerWidget::GitLabServerWidget(Mode m, QWidget *parent) m_secure.setEnabled(m == Edit); using namespace Utils::Layouting; - const Break nl; Row { Form { m_host, m_description, m_token, - portLabel, &m_port, nl, + m_port, m_secure }, - Stretch() }.attachTo(this, m == Edit); } @@ -209,7 +207,6 @@ void GitLabOptionsWidget::showEditServerDialog() connect(buttons->button(QDialogButtonBox::Cancel), &QPushButton::clicked, &d, &QDialog::reject); layout->addWidget(buttons); d.setLayout(layout); - d.resize(300, 200); if (d.exec() != QDialog::Accepted) return; @@ -231,7 +228,6 @@ void GitLabOptionsWidget::showAddServerDialog() connect(buttons->button(QDialogButtonBox::Cancel), &QPushButton::clicked, &d, &QDialog::reject); layout->addWidget(buttons); d.setLayout(layout); - d.resize(300, 200); if (d.exec() != QDialog::Accepted) return; diff --git a/src/plugins/gitlab/gitlaboptionspage.h b/src/plugins/gitlab/gitlaboptionspage.h index 4d89b20b006..4779028fbd9 100644 --- a/src/plugins/gitlab/gitlaboptionspage.h +++ b/src/plugins/gitlab/gitlaboptionspage.h @@ -31,7 +31,6 @@ #include #include -#include QT_BEGIN_NAMESPACE class QComboBox; @@ -56,7 +55,7 @@ private: Utils::StringAspect m_host; Utils::StringAspect m_description; Utils::StringAspect m_token; - QSpinBox m_port; + Utils::IntegerAspect m_port; Utils::BoolAspect m_secure; };