1 // GEOM GEOMGUI : GUI for Geometry component
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.salome-platform.org/ or email : webmaster.salome@opencascade.com
22 // File : GEOMToolsGUI_DeleteDlg.cxx
23 // Author : Dmitry Matveitchev, Open CASCADE S.A.S.
26 #include "GEOMToolsGUI_DeleteDlg.h"
29 #include <QPushButton>
30 #include <QTextBrowser>
31 #include <QStringList>
32 #include <QGridLayout>
36 \param parent parent widget
38 GEOMToolsGUI_DeleteDlg::GEOMToolsGUI_DeleteDlg( QWidget* parent, const QStringList& objects )
42 setObjectName( "GEOMToolsGUI_DeleteDlg" );
44 setWindowTitle( tr( "GEOM_DELETE_OBJECTS" ) );
45 setSizeGripEnabled( true );
47 QGridLayout* topLayout = new QGridLayout( this );
49 topLayout->setSpacing( 6 );
50 topLayout->setMargin( 11 );
52 QLabel* lab = new QLabel( tr( "GEOM_REALLY_DELETE" ).arg( objects.count() ), this );
54 QTextBrowser* viewer = new QTextBrowser( this );
55 viewer->setText( QString( "-%1" ).arg( objects.join( "<br> -" ) ) );
57 QPushButton* buttonYes = new QPushButton( tr( "GEOM_BUT_YES" ), this );
58 QPushButton* buttonNo = new QPushButton( tr( "GEOM_BUT_NO" ), this );
60 topLayout->addWidget( lab, 0, 0, 1, 3 );
61 topLayout->addWidget( viewer, 1, 0, 1, 3 );
62 topLayout->addWidget( buttonYes, 2, 0 );
63 topLayout->addWidget( buttonNo, 2, 2 );
65 /* signals and slots connections */
66 connect( buttonYes, SIGNAL( clicked() ), this, SLOT( accept() ) );
67 connect( buttonNo, SIGNAL( clicked() ), this, SLOT( reject() ) );
70 GEOMToolsGUI_DeleteDlg::~GEOMToolsGUI_DeleteDlg()