forked from qt-creator/qt-creator
ProjectExplorer: Introduce a KitAspect::createManageButton() function
Saves some repetition downstream. Change-Id: Ied58586572d3e70669c9172c5076bbd12e211aa7 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
@@ -29,7 +29,6 @@
|
||||
#include "mesontoolkitaspect.h"
|
||||
#include "ninjatoolkitaspect.h"
|
||||
|
||||
#include <coreplugin/icore.h>
|
||||
#include <utils/qtcassert.h>
|
||||
|
||||
namespace MesonProjectManager {
|
||||
@@ -40,7 +39,7 @@ ToolKitAspectWidget::ToolKitAspectWidget(ProjectExplorer::Kit *kit,
|
||||
ToolType type)
|
||||
: ProjectExplorer::KitAspectWidget(kit, ki)
|
||||
, m_toolsComboBox(createSubWidget<QComboBox>())
|
||||
, m_manageButton(createSubWidget<QPushButton>(KitAspectWidget::msgManage()))
|
||||
, m_manageButton(createManageButton(Constants::SettingsPage::TOOLS_ID))
|
||||
, m_type{type}
|
||||
{
|
||||
m_toolsComboBox->setSizePolicy(QSizePolicy::Ignored,
|
||||
@@ -49,11 +48,6 @@ ToolKitAspectWidget::ToolKitAspectWidget(ProjectExplorer::Kit *kit,
|
||||
m_toolsComboBox->setToolTip(ki->description());
|
||||
loadTools();
|
||||
|
||||
m_manageButton->setContentsMargins(0, 0, 0, 0);
|
||||
connect(m_manageButton, &QPushButton::clicked, this, [this]() {
|
||||
Core::ICore::showOptionsDialog(Constants::SettingsPage::TOOLS_ID, m_manageButton);
|
||||
});
|
||||
|
||||
connect(MesonTools::instance(),
|
||||
&MesonTools::toolAdded,
|
||||
this,
|
||||
|
||||
@@ -34,7 +34,6 @@
|
||||
|
||||
#include <QComboBox>
|
||||
#include <QCoreApplication>
|
||||
#include <QPushButton>
|
||||
|
||||
namespace MesonProjectManager {
|
||||
namespace Internal {
|
||||
@@ -83,7 +82,7 @@ private:
|
||||
}
|
||||
|
||||
QComboBox *m_toolsComboBox;
|
||||
QPushButton *m_manageButton;
|
||||
QWidget *m_manageButton;
|
||||
ToolType m_type;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user