From: vsr Date: Tue, 13 Sep 2005 10:19:09 +0000 (+0000) Subject: Provide logo support for SALOME desktop; X-Git-Tag: V3_1_0a1~27 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=debde7ca3904d1c2b2ead2a782bdfd801ff43823;p=modules%2Fgui.git Provide logo support for SALOME desktop; Improve version number handling. --- diff --git a/src/SalomeApp/SalomeApp_Application.cxx b/src/SalomeApp/SalomeApp_Application.cxx index 742ecab76..16b7ab939 100644 --- a/src/SalomeApp/SalomeApp_Application.cxx +++ b/src/SalomeApp/SalomeApp_Application.cxx @@ -145,6 +145,11 @@ myPrefs( 0 ) desktop()->setDockableMenuBar( true ); desktop()->setDockableStatusBar( false ); + // base logo (salome itself) + desktop()->addLogo( "_app_base", aResMgr->loadPixmap( "SalomeApp", tr( "APP_BASE_LOGO" ), false ) ); + // extra logo (salome-based application) + desktop()->addLogo( "_app_extra", aResMgr->loadPixmap( "SalomeApp", tr( "APP_EXTRA_LOGO" ), false ) ); + clearViewManagers(); mySelMgr = new SalomeApp_SelectionMgr( this ); @@ -235,30 +240,37 @@ QString SalomeApp_Application::applicationVersion() const if ( _app_version.isEmpty() ) { - QString path( ::getenv( "GUI_ROOT_DIR" ) ); - if ( !path.isEmpty() ) - path += QDir::separator(); - path += QString( "bin/salome/VERSION" ); - - QFile vf( path ); - if ( vf.open( IO_ReadOnly ) ) + QString resVersion = tr( "APP_VERSION" ); + if ( resVersion != "APP_VERSION" ) + { + _app_version = resVersion; + } + else { - QString line; - vf.readLine( line, 1024 ); - vf.close(); + QString path( ::getenv( "GUI_ROOT_DIR" ) ); + if ( !path.isEmpty() ) + path += QDir::separator(); + path += QString( "bin/salome/VERSION" ); - if ( !line.isEmpty() ) + QFile vf( path ); + if ( vf.open( IO_ReadOnly ) ) { - while ( !line.isEmpty() && line.at( line.length() - 1 ) == QChar( '\n' ) ) - line.remove( line.length() - 1, 1 ); - - int idx = line.findRev( ":" ); - if ( idx != -1 ) - _app_version = line.mid( idx + 1 ).stripWhiteSpace(); + QString line; + vf.readLine( line, 1024 ); + vf.close(); + + if ( !line.isEmpty() ) + { + while ( !line.isEmpty() && line.at( line.length() - 1 ) == QChar( '\n' ) ) + line.remove( line.length() - 1, 1 ); + + int idx = line.findRev( ":" ); + if ( idx != -1 ) + _app_version = line.mid( idx + 1 ).stripWhiteSpace(); + } } } } - return _app_version; }