+// ================================================================
+/*!
+ * makeTitle
+ * Creates HTML-wrapped title text
+ */
+// ================================================================
+QString makeTitle( const QString& text, const QString& separator = " ", bool fl = true )
+{
+ QStringList words = QStringList::split( separator, text );
+ if ( fl ) {
+ for ( uint i = 0; i < words.count(); i++ )
+ words[i] = QString( "<font color=red>%1</font>" ).arg( words[i].left(1) ) + words[i].mid(1);
+ }
+ else {
+ if ( words.count() > 0 )
+ words[0] = QString( "<font color=red>%1</font>" ).arg( words[0] );
+ if ( words.count() > 1 )
+ words[words.count()-1] = QString( "<font color=red>%1</font>" ).arg( words[words.count()-1] );
+ }
+ QString res = words.join( separator );
+ if ( !res.isEmpty() )
+ res = QString( "<b>%1</b>" ).arg( res );
+ return res;
+}
+
+// ================================================================
+/*!
+ * QMyCheckBox class : custom check box
+ * The only goal is to give access to the protected setState() method
+ */
+// ================================================================
+class QMyCheckBox: public QCheckBox
+{
+public:
+ QMyCheckBox( const QString& text, QWidget* parent, const char* name = 0 ) : QCheckBox ( text, parent, name ) {}
+ void setState ( ToggleState s ) { QCheckBox::setState( s ); }
+};
+
+// ================================================================
+/*!
+ * AboutDlg
+ * "About dialog box.
+ */
+// ================================================================
+class AboutDlg: public QDialog
+{
+public:
+ AboutDlg( SALOME_InstallWizard* parent ) : QDialog( parent, "About dialog box", true )
+ {
+ // caption
+ setCaption( QString( "About %1" ).arg( parent->getIWName() ) );
+ // palette
+ QPalette pal = palette();
+ QColorGroup cg = pal.active();
+ cg.setColor( QColorGroup::Foreground, Qt::darkBlue );
+ cg.setColor( QColorGroup::Background, Qt::white );
+ pal.setActive( cg ); pal.setInactive( cg ); pal.setDisabled( cg );
+ setPalette( pal );
+ // layout
+ QGridLayout* main = new QGridLayout( this, 1, 1, 11, 6 );
+ // image
+ QLabel* logo = new QLabel( this, "logo" );
+ logo->setSizePolicy( QSizePolicy( QSizePolicy::Fixed, QSizePolicy::Fixed ) );
+ logo->setMinimumSize( 32, 32 ); logo->setMaximumSize( 32, 32 );
+ logo->setPaletteBackgroundColor( QColor( 234, 250, 234 ) );
+ logo->setFrameStyle( QLabel::NoFrame | QLabel::Plain );
+ logo->setPixmap( pixmap( pxAbout ) );
+ logo->setScaledContents( false );
+ logo->setAlignment( QLabel::AlignCenter );
+ // decoration
+ QLabel* decorLeft = new QLabel( this, "decorLeft" );
+ decorLeft->setSizePolicy( QSizePolicy( QSizePolicy::Fixed, QSizePolicy::Expanding ) );
+ decorLeft->setMinimumWidth( 32 ); decorLeft->setMaximumWidth( 32 );
+ decorLeft->setPaletteBackgroundColor( QColor( 234, 250, 234 ) );
+ decorLeft->setScaledContents( false );
+ QLabel* decorTop = new QLabel( this, "decorTop" );
+ decorTop->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
+ decorTop->setMinimumHeight( 32 ); decorTop->setMaximumHeight( 32 );
+ decorTop->setPaletteBackgroundColor( QColor( 234, 250, 234 ) );
+ decorTop->setScaledContents( false );
+ // contents
+ QLabel* title = new QLabel( this, "title" );
+ QString tlt = parent->getIWName();
+ title->setText( makeTitle( tlt ) );
+ QLabel* version = new QLabel( this, "version" );
+ version->setText( QString( "<b>Version</b>: %1.%1.%1" ).arg( __IW_VERSION_MAJOR__ ) \
+ .arg( __IW_VERSION_MINOR__ ) \
+ .arg( __IW_VERSION_PATCH__ ) );
+ QLabel* copyright = new QLabel( this, "copyright" );
+ copyright->setText( "<b>Copyright</b> © 2004-2006 CEA" );
+ QFont font = title->font();
+ font.setPointSize( (int)( font.pointSize() * 1.8 ) );
+ title->setFont( font );
+ QFrame* line = new QFrame( this, "line" );
+ line->setFrameStyle( QFrame::HLine | QFrame::Sunken );
+ QLabel* url = new QLabel( this, "url" );
+ url->setText( makeTitle( "www.salome-platform.org", ".", false ) );
+ url->setAlignment( AlignRight );
+ font = version->font();
+ font.setPointSize( (int)( font.pointSize() / 1.2 ) );
+ version->setFont( font );
+ copyright->setFont( font );
+ url->setFont( font );
+ // layout
+ main->addWidget( logo, 0, 0 );
+ main->addMultiCellWidget( decorLeft, 1, 5, 0, 0 );
+ main->addWidget( decorTop, 0, 1 );
+ main->addWidget( title, 1, 1 );
+ main->addWidget( version, 2, 1 );
+ main->addWidget( copyright, 3, 1 );
+ main->addWidget( line, 4, 1 );
+ main->addWidget( url, 5, 1 );
+ // resize
+ QFontMetrics fm( title->font() );
+ int width = (int)( fm.width( tlt ) * 1.5 );
+ title->setMinimumWidth( width );
+ setMaximumSize( minimumSize() );
+ }
+ void mousePressEvent( QMouseEvent* )
+ {
+ accept();
+ }
+};
+