Apply active profile plugin data when the GUI loads its plugins
This commit is contained in:
committed by
Adam Honse
parent
30043e3835
commit
3e53302613
@@ -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()
|
||||
{
|
||||
/*-------------------------------------------------*\
|
||||
|
||||
@@ -78,6 +78,8 @@ public:
|
||||
ProfileManager(const filesystem::path& config_dir);
|
||||
~ProfileManager();
|
||||
|
||||
void ApplyActiveProfilePluginData();
|
||||
|
||||
void ClearActiveProfile();
|
||||
|
||||
void DeleteProfile(std::string profile_name);
|
||||
|
||||
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user