From d8504cfc55046625c97af2ce7f4e8a8873e200a6 Mon Sep 17 00:00:00 2001 From: Lars Toenning Date: Fri, 15 Nov 2024 08:55:24 +0100 Subject: [PATCH] refactor(ui): Remove plugin details window --- .../components/settingssimulatorcomponent.cpp | 21 ------------------- .../components/settingssimulatorcomponent.h | 3 --- src/gui/pluginselector.cpp | 8 ------- src/gui/pluginselector.h | 4 ---- 4 files changed, 36 deletions(-) diff --git a/src/gui/components/settingssimulatorcomponent.cpp b/src/gui/components/settingssimulatorcomponent.cpp index 8af81d594..9e4e5f1af 100644 --- a/src/gui/components/settingssimulatorcomponent.cpp +++ b/src/gui/components/settingssimulatorcomponent.cpp @@ -61,7 +61,6 @@ namespace swift::gui::components // connects connect(ui->pluginSelector_EnabledSimulators, &CPluginSelector::pluginStateChanged, this, &CSettingsSimulatorComponent::pluginStateChanged); - connect(ui->pluginSelector_EnabledSimulators, &CPluginSelector::pluginDetailsRequested, this, &CSettingsSimulatorComponent::showPluginDetails); connect(ui->pluginSelector_EnabledSimulators, &CPluginSelector::pluginConfigRequested, this, &CSettingsSimulatorComponent::showPluginConfig); connect(ui->pb_Reload, &QCheckBox::pressed, this, &CSettingsSimulatorComponent::onReload, Qt::QueuedConnection); @@ -393,26 +392,6 @@ namespace swift::gui::components this->setGuiValues(); } - void CSettingsSimulatorComponent::showPluginDetails(const QString &identifier) - { - const CSimulatorPluginInfoList simDrivers(this->getAvailablePlugins()); - const CSimulatorPluginInfo selected = simDrivers.findByIdentifier(identifier); - - QWidget *aw = qApp->activeWindow(); - Q_ASSERT_X(aw, Q_FUNC_INFO, "Missing active window"); - - CPluginDetailsWindow *w = new CPluginDetailsWindow(aw); - SWIFT_VERIFY_X(w, Q_FUNC_INFO, "Missing window"); - if (!w) { return; } - - w->setAttribute(Qt::WA_DeleteOnClose); - w->setPluginIdentifier(selected.getIdentifier()); - w->setPluginName(selected.getName()); - w->setPluginDescription(selected.getDescription()); - - w->show(); - } - void CSettingsSimulatorComponent::showPluginConfig(const QString &identifier) { const CSimulatorPluginInfoList simDrivers(getAvailablePlugins()); diff --git a/src/gui/components/settingssimulatorcomponent.h b/src/gui/components/settingssimulatorcomponent.h index c232d0fac..17333f241 100644 --- a/src/gui/components/settingssimulatorcomponent.h +++ b/src/gui/components/settingssimulatorcomponent.h @@ -80,9 +80,6 @@ namespace swift::gui::components //! Simulator plugin changed void simulatorPluginChanged(const swift::misc::simulation::CSimulatorPluginInfo &info); - //! Open plugin details window - void showPluginDetails(const QString &identifier); - //! Show plugin config void showPluginConfig(const QString &identifier); diff --git a/src/gui/pluginselector.cpp b/src/gui/pluginselector.cpp index 696e5f63e..1379d816b 100644 --- a/src/gui/pluginselector.cpp +++ b/src/gui/pluginselector.cpp @@ -23,7 +23,6 @@ namespace swift::gui QVBoxLayout *layout = new QVBoxLayout; setLayout(layout); - connect(m_detailsButtonMapper, &QSignalMapper::mappedString, this, &CPluginSelector::pluginDetailsRequested); connect(m_configButtonMapper, &QSignalMapper::mappedString, this, &CPluginSelector::pluginConfigRequested); } @@ -62,15 +61,8 @@ namespace swift::gui pw->layout()->addWidget(config); } - QPushButton *details = new QPushButton("?"); - details->setToolTip("Plugin details"); - m_detailsButtonMapper->setMapping(details, identifier); - connect(details, &QPushButton::clicked, m_detailsButtonMapper, qOverload<>(&QSignalMapper::map)); - pw->layout()->addWidget(details); - layout->setStretch(0, 1); layout->setStretch(1, 0); - layout->setStretch(2, 0); this->layout()->addWidget(pw); } diff --git a/src/gui/pluginselector.h b/src/gui/pluginselector.h index 87cfde62f..86416afff 100644 --- a/src/gui/pluginselector.h +++ b/src/gui/pluginselector.h @@ -41,16 +41,12 @@ namespace swift::gui //! Emitted when user enables/disables the particular plugin void pluginStateChanged(const QString &identifier, bool enabled); - //! Emitted when user clicks the "Details" button - void pluginDetailsRequested(const QString &identifier); - //! Emitted when user clicks the "Settings" button void pluginConfigRequested(const QString &identifier); private: void handlePluginStateChange(); - QSignalMapper *m_detailsButtonMapper = new QSignalMapper(this); QSignalMapper *m_configButtonMapper = new QSignalMapper(this); }; } // ns