MCPcopy Create free account
hub / github.com/analogdevicesinc/scopy / loadCompatiblePluginsTab

Method loadCompatiblePluginsTab

core/src/deviceimpl.cpp:333–357  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

331}
332
333void DeviceImpl::loadCompatiblePluginsTab(QWidget *pluginsTab)
334{
335 QList<Plugin *> plugins = PluginRepository::getCompatiblePlugins(m_param, m_category);
336 QStringList enabledPlugins = getPluginsName();
337 for(Plugin *p : qAsConst(plugins)) {
338 PluginEnableWidget *pluginDescription = new PluginEnableWidget(pluginsTab);
339 bool pluginEnabled = enabledPlugins.contains(p->name());
340 pluginDescription->setDescription(p->description());
341 pluginDescription->checkBox()->setText(p->name());
342 pluginDescription->checkBox()->setChecked(pluginEnabled);
343 pluginsTab->layout()->addWidget(pluginDescription);
344 if(pluginEnabled) {
345 m_reloadPluginsSet.insert(p->name());
346 }
347 connect(pluginDescription->checkBox(), &QCheckBox::toggled, this, [this, p](bool en) {
348 QString pluginName = p->name();
349 if(en) {
350 m_reloadPluginsSet.insert(pluginName);
351 } else {
352 m_reloadPluginsSet.remove(pluginName);
353 }
354 });
355 }
356 pluginsTab->layout()->addItem(new QSpacerItem(0, 20, QSizePolicy::Expanding, QSizePolicy::Expanding));
357}
358
359QStringList DeviceImpl::getPluginsName()
360{

Callers

nothing calls this directly

Calls 10

setCheckedMethod · 0.80
connectFunction · 0.50
containsMethod · 0.45
nameMethod · 0.45
setDescriptionMethod · 0.45
descriptionMethod · 0.45
checkBoxMethod · 0.45
addWidgetMethod · 0.45
layoutMethod · 0.45
removeMethod · 0.45

Tested by

no test coverage detected