SUIT_ResourceMgr* resMgr = aSession->createResourceMgr( argList.first() );
if ( resMgr ) {
resMgr->loadLanguage();
- QString splashIcon, splashInfo, splashTextColors;
- resMgr->value( "splash", "image", splashIcon );
- resMgr->value( "splash", "info", splashInfo, false );
- resMgr->value( "splash", "text_colors", splashTextColors );
QString appName = QObject::tr( "APP_NAME" ).stripWhiteSpace();
QString appVersion = QObject::tr( "APP_VERSION" ).stripWhiteSpace();
if ( appVersion == "APP_VERSION" ) {
else
appVersion = "";
}
+ QString splashIcon;
+ resMgr->value( "splash", "image", splashIcon );
QPixmap px( splashIcon );
if ( !px.isNull() ) {
splash = QtxSplash::splash( px );
- if ( !splashTextColors.isEmpty() ) {
+ int splashMargin;
+ if ( resMgr->value( "splash", "margin", splashMargin ) && splashMargin > 0 ) {
+ splash->setMargin( splashMargin );
+ }
+ QString splashTextColors;
+ if ( resMgr->value( "splash", "text_colors", splashTextColors ) && !splashTextColors.isEmpty() ) {
QStringList colors = QStringList::split( "|", splashTextColors );
QColor c1, c2;
if ( colors.count() > 0 ) c1 = QColor( colors[0] );
QFont f = splash->font();
f.setBold( true );
splash->setFont( f );
- if ( !splashInfo.isEmpty() ) {
+ QString splashInfo;
+ if ( resMgr->value( "splash", "info", splashInfo, false ) && !splashInfo.isEmpty() ) {
splashInfo.replace( QRegExp( "%A" ), appName );
splashInfo.replace( QRegExp( "%V" ), QObject::tr( "ABOUT_VERSION" ).arg( appVersion ) );
splashInfo.replace( QRegExp( "%L" ), QObject::tr( "ABOUT_LICENSE" ) );
resMgr.setCurrentFormat( "xml" );
resMgr.loadLanguage( "LightApp", "en" );
// ...get splash preferences
- QString splashIcon, splashInfo, splashTextColors, splashProgressColors;
- resMgr.value( "splash", "image", splashIcon );
- resMgr.value( "splash", "info", splashInfo, false );
- resMgr.value( "splash", "text_colors", splashTextColors );
- resMgr.value( "splash", "progress_colors", splashProgressColors );
+ QString splashIcon;
+ resMgr.value( "splash", "image", splashIcon );
QPixmap px( splashIcon );
if ( px.isNull() ) // try to get splash pixmap from resources
px = resMgr.loadPixmap( "LightApp", QObject::tr( "ABOUT_SPLASH" ) );
if ( !px.isNull() ) {
// ...set splash pixmap
splash = QtxSplash::splash( px );
+ // ... set margin
+ int splashMargin;
+ if ( resMgr.value( "splash", "margin", splashMargin ) && splashMargin > 0 ) {
+ splash->setMargin( splashMargin );
+ }
// ...set splash text colors
- if ( !splashTextColors.isEmpty() ) {
+ QString splashTextColors;
+ if ( resMgr.value( "splash", "text_colors", splashTextColors ) && !splashTextColors.isEmpty() ) {
QStringList colors = QStringList::split( "|", splashTextColors );
QColor c1, c2;
if ( colors.count() > 0 ) c1 = QColor( colors[0] );
splash->setTextColors( Qt::white, Qt::black );
}
// ...set splash progress colors
- if ( !splashProgressColors.isEmpty() ) {
+ QString splashProgressColors;
+ if ( resMgr.value( "splash", "progress_colors", splashProgressColors ) && !splashProgressColors.isEmpty() ) {
QStringList colors = QStringList::split( "|", splashProgressColors );
QColor c1, c2;
int gradType = QtxSplash::Vertical;
f.setBold( true );
splash->setFont( f );
// ...show splash initial status
- if ( !splashInfo.isEmpty() ) {
+ QString splashInfo;
+ if ( resMgr.value( "splash", "info", splashInfo, false ) && !splashInfo.isEmpty() ) {
splashInfo.replace( QRegExp( "%A" ), QObject::tr( "APP_NAME" ) );
splashInfo.replace( QRegExp( "%V" ), QObject::tr( "ABOUT_VERSION" ).arg( salomeVersion() ) );
splashInfo.replace( QRegExp( "%L" ), QObject::tr( "ABOUT_LICENSE" ) );