diff --git a/src/core/plugins/pluginsettingswidget.cpp b/src/core/plugins/pluginsettingswidget.cpp index fbcd7c6..0945854 100644 --- a/src/core/plugins/pluginsettingswidget.cpp +++ b/src/core/plugins/pluginsettingswidget.cpp @@ -17,6 +17,7 @@ */ #include "pluginsettingswidget.h" #include "plugins.h" +#include "snore.h" #include @@ -58,6 +59,7 @@ void PluginSettingsWidget::loadSettings() void PluginSettingsWidget::saveSettings() { m_snorePlugin->setValue("Enabled",m_enabled->isChecked()); + m_snorePlugin->snore()->setPluginEnabled(m_snorePlugin->name(),m_enabled->isChecked()); save(); } diff --git a/src/core/snore.cpp b/src/core/snore.cpp index f8b5fbc..fb12ec7 100644 --- a/src/core/snore.cpp +++ b/src/core/snore.cpp @@ -62,11 +62,16 @@ void SnoreCore::loadPlugins(SnorePlugin::PluginTypes types) case SnorePlugin::SECONDARY_BACKEND: case SnorePlugin::FRONTEND: case SnorePlugin::PLUGIN: - if (!info->load()->initialize()) { - info->load()->deinitialize(); - info->unload(); - break; + { + SnorePlugin *plugin = info->load(); + if(plugin->value("Enabled").toBool()) { + if (!plugin->initialize()) { + plugin->deinitialize(); + info->unload(); + break; + } } + } break; default: snoreDebug(SNORE_WARNING) << "Plugin Cache corrupted\n" << info->file() << info->type(); diff --git a/src/daemon/settingsdialog.cpp b/src/daemon/settingsdialog.cpp index a81640e..5101739 100644 --- a/src/daemon/settingsdialog.cpp +++ b/src/daemon/settingsdialog.cpp @@ -31,15 +31,6 @@ SettingsDialog::SettingsDialog(SnoreCore *snore, QWidget *parent) : m_snore(snore) { ui->setupUi(this); - for(const QString &plugin : snore->pluginNames(SnorePlugin::PluginTypes(SnorePlugin::ALL) ^ SnorePlugin::BACKEND)) - { - QCheckBox *box = new QCheckBox(plugin); - box->setChecked(snore->pluginIsEnabled(plugin)); - connect(box,&QCheckBox::toggled,[plugin,snore,box](bool checked){ - box->setChecked(snore->setPluginEnabled(plugin,checked)); - }); - ui->verticalLayout2->addWidget(box); - } for(auto widget : snore->settingWidgets()) { ui->tabWidget->addTab(widget,widget->name()); diff --git a/src/daemon/settingsdialog.ui b/src/daemon/settingsdialog.ui index c53167f..a7f237c 100644 --- a/src/daemon/settingsdialog.ui +++ b/src/daemon/settingsdialog.ui @@ -6,25 +6,23 @@ 0 0 - 400 + 979 300 - Dialog + Settings + + + + :/root/snore.png:/root/snore.png - 0 + -1 - - - Active Backends - - - @@ -39,7 +37,9 @@ - + + + buttonBox