1 // SALOME SALOMEGUI : implementation of desktop and GUI kernel
3 // Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
6 // This library is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation; either
9 // version 2.1 of the License.
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 // Lesser General Public License for more details.
16 // You should have received a copy of the GNU Lesser General Public
17 // License along with this library; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 // See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
24 // File : SALOMEGUI_AboutDlg.cxx
25 // Author : Nicolas REJNERI
30 #include "SALOMEGUI_AboutDlg.h"
31 #include "QAD_Desktop.h"
32 #include "QAD_Tools.h"
35 #include <qmessagebox.h>
40 SALOMEGUI_AboutDlg::SALOMEGUI_AboutDlg(QWidget* parent, const char* name )
41 : QDialog( parent, name, true, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu )
43 QPalette pal = palette();
45 cg.setColor( QColorGroup::Foreground, Qt::black );
46 cg.setColor( QColorGroup::Button, QColor( 192, 192, 192) );
47 cg.setColor( QColorGroup::Light, Qt::white );
48 cg.setColor( QColorGroup::Midlight, QColor( 223, 223, 223) );
49 cg.setColor( QColorGroup::Dark, QColor( 96, 96, 96) );
50 cg.setColor( QColorGroup::Mid, QColor( 128, 128, 128) );
51 cg.setColor( QColorGroup::Text, Qt::black );
52 cg.setColor( QColorGroup::BrightText, Qt::white );
53 cg.setColor( QColorGroup::ButtonText, Qt::black );
54 cg.setColor( QColorGroup::Base, Qt::white );
55 cg.setColor( QColorGroup::Background, Qt::white );
56 cg.setColor( QColorGroup::Shadow, Qt::black );
57 cg.setColor( QColorGroup::Highlight, QColor( 0, 0, 128) );
58 cg.setColor( QColorGroup::HighlightedText, Qt::white );
60 pal.setInactive( cg );
61 pal.setDisabled( cg );
64 setCaption( tr("ABOUT_TLT") );
65 setSizeGripEnabled( false );
66 QVBoxLayout* SALOMEGUI_AboutDlgLayout = new QVBoxLayout( this );
67 SALOMEGUI_AboutDlgLayout->setSpacing( 6 );
68 SALOMEGUI_AboutDlgLayout->setMargin( 11 );
70 AboutPicLab = new QLabel( this, "AboutPicLab" );
71 AboutPicLab->setFrameStyle( QLabel::Plain | QLabel::Box );
72 QPixmap icon1 ( QAD_Desktop::getResourceManager()->loadPixmap( "CLIENT",
76 if(!QAD_Desktop::getResourceManager()->loadResources( "CLIENT", msg ))
78 QMessageBox::warning( this, tr("WRN_WARNING"), msg, tr ("BUT_OK") );
81 AboutPicLab->setPixmap( icon1 );
82 AboutPicLab->setScaledContents( false );
83 AboutPicLab->setAlignment( AlignCenter );
84 AboutPicLab->installEventFilter(this);
85 SALOMEGUI_AboutDlgLayout->addWidget( AboutPicLab );
87 VersionLab = new QLabel( this, "VersionLab" );
88 VersionLab->setText( tr( "INF_VERSION" ) );
89 VersionLab->setAlignment( AlignCenter );
90 VersionLab->installEventFilter(this);
91 SALOMEGUI_AboutDlgLayout->addWidget( VersionLab );
93 CopyrightLab = new QLabel( this, "CopyrightLab" );
94 CopyrightLab->setText( tr( "INF_COPYRIGHT" ) );
95 CopyrightLab->setAlignment( AlignCenter );
96 CopyrightLab->installEventFilter(this);
97 SALOMEGUI_AboutDlgLayout->addWidget( CopyrightLab );
99 LicenseLab = new QLabel( this, "LicenseLab" );
100 LicenseLab->setText( tr( "INF_LICENSE" ) );
101 LicenseLab->setAlignment( int( QLabel::WordBreak | QLabel::AlignCenter ) );
102 QFont LicenseLabFont( LicenseLab->font() );
103 LicenseLabFont.setPointSize( 10 );
104 LicenseLab->setFont( LicenseLabFont );
105 LicenseLab->setSizePolicy(QSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum));
106 LicenseLab->installEventFilter(this);
107 SALOMEGUI_AboutDlgLayout->addWidget( LicenseLab );
108 LicenseLab->polish();
110 setMaximumSize(minimumSize());
112 QAD_Tools::alignWidget(this, parent, AlignCenter);
116 * Destroys the object and frees any allocated resources
118 SALOMEGUI_AboutDlg::~SALOMEGUI_AboutDlg()
120 // no need to delete child widgets, Qt does it all for us
124 * Main event handler. Reimplemented to handle application
127 bool SALOMEGUI_AboutDlg::event( QEvent* ev )
129 bool ret = QDialog::event( ev );
130 if ( ev->type() == QEvent::ApplicationFontChange ) {
131 QFont LicenseLabFont( LicenseLab->font() );
132 LicenseLabFont.setPointSize( 10 );
133 LicenseLab->setFont( LicenseLabFont );
135 else if ( ev->type() == QEvent::MouseButtonRelease ) {
141 bool SALOMEGUI_AboutDlg::eventFilter( QObject* o, QEvent* e)
143 if (e->type() == QEvent::MouseButtonRelease) {
146 return QDialog::eventFilter(o, e);