Add quit cli command and app quit option after stream session. Fixes #92 (#138)

* Add quit cli command and app quit option after stream session. Fixes #92

* Code review fixes.
This commit is contained in:
Janne Hakonen
2018-12-06 04:45:28 +02:00
committed by Cameron Gutman
parent ad47990a87
commit 0ab07303c9
22 changed files with 678 additions and 67 deletions

View File

@@ -21,6 +21,7 @@
#include "antihookingprotection.h"
#endif
#include "cli/quitstream.h"
#include "cli/startstream.h"
#include "cli/commandlineparser.h"
#include "path.h"
@@ -342,6 +343,15 @@ int main(int argc, char *argv[])
engine.rootContext()->setContextProperty("launcher", launcher);
break;
}
case GlobalCommandLineParser::QuitRequested:
{
initialView = "CliQuitStreamSegue.qml";
QuitCommandLineParser quitParser;
quitParser.parse(app.arguments());
auto launcher = new CliQuitStream::Launcher(quitParser.getHost(), &app);
engine.rootContext()->setContextProperty("launcher", launcher);
break;
}
}
engine.rootContext()->setContextProperty("initialView", initialView);
@@ -369,5 +379,9 @@ int main(int argc, char *argv[])
int err = app.exec();
// Give worker tasks time to properly exit. Fixes PendingQuitTask
// sometimes freezing and blocking process exit.
QThreadPool::globalInstance()->waitForDone(30000);
return err;
}