Hack to get ENE SMBus settings added to the list

This commit is contained in:
Adam Honse
2023-10-19 20:03:24 -05:00
parent 0fd6893ee5
commit 6d8fb3348a
2 changed files with 35 additions and 5 deletions

View File

@@ -3,8 +3,10 @@
#include "ENESMBusInterface_i2c_smbus.h"
#include "ENESMBusInterface_SpectrixS40G.h"
#include "LogManager.h"
#include "ResourceManager.h"
#include "RGBController.h"
#include "RGBController_ENESMBus.h"
#include "SettingsManager.h"
#include "i2c_smbus.h"
#include "pci_ids.h"
#include <vector>
@@ -329,6 +331,22 @@ void DetectENESMBusGPUControllers(i2c_smbus_interface* bus, uint8_t i2c_addr, co
}
} /* DetectENESMBusGPUControllers() */
void RegisterENESettings()
{
/*-----------------------------------------------------*\
| Create ENESMBusSettings settings prototype |
\*-----------------------------------------------------*/
std::string ene_smbus_string = "ENESMBusSettings";
json ene_smbus_proto;
ene_smbus_proto["enable_save"]["name"] = "Enable Save";
ene_smbus_proto["enable_save"]["type"] = "boolean";
ResourceManager::get()->GetSettingsManager()->RegisterSettingsPrototype(ene_smbus_string, ene_smbus_proto);
}
REGISTER_DYNAMIC_DETECTOR("ENE Devices", RegisterENESettings);
REGISTER_I2C_DETECTOR("ENE SMBus DRAM", DetectENESMBusDRAMControllers);
REGISTER_I2C_DETECTOR("ASUS Aura SMBus Motherboard", DetectENESMBusMotherboardControllers);

View File

@@ -228,6 +228,23 @@ OpenRGBDialog2::OpenRGBDialog2(QWidget *parent) : QMainWindow(parent), ui(new Op
settings_manager->RegisterSettingsPrototype(ui_string, ui_settings_proto);
/*-----------------------------------------------------*\
| Get LogManager settings |
\*-----------------------------------------------------*/
std::string log_manager_string = "LogManager";
json log_manager_settings;
log_manager_settings = settings_manager->GetSettings(log_manager_string);
/*-----------------------------------------------------*\
| Create LogManager settings prototype |
\*-----------------------------------------------------*/
json log_manager_proto;
log_manager_proto["log_console"]["name"] = "Enable Log Console";
log_manager_proto["log_console"]["type"] = "boolean";
settings_manager->RegisterSettingsPrototype(log_manager_string, log_manager_proto);
/*-----------------------------------------------------*\
| If geometry info doesn't exist, write it to config |
\*-----------------------------------------------------*/
@@ -551,11 +568,6 @@ OpenRGBDialog2::OpenRGBDialog2(QWidget *parent) : QMainWindow(parent), ui(new Op
AddI2CToolsPage();
}
/*-----------------------------------------------------*\
| If log console is enabled in settings, enable it |
\*-----------------------------------------------------*/
json log_manager_settings = settings_manager->GetSettings("LogManager");
bool log_console_enabled = false;
if(log_manager_settings.contains("log_console"))
{