From 681c1cbb982dc99b96ee4ee7012a3b303ae673e2 Mon Sep 17 00:00:00 2001 From: srn Date: Wed, 5 Apr 2006 12:52:48 +0000 Subject: [PATCH] BugID: 12080, moved showing of a splash to beging of SALOME_Session_Server --- src/Session/SALOME_Session_Server.cxx | 38 ++++++++++++++++----------- 1 file changed, 22 insertions(+), 16 deletions(-) diff --git a/src/Session/SALOME_Session_Server.cxx b/src/Session/SALOME_Session_Server.cxx index dbc9e1633..efa9e7496 100755 --- a/src/Session/SALOME_Session_Server.cxx +++ b/src/Session/SALOME_Session_Server.cxx @@ -271,6 +271,26 @@ int main( int argc, char **argv ) int result = -1; + InquireServersGUI splash; + bool isSplash = false; + + //SRN: Show a splash ASAP + if ( isFound( "SPLASH", argc, argv ) ) { + isSplash = true; + // create temporary resource manager just to load splash icon + SUIT_ResourceMgr resMgr( "SalomeApp", QString( "%1Config" ) ); + resMgr.setCurrentFormat( "xml" ); + resMgr.loadLanguage( "LightApp", "en" ); + + // create splash object: widget ( splash with progress bar ) and "pinging" thread + splash.setPixmap( resMgr.loadPixmap( "LightApp", QObject::tr( "ABOUT_SPLASH" ) ) ); + SUIT_Tools::centerWidget( &splash, _qappl.desktop() ); + + _qappl.setMainWidget( &splash ); + QObject::connect( &_qappl, SIGNAL( lastWindowClosed() ), &_qappl, SLOT( quit() ) ); + splash.show(); // display splash with running progress bar + } + CORBA::ORB_var orb; PortableServer::POA_var poa; @@ -352,23 +372,9 @@ int main( int argc, char **argv ) _ServerLaunch.wait( &_GUIMutex ); // to be reseased by Launch server thread when ready: // show splash screen if "SPLASH" parameter was passed ( default ) - if ( isFound( "SPLASH", argc, argv ) ) + if ( isSplash ) { - // create temporary resource manager just to load splash icon - SUIT_ResourceMgr resMgr( "SalomeApp", QString( "%1Config" ) ); - resMgr.setCurrentFormat( "xml" ); - resMgr.loadLanguage( "LightApp", "en" ); - - // create splash object: widget ( splash with progress bar ) and "pinging" thread - InquireServersGUI splash; - splash.setPixmap( resMgr.loadPixmap( "LightApp", QObject::tr( "ABOUT_SPLASH" ) ) ); - SUIT_Tools::centerWidget( &splash, _qappl.desktop() ); - - _qappl.setMainWidget( &splash ); - QObject::connect( &_qappl, SIGNAL( lastWindowClosed() ), &_qappl, SLOT( quit() ) ); - splash.show(); // display splash with running progress bar - _qappl.exec(); // wait untill splash closes ( progress runs till end or Cancel is pressed ) - + _qappl.exec(); // wait untill splash closes ( progress runs till end or Cancel is pressed ) result = splash.getExitStatus(); // 1 is error } else -- 2.39.2