GODT-1837: Fix restart.

GOTD-1837: added wait flag.
GODT-1837: strip --wait flag from launcher command-line.
GODT-1837: hide main window before restart.
This commit is contained in:
Xavier Michelon
2022-08-30 11:56:13 +02:00
parent 2780dc6a67
commit 8bb2a399cc
15 changed files with 237 additions and 67 deletions

View File

@ -31,8 +31,8 @@ using namespace bridgepp;
EventStreamReader::EventStreamReader(QObject *parent)
: Worker(parent)
{
connect(this, &EventStreamReader::started, [&]() { app().log().debug("EventStreamReader started"); });
connect(this, &EventStreamReader::finished, [&]() { app().log().debug("EventStreamReader finished"); });
connect(this, &EventStreamReader::started, this, &EventStreamReader::onStarted);
connect(this, &EventStreamReader::finished, this, &EventStreamReader::onFinished);
connect(this, &EventStreamReader::error, &app().log(), &Log::error);
}
@ -57,3 +57,27 @@ void EventStreamReader::run()
emit error(e.qwhat());
}
}
//****************************************************************************************************************************************************
//
//****************************************************************************************************************************************************
void EventStreamReader::onStarted() const
{
app().log().debug("EventStreamReader started");
}
//****************************************************************************************************************************************************
//
//****************************************************************************************************************************************************
void EventStreamReader::onFinished() const
{
app().log().debug("EventStreamReader finished");
if (!app().bridgeMonitor())
{
// no bridge monitor means we are in a debug environment, running in attached mode. Event stream has terminated, so bridge is shutting
// down. Because we're in attached mode, bridge-gui will not get notified that bridge is going down, so we shutdown manually here.
qApp->exit(EXIT_SUCCESS);
}
}