mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
This commit is contained in:
@@ -345,7 +345,10 @@ void RiaConsoleApplication::showErrorMessage(const QString& errMsg)
|
||||
void RiaConsoleApplication::launchGrpcServer()
|
||||
{
|
||||
#ifdef ENABLE_GRPC
|
||||
m_grpcServer->run();
|
||||
m_grpcServer->runInThread();
|
||||
m_idleTimer = new QTimer(this);
|
||||
connect(m_idleTimer, SIGNAL(timeout()), this, SLOT(runIdleProcessing()));
|
||||
m_idleTimer->start(0);
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -381,3 +384,21 @@ void RiaConsoleApplication::onProjectClosed()
|
||||
processEvents();
|
||||
}
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiaConsoleApplication::runIdleProcessing()
|
||||
{
|
||||
#ifdef ENABLE_GRPC
|
||||
if (RiaGrpcServer::receivedExitRequest())
|
||||
{
|
||||
m_grpcServer->quit();
|
||||
QCoreApplication::quit();
|
||||
}
|
||||
else
|
||||
{
|
||||
m_grpcServer->processAllQueuedRequests();
|
||||
}
|
||||
#endif
|
||||
}
|
||||
@@ -21,6 +21,9 @@
|
||||
|
||||
#include <QCoreApplication>
|
||||
|
||||
#include <QPointer>
|
||||
#include <QTimer>
|
||||
|
||||
namespace cvf
|
||||
{
|
||||
class ProgramOptions;
|
||||
@@ -48,5 +51,13 @@ protected:
|
||||
void onProjectOpeningError(const QString& errMsg) override;
|
||||
void onProjectOpened();
|
||||
void onProjectClosed();
|
||||
|
||||
private slots:
|
||||
void runIdleProcessing();
|
||||
|
||||
private:
|
||||
#ifdef ENABLE_GRPC
|
||||
QPointer<QTimer> m_idleTimer;
|
||||
#endif
|
||||
};
|
||||
|
||||
|
||||
@@ -1687,7 +1687,12 @@ void RiaGuiApplication::slotWorkerProcessFinished(int exitCode, QProcess::ExitSt
|
||||
void RiaGuiApplication::runIdleProcessing()
|
||||
{
|
||||
#ifdef ENABLE_GRPC
|
||||
if (!caf::ProgressInfoStatic::isRunning())
|
||||
if (RiaGrpcServer::receivedExitRequest())
|
||||
{
|
||||
m_grpcServer->quit();
|
||||
QCoreApplication::quit();
|
||||
}
|
||||
else if (!caf::ProgressInfoStatic::isRunning())
|
||||
{
|
||||
m_grpcServer->processAllQueuedRequests();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user