1 // Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
3 // Copyright (C) 2003-2007 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.salome-platform.org/ or email : webmaster.salome@opencascade.com
22 // File: SalomeApp_ExitDlg.cxx
23 // Author: Margarita KARPUNINA, Open CASCADE S.A.S.
25 #include "SalomeApp_ExitDlg.h"
28 #include <QVBoxLayout>
29 #include <QHBoxLayout>
30 #include <QGridLayout>
31 #include <QPushButton>
32 #include <QMessageBox>
36 * \brief creates a Exit dialog box
37 * \param parent a parent widget
38 * \param modal bool argument, if true the dialog box is a modal dialog box
39 * \param f style flags
41 SalomeApp_ExitDlg::SalomeApp_ExitDlg( QWidget* parent )
45 setWindowTitle( tr( "INF_DESK_EXIT" ) );
47 QVBoxLayout* m_vbL = new QVBoxLayout( this );
48 m_vbL->setMargin( 11 );
49 m_vbL->setSpacing( 6 );
51 QLabel* m_lIcon = new QLabel( this );
52 QPixmap pm = QMessageBox::standardIcon( QMessageBox::Question );
53 m_lIcon->setPixmap( pm );
54 m_lIcon->setScaledContents( false );
55 m_lIcon->setAlignment( Qt::AlignCenter );
57 QLabel* m_lDescr = new QLabel( this );
58 m_lDescr->setText( tr( "QUE_DESK_EXIT" ) );
59 m_lDescr->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Expanding ) );
61 myServersShutdown = new QCheckBox( tr( "SHUTDOWN_SERVERS" ), this );
62 myServersShutdown->setChecked( true );
64 QVBoxLayout* m_vl1 = new QVBoxLayout();
65 m_vl1->setMargin( 10 ); m_vl1->setSpacing( 16 );
66 m_vl1->addWidget( m_lDescr );
67 m_vl1->addWidget( myServersShutdown );
69 QHBoxLayout* m_hl1 = new QHBoxLayout();
70 m_hl1->setMargin( 0 ); m_hl1->setSpacing( 6 );
71 m_hl1->addWidget( m_lIcon );
73 m_hl1->addLayout( m_vl1 );
76 QPushButton* m_pbOk = new QPushButton( tr( "BUT_OK" ), this );
77 QPushButton* m_pbCancel = new QPushButton( tr( "BUT_CANCEL" ), this );
79 QGridLayout* m_hl2 = new QGridLayout();
80 m_hl2->setMargin( 0 ); m_hl2->setSpacing( 6 );
81 m_hl2->addWidget( m_pbOk, 0, 0 );
82 m_hl2->setColumnStretch( 1, 5 );
83 m_hl2->addWidget( m_pbCancel, 0, 2 );
86 m_vbL->addLayout( m_hl1 );
88 m_vbL->addLayout( m_hl2 );
90 connect( m_pbOk, SIGNAL( clicked() ), this, SLOT( accept() ) );
91 connect( m_pbCancel, SIGNAL( clicked() ), this, SLOT( reject() ) );
97 SalomeApp_ExitDlg::~SalomeApp_ExitDlg()
102 * \brief get the check box status
104 bool SalomeApp_ExitDlg::isServersShutdown()
106 return myServersShutdown->isChecked();