Apply active profile plugin data when the GUI loads its plugins

This commit is contained in:
Kamil Rojewski
2026-09-21 07:20:47 -05:00
committed by Adam Honse
parent 30043e3835
commit 3e53302613
3 changed files with 30 additions and 1 deletions
+15
View File
@@ -163,6 +163,21 @@ ProfileManager::~ProfileManager()
}
void ProfileManager::ApplyActiveProfilePluginData()
{
/*-----------------------------------------------------*\
| The server only sends profile data to the clients |
| connected at the time it loads, and plugins only |
| exist in the GUI, so read it back here |
\*-----------------------------------------------------*/
if(!active_profile.empty() && ResourceManager::get()->IsLocalClient() && (ResourceManager::get()->GetLocalClient()->GetSupportsProfileManagerAPI()))
{
LOG_DEBUG("[%s] Reading active profile for plugin data: %s", PROFILEMANAGER, active_profile.c_str());
OnProfileLoaded(ResourceManager::get()->GetLocalClient()->ProfileManager_DownloadProfile(active_profile));
}
}
void ProfileManager::ClearActiveProfile()
{
/*-------------------------------------------------*\
+2
View File
@@ -78,6 +78,8 @@ public:
ProfileManager(const filesystem::path& config_dir);
~ProfileManager();
void ApplyActiveProfilePluginData();
void ClearActiveProfile();
void DeleteProfile(std::string profile_name);
+13 -1
View File
@@ -1633,10 +1633,13 @@ void OpenRGBDialog::onDetectionEnded()
| Load plugins after the first detection (ONLY the |
| first) |
\*-----------------------------------------------------*/
bool plugins_just_loaded = false;
if(!plugins_loaded)
{
plugin_manager->ScanAndLoadPlugins();
plugins_loaded = true;
plugins_just_loaded = true;
PluginsPage->RefreshList();
}
@@ -1648,7 +1651,16 @@ void OpenRGBDialog::onDetectionEnded()
/*-----------------------------------------------------*\
| Load the on open automatic profile |
\*-----------------------------------------------------*/
ResourceManager::get()->GetProfileManager()->LoadAutoProfileOpen();
bool open_profile_loaded = ResourceManager::get()->GetProfileManager()->LoadAutoProfileOpen();
/*-----------------------------------------------------*\
| With no profile to open, the plugins that were just |
| loaded still need the active profile's plugin data |
\*-----------------------------------------------------*/
if(plugins_just_loaded && !open_profile_loaded)
{
ResourceManager::get()->GetProfileManager()->ApplyActiveProfilePluginData();
}
}
void OpenRGBDialog::MigrateLegacySettings()