| 331 | } |
| 332 | |
| 333 | void 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 | |
| 359 | QStringList DeviceImpl::getPluginsName() |
| 360 | { |
nothing calls this directly
no test coverage detected