Пример #1
0
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());
}
Пример #2
0
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;
    }
}
Пример #3
0
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;
    }
}