Commit 67827d4b authored by Jan Möbius's avatar Jan Möbius

Set remote tcp port via command line option (not yet used in tcp plugin!)

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@12682 383ad7c9-94d9-4d36-a494-682f7c89f535
parent 3ac2639c
...@@ -134,7 +134,7 @@ ...@@ -134,7 +134,7 @@
enum {OPT_HELP , OPT_STEREO, OPT_BATCH ,OPT_CONSOLE_LOG , OPT_DEBUGGING, OPT_FULLSCREEN, enum {OPT_HELP , OPT_STEREO, OPT_BATCH ,OPT_CONSOLE_LOG , OPT_DEBUGGING, OPT_FULLSCREEN,
OPT_HIDDDEN_LOGGER , OPT_NOSPLASH ,OPT_HIDDDEN_TOOLBOX , OPT_LOAD_POLYMESHES, OPT_HIDDDEN_LOGGER , OPT_NOSPLASH ,OPT_HIDDDEN_TOOLBOX , OPT_LOAD_POLYMESHES,
OPT_REMOTE}; OPT_REMOTE, OPT_REMOTE_PORT};
CSimpleOpt::SOption g_rgOptions[] = { CSimpleOpt::SOption g_rgOptions[] = {
{ OPT_DEBUGGING , (char*) "--debug" , SO_NONE }, { OPT_DEBUGGING , (char*) "--debug" , SO_NONE },
...@@ -151,6 +151,7 @@ CSimpleOpt::SOption g_rgOptions[] = { ...@@ -151,6 +151,7 @@ CSimpleOpt::SOption g_rgOptions[] = {
{ OPT_HIDDDEN_TOOLBOX , (char*) "-t" , SO_NONE }, { OPT_HIDDDEN_TOOLBOX , (char*) "-t" , SO_NONE },
{ OPT_LOAD_POLYMESHES , (char*) "-p" , SO_NONE }, { OPT_LOAD_POLYMESHES , (char*) "-p" , SO_NONE },
{ OPT_REMOTE , (char*) "--remote-control" , SO_NONE }, { OPT_REMOTE , (char*) "--remote-control" , SO_NONE },
{ OPT_REMOTE_PORT , (char*) "--remote-port" , SO_REQ_SEP },
SO_END_OF_OPTIONS // END SO_END_OF_OPTIONS // END
}; };
...@@ -259,6 +260,8 @@ bool remoteControl = false; ...@@ -259,6 +260,8 @@ bool remoteControl = false;
bool parseCommandLineOptions(CSimpleOpt& args){ bool parseCommandLineOptions(CSimpleOpt& args){
QString port;
// while there are arguments left to process // while there are arguments left to process
while (args.Next()) { while (args.Next()) {
...@@ -275,26 +278,31 @@ bool parseCommandLineOptions(CSimpleOpt& args){ ...@@ -275,26 +278,31 @@ bool parseCommandLineOptions(CSimpleOpt& args){
OpenFlipper::Options::debug(true); OpenFlipper::Options::debug(true);
break; break;
case OPT_STEREO: case OPT_STEREO:
OpenFlipper::Options::stereo(false); OpenFlipper::Options::stereo(false);
break; break;
case OPT_HIDDDEN_TOOLBOX: case OPT_HIDDDEN_TOOLBOX:
OpenFlipperSettings().setValue("Core/Gui/ToolBoxes/hidden",true); OpenFlipperSettings().setValue("Core/Gui/ToolBoxes/hidden",true);
break; break;
case OPT_HIDDDEN_LOGGER: case OPT_HIDDDEN_LOGGER:
OpenFlipper::Options::loggerState(OpenFlipper::Options::Hidden); OpenFlipper::Options::loggerState(OpenFlipper::Options::Hidden);
break; break;
case OPT_FULLSCREEN: case OPT_FULLSCREEN:
OpenFlipperSettings().setValue("Core/Gui/fullscreen",false); OpenFlipperSettings().setValue("Core/Gui/fullscreen",false);
break; break;
case OPT_LOAD_POLYMESHES: case OPT_LOAD_POLYMESHES:
openPolyMeshes = true; openPolyMeshes = true;
break; break;
case OPT_NOSPLASH: case OPT_NOSPLASH:
OpenFlipperSettings().setValue("Core/Gui/splash",false); OpenFlipperSettings().setValue("Core/Gui/splash",false);
break; break;
case OPT_REMOTE: case OPT_REMOTE:
OpenFlipper::Options::remoteControl(true); OpenFlipper::Options::remoteControl(true);
break; break;
case OPT_REMOTE_PORT:
port = args.OptionArg();
std::cerr << "Got option : " << port.toStdString() << std::endl;
OpenFlipper::Options::remoteControl(port.toInt());
break;
case OPT_HELP: case OPT_HELP:
showHelp(); showHelp();
return 0; return 0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment