Split CLI processing into pre- and post-detection functions and add --localconfig and --nodetect options

This commit is contained in:
Adam Honse 2020-12-01 23:50:29 -06:00
parent 72da8f362c
commit ddfcd1caf9
11 changed files with 330 additions and 187 deletions

View file

@ -17,7 +17,7 @@ public:
NetworkClient * net_client;
};
OpenRGBClientInfoPage::OpenRGBClientInfoPage(std::vector<RGBController *>& control, QWidget *parent) :
OpenRGBClientInfoPage::OpenRGBClientInfoPage(QWidget *parent) :
QFrame(parent),
ui(new Ui::OpenRGBClientInfoPageUi)
{

View file

@ -15,7 +15,7 @@ class Ui::OpenRGBClientInfoPage : public QFrame
Q_OBJECT
public:
explicit OpenRGBClientInfoPage(std::vector<RGBController *>& control, QWidget *parent = nullptr);
explicit OpenRGBClientInfoPage(QWidget *parent = nullptr);
~OpenRGBClientInfoPage();
void AddClient(NetworkClient* new_client);

View file

@ -141,7 +141,7 @@ bool OpenRGBDialog2::IsDarkTheme()
return false;
}
OpenRGBDialog2::OpenRGBDialog2(std::vector<i2c_smbus_interface *>& bus, std::vector<RGBController *>& control, QWidget *parent) : QMainWindow(parent), busses(bus), controllers(control), ui(new OpenRGBDialog2Ui)
OpenRGBDialog2::OpenRGBDialog2(QWidget *parent) : QMainWindow(parent), ui(new OpenRGBDialog2Ui)
{
ui->setupUi(this);
@ -331,7 +331,7 @@ void OpenRGBDialog2::AddI2CToolsPage()
/*-----------------------------------------------------*\
| Create the I2C Tools page if it doesn't exist yet |
\*-----------------------------------------------------*/
SMBusToolsPage = new OpenRGBSystemInfoPage(busses);
SMBusToolsPage = new OpenRGBSystemInfoPage(ResourceManager::get()->GetI2CBusses());
/*-----------------------------------------------------*\
| Create the I2C Tools tab in the Information bar |
@ -364,7 +364,7 @@ void OpenRGBDialog2::AddClientTab()
\*-----------------------------------------------------*/
if(ClientInfoPage == NULL)
{
ClientInfoPage = new OpenRGBClientInfoPage(controllers);
ClientInfoPage = new OpenRGBClientInfoPage();
ui->MainTabBar->addTab(ClientInfoPage, "SDK Client");
/*-----------------------------------------------------*\
@ -414,6 +414,8 @@ void OpenRGBDialog2::ClearDevicesList()
void OpenRGBDialog2::UpdateDevicesList()
{
std::vector<RGBController *> controllers = ResourceManager::get()->GetRGBControllers();
/*-----------------------------------------------------*\
| Loop through each controller in the list. |
\*-----------------------------------------------------*/

View file

@ -29,7 +29,7 @@ class Ui::OpenRGBDialog2 : public QMainWindow
Q_OBJECT
public:
explicit OpenRGBDialog2(std::vector<i2c_smbus_interface *>& bus, std::vector<RGBController *>& control, QWidget *parent = 0);
explicit OpenRGBDialog2(QWidget *parent = 0);
~OpenRGBDialog2();
void AddClient(NetworkClient* new_client);
@ -41,10 +41,6 @@ public:
static bool IsDarkTheme();
protected:
std::vector<i2c_smbus_interface *>& busses;
std::vector<RGBController *>& controllers;
private:
/*-------------------------------------*\
| Page pointers |