void PanelPluginsModel::addPlugin(const LXQt::PluginInfo &desktopFile) { if (dynamic_cast<LXQtPanelApplication const *>(qApp)->isPluginSingletonAndRunnig(desktopFile.id())) return; QString name = findNewPluginSettingsGroup(desktopFile.id()); QPointer<Plugin> plugin = loadPlugin(desktopFile, name); if (plugin.isNull()) return; beginInsertRows(QModelIndex(), mPlugins.size(), mPlugins.size()); mPlugins.append({name, plugin}); endInsertRows(); mPanel->settings()->setValue(mNamesKey, pluginNames()); emit pluginAdded(plugin.data()); }
bool OutputMap::appendPlugin(QLCOutPlugin* outputPlugin) { Q_ASSERT(outputPlugin != NULL); if (plugin(outputPlugin->name()) == NULL) { m_plugins.append(outputPlugin); connect(outputPlugin, SIGNAL(configurationChanged()), this, SLOT(slotConfigurationChanged())); HotPlugMonitor::connectListener(outputPlugin); emit pluginAdded(outputPlugin->name()); return true; } else { qWarning() << Q_FUNC_INFO << "Output plugin" << outputPlugin->name() << "is already loaded. Skipping"; return false; } }
bool InputMap::appendPlugin(QLCInPlugin* inputPlugin) { Q_ASSERT(inputPlugin != NULL); if (plugin(inputPlugin->name()) == NULL) { m_plugins.append(inputPlugin); connect(inputPlugin, SIGNAL(configurationChanged()), this, SLOT(slotConfigurationChanged())); connect(inputPlugin, SIGNAL(valueChanged(quint32,quint32,uchar)), this, SLOT(slotValueChanged(quint32,quint32,uchar))); emit pluginAdded(inputPlugin->name()); return true; } else { qWarning() << Q_FUNC_INFO << "Input plugin" << inputPlugin->name() << "is already loaded. Skipping."; return false; } }