mirror of
https://github.com/CalcProgrammer1/OpenRGB.git
synced 2026-04-05 06:34:25 -04:00
Load sizes for variable-size controllers in CLI mode
This commit is contained in:
9
cli.cpp
9
cli.cpp
@@ -7,8 +7,7 @@
|
||||
#include "RGBController.h"
|
||||
#include "i2c_smbus.h"
|
||||
|
||||
extern std::vector<i2c_smbus_interface*> busses;
|
||||
extern std::vector<RGBController*> rgb_controllers;
|
||||
static std::vector<RGBController*> rgb_controllers;
|
||||
|
||||
struct DeviceOptions
|
||||
{
|
||||
@@ -325,8 +324,10 @@ void ApplyOptions(DeviceOptions& options)
|
||||
}
|
||||
}
|
||||
|
||||
int cli_main(int argc, char *argv[])
|
||||
int cli_main(int argc, char *argv[], std::vector<RGBController *> rgb_controllers_in)
|
||||
{
|
||||
rgb_controllers = rgb_controllers_in;
|
||||
|
||||
if (argc == 2 && (!strcmp(argv[1], "--help") || !strcmp(argv[1], "-h")))
|
||||
{
|
||||
PrintHelp();
|
||||
@@ -339,8 +340,6 @@ int cli_main(int argc, char *argv[])
|
||||
return 0;
|
||||
}
|
||||
|
||||
DetectRGBControllers();
|
||||
|
||||
Options options;
|
||||
if (!ProcessOptions(argc, argv, &options))
|
||||
{
|
||||
|
||||
12
main.cpp
12
main.cpp
@@ -21,7 +21,7 @@ extern std::vector<i2c_smbus_interface*> busses;
|
||||
extern std::vector<RGBController*> rgb_controllers;
|
||||
|
||||
// See cli.cpp
|
||||
extern int cli_main(int argc, char *argv[]);
|
||||
extern int cli_main(int argc, char *argv[], std::vector<RGBController *> rgb_controllers_in);
|
||||
|
||||
/******************************************************************************************\
|
||||
* *
|
||||
@@ -35,15 +35,15 @@ int main(int argc, char* argv[])
|
||||
{
|
||||
ProfileManager profile_manager(rgb_controllers);
|
||||
|
||||
if (argc > 1 && strcmp(argv[1], "--gui"))
|
||||
{
|
||||
return cli_main(argc, argv);
|
||||
}
|
||||
|
||||
DetectRGBControllers();
|
||||
|
||||
profile_manager.LoadSizeFromProfile("sizes.ors");
|
||||
|
||||
if (argc > 1 && strcmp(argv[1], "--gui"))
|
||||
{
|
||||
return cli_main(argc, argv, rgb_controllers);
|
||||
}
|
||||
|
||||
QApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
|
||||
QApplication a(argc, argv);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user