Back to index

salome-gui  6.5.0
SalomeApp_ExitDlg.cxx
Go to the documentation of this file.
00001 // Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
00002 //
00003 // This library is free software; you can redistribute it and/or
00004 // modify it under the terms of the GNU Lesser General Public
00005 // License as published by the Free Software Foundation; either
00006 // version 2.1 of the License.
00007 //
00008 // This library is distributed in the hope that it will be useful,
00009 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00010 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00011 // Lesser General Public License for more details.
00012 //
00013 // You should have received a copy of the GNU Lesser General Public
00014 // License along with this library; if not, write to the Free Software
00015 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
00016 //
00017 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
00018 //
00019 
00020 // File:      SalomeApp_ExitDlg.cxx
00021 // Author:    Margarita KARPUNINA, Open CASCADE S.A.S.
00022 //
00023 #include "SalomeApp_ExitDlg.h"
00024 
00025 #include <QLabel> 
00026 #include <QVBoxLayout> 
00027 #include <QHBoxLayout> 
00028 #include <QGridLayout> 
00029 #include <QPushButton>
00030 #include <QMessageBox>
00031 #include <QCheckBox>
00032 
00039 SalomeApp_ExitDlg::SalomeApp_ExitDlg( QWidget* parent )
00040   : QDialog( parent )
00041 {
00042   setModal( true );
00043   setWindowTitle( tr( "INF_DESK_EXIT" ) );
00044 
00045   QVBoxLayout* m_vbL = new QVBoxLayout( this );
00046   m_vbL->setMargin( 11 );
00047   m_vbL->setSpacing( 6 );
00048 
00049   QLabel* m_lIcon = new QLabel( this );
00050   QPixmap pm = QMessageBox::standardIcon( QMessageBox::Question );
00051   m_lIcon->setPixmap( pm );
00052   m_lIcon->setScaledContents( false );
00053   m_lIcon->setAlignment( Qt::AlignCenter );
00054 
00055   QLabel* m_lDescr = new QLabel( this );
00056   m_lDescr->setText( tr( "QUE_DESK_EXIT" ) );
00057   m_lDescr->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Expanding ) );
00058 
00059   myServersShutdown = new QCheckBox( tr( "SHUTDOWN_SERVERS" ), this );
00060   myServersShutdown->setChecked( true );
00061   
00062   QVBoxLayout* m_vl1 = new QVBoxLayout();
00063   m_vl1->setMargin( 10 ); m_vl1->setSpacing( 16 );
00064   m_vl1->addWidget( m_lDescr );
00065   m_vl1->addWidget( myServersShutdown );
00066 
00067   QHBoxLayout* m_hl1 = new QHBoxLayout();
00068   m_hl1->setMargin( 0 ); m_hl1->setSpacing( 6 );
00069   m_hl1->addWidget( m_lIcon );
00070   m_hl1->addStretch(); 
00071   m_hl1->addLayout( m_vl1 );
00072   m_hl1->addStretch();
00073 
00074   QPushButton* m_pbOk     = new QPushButton( tr( "BUT_OK" ),     this );
00075   QPushButton* m_pbCancel = new QPushButton( tr( "BUT_CANCEL" ), this );
00076 
00077   QGridLayout* m_hl2 = new QGridLayout();
00078   m_hl2->setMargin( 0 ); m_hl2->setSpacing( 6 );
00079   m_hl2->addWidget( m_pbOk, 0, 0 );
00080   m_hl2->setColumnStretch( 1, 5 );
00081   m_hl2->addWidget( m_pbCancel, 0, 2 );
00082   
00083   m_vbL->addStretch();
00084   m_vbL->addLayout( m_hl1 );
00085   m_vbL->addStretch();
00086   m_vbL->addLayout( m_hl2 );
00087 
00088   connect( m_pbOk,     SIGNAL( clicked() ), this, SLOT( accept() ) );
00089   connect( m_pbCancel, SIGNAL( clicked() ), this, SLOT( reject() ) );
00090 }
00091 
00095 SalomeApp_ExitDlg::~SalomeApp_ExitDlg()
00096 {
00097 }
00098 
00102 bool SalomeApp_ExitDlg::isServersShutdown()
00103 {
00104   return myServersShutdown->isChecked();
00105 }
00106