Add client option -i to stay in interactive mode after a script or command

From 5a3f474331
with some fix in the logical flow
This commit is contained in:
Philippe Teuwen 2019-08-04 15:34:18 +02:00
parent 88d2a61c0b
commit 1cb039255e
6 changed files with 28 additions and 15 deletions

View file

@ -15,14 +15,14 @@
static ProxGuiQT *gui = NULL;
static WorkerThread *main_loop_thread = NULL;
WorkerThread::WorkerThread(char *script_cmds_file, char *script_cmd) : script_cmds_file(script_cmds_file), script_cmd(script_cmd) {
WorkerThread::WorkerThread(char *script_cmds_file, char *script_cmd, bool stayInCommandLoop) : script_cmds_file(script_cmds_file), script_cmd(script_cmd), stayInCommandLoop(stayInCommandLoop) {
}
WorkerThread::~WorkerThread() {
}
void WorkerThread::run() {
main_loop(script_cmds_file, script_cmd);
main_loop(script_cmds_file, script_cmd, stayInCommandLoop);
}
extern "C" void ShowGraphWindow(void) {
@ -53,12 +53,12 @@ extern "C" void MainGraphics(void) {
gui->MainLoop();
}
extern "C" void InitGraphics(int argc, char **argv, char *script_cmds_file, char *script_cmd) {
extern "C" void InitGraphics(int argc, char **argv, char *script_cmds_file, char *script_cmd, bool stayInCommandLoop) {
#ifdef Q_WS_X11
if (getenv("DISPLAY") == NULL)
return;
#endif
main_loop_thread = new WorkerThread(script_cmds_file, script_cmd);
main_loop_thread = new WorkerThread(script_cmds_file, script_cmd, stayInCommandLoop);
gui = new ProxGuiQT(argc, argv, main_loop_thread);
}