2 // File : SALOMEGUI_AboutDlg.cxx
3 // Created : Fri Sep 14 09:56:23 2001
4 // Author : Nicolas REJNERI
7 // Copyright : Open CASCADE
10 #include "SALOMEGUI_AboutDlg.h"
11 #include "QAD_Desktop.h"
12 #include "QAD_Tools.h"
15 #include <qmessagebox.h>
20 SALOMEGUI_AboutDlg::SALOMEGUI_AboutDlg(QWidget* parent, const char* name )
21 : QDialog( parent, name, true, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu )
23 QPalette pal = palette();
25 cg.setColor( QColorGroup::Foreground, Qt::black );
26 cg.setColor( QColorGroup::Button, QColor( 192, 192, 192) );
27 cg.setColor( QColorGroup::Light, Qt::white );
28 cg.setColor( QColorGroup::Midlight, QColor( 223, 223, 223) );
29 cg.setColor( QColorGroup::Dark, QColor( 96, 96, 96) );
30 cg.setColor( QColorGroup::Mid, QColor( 128, 128, 128) );
31 cg.setColor( QColorGroup::Text, Qt::black );
32 cg.setColor( QColorGroup::BrightText, Qt::white );
33 cg.setColor( QColorGroup::ButtonText, Qt::black );
34 cg.setColor( QColorGroup::Base, Qt::white );
35 cg.setColor( QColorGroup::Background, Qt::white );
36 cg.setColor( QColorGroup::Shadow, Qt::black );
37 cg.setColor( QColorGroup::Highlight, QColor( 0, 0, 128) );
38 cg.setColor( QColorGroup::HighlightedText, Qt::white );
40 pal.setInactive( cg );
41 pal.setDisabled( cg );
44 setCaption( tr("ABOUT_TLT") );
45 setSizeGripEnabled( false );
46 QVBoxLayout* SALOMEGUI_AboutDlgLayout = new QVBoxLayout( this );
47 SALOMEGUI_AboutDlgLayout->setSpacing( 6 );
48 SALOMEGUI_AboutDlgLayout->setMargin( 11 );
50 AboutPicLab = new QLabel( this, "AboutPicLab" );
51 AboutPicLab->setFrameStyle( QLabel::Plain | QLabel::Box );
52 QPixmap icon1 ( QAD_Desktop::getResourceManager()->loadPixmap( "CLIENT",
56 if(!QAD_Desktop::getResourceManager()->loadResources( "CLIENT", msg ))
58 QMessageBox::warning( this, tr("WRN_WARNING"), msg, tr ("BUT_OK") );
61 AboutPicLab->setPixmap( icon1 );
62 AboutPicLab->setScaledContents( false );
63 AboutPicLab->setAlignment( AlignCenter );
64 AboutPicLab->installEventFilter(this);
65 SALOMEGUI_AboutDlgLayout->addWidget( AboutPicLab );
67 VersionLab = new QLabel( this, "VersionLab" );
68 VersionLab->setText( tr( "INF_VERSION" ) );
69 VersionLab->setAlignment( AlignCenter );
70 VersionLab->installEventFilter(this);
71 SALOMEGUI_AboutDlgLayout->addWidget( VersionLab );
73 CopyrightLab = new QLabel( this, "CopyrightLab" );
74 CopyrightLab->setText( tr( "INF_COPYRIGHT" ) );
75 CopyrightLab->setAlignment( AlignCenter );
76 CopyrightLab->installEventFilter(this);
77 SALOMEGUI_AboutDlgLayout->addWidget( CopyrightLab );
79 LicenseLab = new QLabel( this, "LicenseLab" );
80 LicenseLab->setText( tr( "INF_LICENSE" ) );
81 LicenseLab->setAlignment( int( QLabel::WordBreak | QLabel::AlignCenter ) );
82 QFont LicenseLabFont( LicenseLab->font() );
83 LicenseLabFont.setPointSize( 10 );
84 LicenseLab->setFont( LicenseLabFont );
85 LicenseLab->setSizePolicy(QSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum));
86 LicenseLab->installEventFilter(this);
87 SALOMEGUI_AboutDlgLayout->addWidget( LicenseLab );
90 setMaximumSize(minimumSize());
92 QAD_Tools::alignWidget(this, parent, AlignCenter);
96 * Destroys the object and frees any allocated resources
98 SALOMEGUI_AboutDlg::~SALOMEGUI_AboutDlg()
100 // no need to delete child widgets, Qt does it all for us
104 * Main event handler. Reimplemented to handle application
107 bool SALOMEGUI_AboutDlg::event( QEvent* ev )
109 bool ret = QDialog::event( ev );
110 if ( ev->type() == QEvent::ApplicationFontChange ) {
111 QFont LicenseLabFont( LicenseLab->font() );
112 LicenseLabFont.setPointSize( 10 );
113 LicenseLab->setFont( LicenseLabFont );
115 else if ( ev->type() == QEvent::MouseButtonRelease ) {
121 bool SALOMEGUI_AboutDlg::eventFilter( QObject* o, QEvent* e)
123 if (e->type() == QEvent::MouseButtonRelease) {
126 return QDialog::eventFilter(o, e);