Add capability to load and unload plugins
This commit is contained in:
parent
bd2334c186
commit
6bacee59f5
6 changed files with 300 additions and 128 deletions
|
|
@ -120,7 +120,7 @@ void Ui::OpenRGBPluginsPage::on_InstallPluginButton_clicked()
|
|||
|
||||
if(match == false)
|
||||
{
|
||||
plugin_manager->LoadPlugin(to_path + "/" + filesystem::path(from_path).filename().string());
|
||||
plugin_manager->AddPlugin(to_path + "/" + filesystem::path(from_path).filename().string());
|
||||
|
||||
RefreshList();
|
||||
}
|
||||
|
|
@ -181,6 +181,7 @@ void Ui::OpenRGBPluginsPage::on_EnableButton_clicked(OpenRGBPluginsEntry* entry)
|
|||
|
||||
std::string entry_name = entry->ui->NameValue->text().toStdString();
|
||||
std::string entry_desc = entry->ui->DescriptionValue->text().toStdString();
|
||||
std::string entry_path = entry->ui->PathValue->text().toStdString();
|
||||
|
||||
if(entry->ui->EnabledCheckBox->isChecked())
|
||||
{
|
||||
|
|
@ -235,4 +236,13 @@ void Ui::OpenRGBPluginsPage::on_EnableButton_clicked(OpenRGBPluginsEntry* entry)
|
|||
ResourceManager::get()->GetSettingsManager()->SetSettings("Plugins", plugin_settings);
|
||||
ResourceManager::get()->GetSettingsManager()->SaveSettings();
|
||||
}
|
||||
|
||||
if(enabled)
|
||||
{
|
||||
plugin_manager->LoadPlugin(entry_path);
|
||||
}
|
||||
else
|
||||
{
|
||||
plugin_manager->UnloadPlugin(entry_path);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue