mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-22 23:05:36 +08:00
refactor(ui): Remove plugin details window
This commit is contained in:
@@ -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());
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user