mirror of
https://github.com/CalcProgrammer1/OpenRGB.git
synced 2026-02-04 12:21:11 -05:00
Fixed GUI not starting when configuration flags are used
This commit is contained in:
11
cli.cpp
11
cli.cpp
@@ -936,6 +936,7 @@ unsigned int cli_pre_detection(int argc, char *argv[])
|
||||
| to detecting devices and/or starting clients |
|
||||
\*---------------------------------------------------------*/
|
||||
int arg_index = 1;
|
||||
unsigned int cfg_args = 0;
|
||||
unsigned int ret_flags = 0;
|
||||
unsigned short server_port = OPENRGB_SDK_PORT;
|
||||
bool server_start = false;
|
||||
@@ -960,6 +961,7 @@ unsigned int cli_pre_detection(int argc, char *argv[])
|
||||
if(option == "--localconfig")
|
||||
{
|
||||
ResourceManager::get()->SetConfigurationDirectory("./");
|
||||
cfg_args++;
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------*\
|
||||
@@ -968,6 +970,7 @@ unsigned int cli_pre_detection(int argc, char *argv[])
|
||||
else if(option == "--config")
|
||||
{
|
||||
ResourceManager::get()->SetConfigurationDirectory(argument);
|
||||
cfg_args++;
|
||||
arg_index++;
|
||||
}
|
||||
|
||||
@@ -977,6 +980,7 @@ unsigned int cli_pre_detection(int argc, char *argv[])
|
||||
else if(option == "--nodetect")
|
||||
{
|
||||
ret_flags |= RET_FLAG_NO_DETECT;
|
||||
cfg_args++;
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------*\
|
||||
@@ -1066,7 +1070,7 @@ unsigned int cli_pre_detection(int argc, char *argv[])
|
||||
print_help = true;
|
||||
break;
|
||||
}
|
||||
|
||||
cfg_args++;
|
||||
arg_index++;
|
||||
}
|
||||
|
||||
@@ -1135,6 +1139,11 @@ unsigned int cli_pre_detection(int argc, char *argv[])
|
||||
ret_flags |= RET_FLAG_START_SERVER;
|
||||
}
|
||||
|
||||
if((argc - cfg_args) <= 1)
|
||||
{
|
||||
ret_flags |= RET_FLAG_START_GUI;
|
||||
}
|
||||
|
||||
return(ret_flags);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user