From: srn Date: Wed, 5 Apr 2006 12:52:48 +0000 (+0000) Subject: BugID: 12080, moved showing of a splash to beging of SALOME_Session_Server X-Git-Tag: T3_2_0b1_pre1~42 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=681c1cbb982dc99b96ee4ee7012a3b303ae673e2;p=modules%2Fgui.git BugID: 12080, moved showing of a splash to beging of SALOME_Session_Server --- 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