Create a new ApplicationExe project for the executable

This commit is contained in:
Gaute Lindkvist
2021-01-06 15:03:38 +01:00
parent 2de5c9ce0b
commit 04d5daca67
412 changed files with 1438 additions and 872 deletions

View File

@@ -190,8 +190,6 @@ RiaGuiApplication::RiaGuiApplication( int& argc, char** argv )
setWindowIcon( QIcon( ":/AppLogo48x48.png" ) );
m_recentFileActionProvider = std::make_unique<RiuRecentFileActionProvider>();
connect( this, SIGNAL( aboutToQuit() ), this, SLOT( onProgramExit() ) );
}
//--------------------------------------------------------------------------------------------------
@@ -1201,29 +1199,6 @@ void RiaGuiApplication::showFormattedTextInMessageBoxOrConsole( const QString& t
dlg.exec();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RiaGuiApplication::launchGrpcServer()
{
#ifdef ENABLE_GRPC
m_grpcServer->runInThread();
m_idleTimer = new QTimer( this );
connect( m_idleTimer, SIGNAL( timeout() ), this, SLOT( runIdleProcessing() ) );
m_idleTimer->start( 5 );
#endif
}
#ifdef ENABLE_GRPC
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RiaGrpcServer* RiaGuiApplication::grpcServer() const
{
return m_grpcServer.get();
}
#endif
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
@@ -1389,19 +1364,6 @@ void RiaGuiApplication::onProjectSaved()
caf::PdmUiModelChangeDetector::instance()->reset();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RiaGuiApplication::onProgramExit()
{
#ifdef ENABLE_GRPC
if ( m_grpcServer )
{
m_grpcServer->quit();
}
#endif
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
@@ -1595,27 +1557,11 @@ void RiaGuiApplication::applyGuiPreferences( const RiaPreferences*
}
}
caf::PdmUiItem::enableExtraDebugText( m_preferences->appendFieldKeywordToToolTipText() );
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RiaGuiApplication::updateGrpcServer()
{
#ifdef ENABLE_GRPC
bool isGrpcRunning = m_grpcServer != nullptr && m_grpcServer->isRunning();
bool shouldItBeRunning = m_preferences->enableGrpcServer();
if ( isGrpcRunning && !shouldItBeRunning )
if ( oldPreferences )
{
m_grpcServer->quit();
onGuiPreferencesChanged();
}
else if ( !isGrpcRunning && shouldItBeRunning )
{
int portNumber = RiaGrpcServer::findAvailablePortNumber( m_preferences->defaultGrpcPortNumber() );
m_grpcServer = std::make_unique<RiaGrpcServer>( portNumber );
m_grpcServer->runInThread();
}
#endif
}
//--------------------------------------------------------------------------------------------------
@@ -1690,43 +1636,6 @@ void RiaGuiApplication::slotWorkerProcessFinished( int exitCode, QProcess::ExitS
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RiaGuiApplication::runIdleProcessing()
{
#ifdef ENABLE_GRPC
if ( RiaGrpcServer::receivedExitRequest() )
{
closeProject();
m_grpcServer->quit();
QCoreApplication::quit();
}
else if ( !caf::ProgressInfoStatic::isRunning() )
{
static int idleIterationCount = 0;
int iterationInterval = 0;
if ( m_grpcServer->processAllQueuedRequests() > 0 )
{
idleIterationCount = 0;
}
else
{
++idleIterationCount;
idleIterationCount = std::min( idleIterationCount, 500 );
if ( idleIterationCount == 500 )
{
iterationInterval = 5;
}
}
if ( iterationInterval != m_idleTimer->interval() )
{
m_idleTimer->setInterval( iterationInterval );
}
}
#endif
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------