</section>
<section name="splash" >
<!-- Splash screen settings -->
- <parameter name="image" value="${GUI_ROOT_DIR}/share/salome/resources/gui/icon_about.png" />
- <parameter name="info" value="%A : %V" />
- <parameter name="text_colors" value="#543AA9|#FFFFFF" />
+ <parameter name="image" value="${GUI_ROOT_DIR}/share/salome/resources/gui/icon_about.png" />
+ <parameter name="constant_info" value="%A [ %V ]" />
+ <parameter name="text_colors" value="#5A81BF|#20408F" />
+ <parameter name="hide_on_click" value="no" />
+ <parameter name="margin" value="10" />
+ <parameter name="progress_width" value="20" />
+ <parameter name="progress_flags" value="bottom,left_to_right" />
+ <parameter name="opacity" value="0.70" />
+ <parameter name="font" value="Helvetica,12,bold" />
+ <parameter name="alignment" value="top,left" />
+ <parameter name="progress_gradient" value="linear|0.3|0.0|1.0|1.0|reflect|0.0|red|0.2|blue|0.5|yellow|0.6|black|1.0|white" />
+ <parameter name="progress_colors" value="#20408F|#5A81BF|vertical" />
</section>
<section name="resources">
<!-- Resource directories (resource manager)-->
// spread type
if ( vals.count() > 5 )
{
- if ( vals[ 5 ] == "pad" || vals[ 5 ] == "0" )
+ QString spread = vals[ 5 ].trimmed().toLower();
+ if ( spread == "pad" || spread == "0" )
gradient.setSpread( QGradient::PadSpread );
- else if ( vals[ 5 ] == "repeat" || vals[ 5 ] == "2" )
+ else if ( spread == "repeat" || spread == "2" )
gradient.setSpread( QGradient::RepeatSpread );
- else if ( vals[ 5 ] == "reflect" || vals[ 5 ] == "1" )
+ else if ( spread == "reflect" || spread == "1" )
gradient.setSpread( QGradient::ReflectSpread );
}
// stop points
// spread type
if ( vals.count() > 6 )
{
- if ( vals[ 6 ] == "pad" || vals[ 6 ] == "0" )
+ QString spread = vals[ 6 ].trimmed().toLower();
+ if ( spread == "pad" || spread == "0" )
gradient.setSpread( QGradient::PadSpread );
- else if ( vals[ 6 ] == "repeat" || vals[ 6 ] == "2" )
+ else if ( spread == "repeat" || spread == "2" )
gradient.setSpread( QGradient::RepeatSpread );
- else if ( vals[ 6 ] == "reflect" || vals[ 6 ] == "1" )
+ else if ( spread == "reflect" || spread == "1" )
gradient.setSpread( QGradient::ReflectSpread );
}
// stop points
// spread type
if ( vals.count() > 4 )
{
- if ( vals[ 4 ] == "pad" || vals[ 4 ] == "0" )
+ QString spread = vals[ 4 ].trimmed().toLower();
+ if ( spread == "pad" || spread == "0" )
gradient.setSpread( QGradient::PadSpread );
- else if ( vals[ 4 ] == "repeat" || vals[ 4 ] == "2" )
+ else if ( spread == "repeat" || spread == "2" )
gradient.setSpread( QGradient::RepeatSpread );
- else if ( vals[ 4 ] == "reflect" || vals[ 4 ] == "1" )
+ else if ( spread == "reflect" || spread == "1" )
gradient.setSpread( QGradient::ReflectSpread );
}
// stop points
}
// progress bar position and direction
- int pf;
+ QString pf;
if ( resMgr->value( resSection, "progress_flags", pf ) ) {
- setProgressFlags( pf );
+ bool bOk;
+ int fl = pf.toInt( &bOk );
+ if ( !bOk ) {
+ fl = 0;
+ QStringList opts = pf.split( QRegExp( "," ), QString::SkipEmptyParts );
+ for ( int i = 0; i < opts.count(); i++ ) {
+ QString opt = opts[i].trimmed().toLower();
+ if ( opt == "left" )
+ fl = fl | LeftSide;
+ else if ( opt == "right" )
+ fl = fl | RightSide;
+ else if ( opt == "top" )
+ fl = fl | TopSide;
+ else if ( opt == "bottom" )
+ fl = fl | BottomSide;
+ else if ( opt == "left_to_right" )
+ fl = fl | LeftToRight;
+ else if ( opt == "right_to_left" )
+ fl = fl | RightToLeft;
+ }
+ }
+ setProgressFlags( fl );
}
// opacity
}
// text alignment
- int al;
+ QString al;
if ( resMgr->value( resSection, "alignment", al ) ) {
- setTextAlignment( al );
+ bool bOk;
+ int fl = al.toInt( &bOk );
+ if ( !bOk ) {
+ fl = 0;
+ QStringList opts = al.split( QRegExp( "," ), QString::SkipEmptyParts );
+ for ( int i = 0; i < opts.count(); i++ ) {
+ QString opt = opts[i].trimmed().toLower();
+ if ( opt == "left" )
+ fl = fl | Qt::AlignLeft;
+ else if ( opt == "right" )
+ fl = fl | Qt::AlignRight;
+ else if ( opt == "top" )
+ fl = fl | Qt::AlignTop;
+ else if ( opt == "bottom" )
+ fl = fl | Qt::AlignBottom;
+ else if ( opt == "hcenter" )
+ fl = fl | Qt::AlignHCenter;
+ else if ( opt == "vcenter" )
+ fl = fl | Qt::AlignVCenter;
+ else if ( opt == "justify" )
+ fl = fl | Qt::AlignJustify;
+ else if ( opt == "center" )
+ fl = fl | Qt::AlignCenter;
+ }
+ }
+ setTextAlignment( fl );
}
// progress color(s)
if ( colors.count() > 0 ) c1 = QColor( colors[0] );
if ( colors.count() > 1 ) c2 = QColor( colors[1] );
int gt;
- bool bOk;
if ( colors.count() > 2 ) {
+ bool bOk;
gt = colors[2].toInt( &bOk );
- if ( bOk && gt >= QtxSplash::Horizontal && gt <= QtxSplash::Vertical )
- gradType = (QtxSplash::GradientType)gt;
+ if ( bOk ) {
+ if ( gt >= QtxSplash::Horizontal && gt <= QtxSplash::Vertical )
+ gradType = (QtxSplash::GradientType)gt;
+ }
+ else {
+ if ( colors[2].toLower() == "horizontal" )
+ gradType = QtxSplash::Horizontal;
+ else if ( colors[2].toLower() == "vertical" )
+ gradType = QtxSplash::Vertical;
+ }
}
setProgressColors( c1, c2, gradType );
}
#include "SUITApp_Application.h"
#include <SUIT_Session.h>
-//#include <SUIT_Desktop.h>
+#include <SUIT_Desktop.h>
#include <SUIT_ResourceMgr.h>
#include <Style_Salome.h>
#include <Style_Model.h>
-
-// TODO
-//#include <QtxSplash.h>
+#include <QtxSplash.h>
#ifdef SUIT_ENABLE_PYTHON
#include <Python.h>
#include <QDir>
#include <QFile>
-//#include <QRegExp>
+#include <QRegExp>
#include <QString>
#include <QStringList>
QFile vf( path );
if ( !vf.open( QFile::ReadOnly ) )
- return QString::null;
+ return QString();
QString line = vf.readLine( 1024 );
vf.close();
if ( line.isEmpty() )
- return QString::null;
+ return QString();
while ( !line.isEmpty() && line.at( line.length() - 1 ) == QChar( '\n' ) )
line.remove( line.length() - 1, 1 );
if ( !argList.isEmpty() )
{
SUITApp_Session* aSession = new SUITApp_Session( iniFormat );
- // TODO
-/*
QtxSplash* splash = 0;
- if ( !noSplash )
+ if ( !noSplash )
{
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" )
- {
- if ( appName == "APP_NAME" || appName.toLower() == "salome" )
- appVersion = salomeVersion();
- else
- appVersion = "";
- }
- QPixmap px( splashIcon );
- if ( !px.isNull() )
- {
- splash = QtxSplash::splash( px );
- if ( !splashTextColors.isEmpty() )
- {
- QStringList colors = QStringList::split( "|", splashTextColors );
- QColor c1, c2;
- if ( colors.count() > 0 )
- c1 = QColor( colors[0] );
- if ( colors.count() > 1 )
- c2 = QColor( colors[1] );
- splash->setTextColors( c1, c2 );
- }
- else
- {
- splash->setTextColors( Qt::white, Qt::black );
- }
-#ifdef _DEBUG_
- splash->setHideOnClick( true );
-#endif
- QFont f = splash->font();
- f.setBold( true );
- splash->setFont( f );
- if ( !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" ) );
- splashInfo.replace( QRegExp( "%C" ), QObject::tr( "ABOUT_COPYRIGHT" ) );
- splashInfo.replace( QRegExp( "\\\\n" ), "\n" );
- splash->message( splashInfo );
- }
- splash->show();
- QApplication::instance()->processEvents();
- }
+ resMgr->loadLanguage();
+
+ splash = QtxSplash::splash( QPixmap() );
+ splash->readSettings( resMgr );
+ if ( splash->pixmap().isNull() ) {
+ delete splash;
+ splash = 0;
+ }
+ else {
+ QString appName = QObject::tr( "APP_NAME" ).trimmed();
+ QString appVersion = QObject::tr( "APP_VERSION" ).trimmed();
+ if ( appVersion == "APP_VERSION" )
+ {
+ if ( appName == "APP_NAME" || appName.toLower() == "salome" )
+ appVersion = salomeVersion();
+ else
+ appVersion = "";
+ }
+ splash->setOption( "%A", appName );
+ splash->setOption( "%V", QObject::tr( "ABOUT_VERSION" ).arg( appVersion ) );
+ splash->setOption( "%L", QObject::tr( "ABOUT_LICENSE" ) );
+ splash->setOption( "%C", QObject::tr( "ABOUT_COPYRIGHT" ) );
+ splash->show();
+ QApplication::instance()->processEvents();
+ }
}
}
-*/
+
SUIT_Application* theApp = aSession->startApplication( argList.first() );
if ( theApp )
{
if ( !noExceptHandling )
app.setHandler( aSession->handler() );
-// TODO
-// if ( splash )
-// splash->finish( theApp->desktop() );
+ if ( splash )
+ splash->finish( theApp->desktop() );
result = app.exec();
-// TODO
-// delete splash;
+ delete splash;
}
delete aSession;
}
</section>
<section name="splash" >
<!-- Splash screen settings -->
- <parameter name="image" value="${GUI_ROOT_DIR}/share/salome/resources/gui/icon_about.png" />
- <parameter name="info" value="%V" />
- <parameter name="text_colors" value="#543AA9|#FFFFFF" />
- <parameter name="progress_colors" value="#0A4E5F|#B2EFED|1" />
+ <parameter name="image" value="${GUI_ROOT_DIR}/share/salome/resources/gui/icon_about.png" />
+ <parameter name="constant_info" value="%A [ %V ]" />
+ <parameter name="text_colors" value="#5A81BF|#20408F" />
+ <parameter name="hide_on_click" value="no" />
+ <parameter name="margin" value="10" />
+ <parameter name="progress_width" value="20" />
+ <parameter name="progress_flags" value="bottom,left_to_right" />
+ <parameter name="opacity" value="0.70" />
+ <parameter name="font" value="Helvetica,12,bold" />
+ <parameter name="alignment" value="top,left" />
+ <parameter name="progress_gradient" value="linear|0.3|0.0|1.0|1.0|reflect|0.0|red|0.2|blue|0.5|yellow|0.6|black|1.0|white" />
+ <parameter name="progress_colors" value="#20408F|#5A81BF|vertical" />
</section>
<section name="resources">
<!-- Resource directories (resource manager)-->