mirror of
https://git.salome-platform.org/gitpub/modules/geom.git
synced 2025-05-31 22:37:48 +05:00
IPAL 17998
This commit is contained in:
parent
e38687399d
commit
5ce47477fd
119
src/GEOMBase/GEOMBase_aWarningDlg.cxx
Normal file
119
src/GEOMBase/GEOMBase_aWarningDlg.cxx
Normal file
@ -0,0 +1,119 @@
|
|||||||
|
// GEOM GEOMGUI : GUI for Geometry component
|
||||||
|
//
|
||||||
|
// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
|
||||||
|
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
|
||||||
|
//
|
||||||
|
// This library is free software; you can redistribute it and/or
|
||||||
|
// modify it under the terms of the GNU Lesser General Public
|
||||||
|
// License as published by the Free Software Foundation; either
|
||||||
|
// version 2.1 of the License.
|
||||||
|
//
|
||||||
|
// This library is distributed in the hope that it will be useful,
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
// Lesser General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU Lesser General Public
|
||||||
|
// License along with this library; if not, write to the Free Software
|
||||||
|
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
//
|
||||||
|
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//
|
||||||
|
// File : GEOMBase_aWarningDlg.cxx
|
||||||
|
// Author : Dmitry Matveitchev
|
||||||
|
// Module : GEOM
|
||||||
|
// $Header: /home/server/cvs/GEOM/GEOM_SRC/src/GEOMBase/GEOMBase_aWarningDlg.cxx
|
||||||
|
|
||||||
|
#include "GEOMBase_aWarningDlg.h"
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <qgroupbox.h>
|
||||||
|
#include <qlabel.h>
|
||||||
|
#include <qpushbutton.h>
|
||||||
|
#include <qlayout.h>
|
||||||
|
#include <qvariant.h>
|
||||||
|
#include <qvalidator.h>
|
||||||
|
#include <qstring.h>
|
||||||
|
#include <qscrollview.h>
|
||||||
|
|
||||||
|
#ifndef WNT
|
||||||
|
using namespace std;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
GEOMBase_aWarningDlg::GEOMBase_aWarningDlg( QWidget* parent, const char* name, const QString theText, int theNum )
|
||||||
|
:QDialog( parent, name )
|
||||||
|
{
|
||||||
|
if(!name)
|
||||||
|
setName( "Warning" );
|
||||||
|
resize(296, 150);
|
||||||
|
setCaption(name); /* appears on the title bar */
|
||||||
|
setSizeGripEnabled(TRUE);
|
||||||
|
|
||||||
|
QGridLayout* topLayout = new QGridLayout(this);
|
||||||
|
topLayout->setSpacing(6);
|
||||||
|
topLayout->setMargin(11);
|
||||||
|
|
||||||
|
QGroupBox* mainGrp = new QGroupBox(this, "mainGrp");
|
||||||
|
mainGrp->setColumnLayout(0, Qt::Vertical);
|
||||||
|
mainGrp->layout()->setSpacing(0);
|
||||||
|
mainGrp->layout()->setMargin(0);
|
||||||
|
|
||||||
|
QGridLayout* mainGrpLayout = new QGridLayout(mainGrp->layout());
|
||||||
|
mainGrpLayout->setAlignment(Qt::AlignTop);
|
||||||
|
mainGrpLayout ->setSpacing(6);
|
||||||
|
mainGrpLayout->setMargin(11);
|
||||||
|
topLayout->addWidget(mainGrp, 0, 0);
|
||||||
|
|
||||||
|
|
||||||
|
QScrollView* viewer = new QScrollView (mainGrp, "viewer");
|
||||||
|
viewer->setResizePolicy( QScrollView::AutoOneFit );
|
||||||
|
QLabel* TextLabel1 = new QLabel(viewer, "TextLabel1");
|
||||||
|
TextLabel1->setText( QObject::tr( "GEOM_REALLY_DELETE" ).arg( theNum ).arg( theText ) );
|
||||||
|
viewer->addChild(TextLabel1);
|
||||||
|
mainGrpLayout->addWidget(viewer, 0, 0);
|
||||||
|
|
||||||
|
//Create Buttons
|
||||||
|
|
||||||
|
QGroupBox* btnGrp = new QGroupBox(this, "btnGrp");
|
||||||
|
btnGrp->setColumnLayout(0, Qt::Vertical);
|
||||||
|
btnGrp->layout()->setSpacing(0);
|
||||||
|
btnGrp->layout()->setMargin(0);
|
||||||
|
QGridLayout* btnGrpLayout = new QGridLayout(btnGrp->layout());
|
||||||
|
btnGrpLayout->setAlignment(Qt::AlignTop);
|
||||||
|
btnGrpLayout->setSpacing(6);
|
||||||
|
btnGrpLayout->setMargin(11);
|
||||||
|
topLayout->addWidget(btnGrp, 1, 0);
|
||||||
|
|
||||||
|
/* No button */
|
||||||
|
myButtonOk = new QPushButton(btnGrp, "buttonOk");
|
||||||
|
myButtonOk->setText(tr("GEOM_BUT_YES"));
|
||||||
|
myButtonOk->setAutoDefault(TRUE);
|
||||||
|
btnGrpLayout->addWidget(myButtonOk, 0, 0);
|
||||||
|
|
||||||
|
btnGrpLayout->addItem(new QSpacerItem(5, 5, QSizePolicy::Expanding, QSizePolicy::Minimum), 0, 1);
|
||||||
|
|
||||||
|
/* Yes button */
|
||||||
|
myButtonCancel = new QPushButton(btnGrp, "buttonCancel");
|
||||||
|
myButtonCancel->setText(tr("GEOM_BUT_NO"));
|
||||||
|
myButtonCancel->setAutoDefault(TRUE);
|
||||||
|
myButtonCancel->setDefault(TRUE);
|
||||||
|
btnGrpLayout->addWidget(myButtonCancel, 0, 2);
|
||||||
|
|
||||||
|
/* signals and slots connections */
|
||||||
|
connect(myButtonOk, SIGNAL(clicked()), this, SLOT(accept()));
|
||||||
|
connect(myButtonCancel, SIGNAL(clicked()), this, SLOT(reject()));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//======================================================================================
|
||||||
|
// function : ~GEOMBase_aWarningDlg() destructor
|
||||||
|
// purpose : Destroys the object and frees any allocated resources
|
||||||
|
//======================================================================================
|
||||||
|
GEOMBase_aWarningDlg::~GEOMBase_aWarningDlg()
|
||||||
|
{
|
||||||
|
// no need to delete child widgets, Qt does it all for us
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
56
src/GEOMBase/GEOMBase_aWarningDlg.h
Normal file
56
src/GEOMBase/GEOMBase_aWarningDlg.h
Normal file
@ -0,0 +1,56 @@
|
|||||||
|
// GEOM GEOMGUI : GUI for Geometry component
|
||||||
|
//
|
||||||
|
// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
|
||||||
|
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
|
||||||
|
//
|
||||||
|
// This library is free software; you can redistribute it and/or
|
||||||
|
// modify it under the terms of the GNU Lesser General Public
|
||||||
|
// License as published by the Free Software Foundation; either
|
||||||
|
// version 2.1 of the License.
|
||||||
|
//
|
||||||
|
// This library is distributed in the hope that it will be useful,
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
// Lesser General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU Lesser General Public
|
||||||
|
// License along with this library; if not, write to the Free Software
|
||||||
|
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
//
|
||||||
|
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//
|
||||||
|
// File : GEOMBase_aWarningDlg.h
|
||||||
|
// Author : Dmitry Matveitchev
|
||||||
|
// Module : GEOM
|
||||||
|
// $Header: /home/server/cvs/GEOM/GEOM_SRC/src/GEOMBase/GEOMBase_aWarningDlg.h
|
||||||
|
|
||||||
|
#ifndef GEOMBase_aWarningDLG_H
|
||||||
|
#define GEOMBase_aWarningDLG_H
|
||||||
|
|
||||||
|
#include <qdialog.h>
|
||||||
|
#include <qwidget.h>
|
||||||
|
|
||||||
|
class QString;
|
||||||
|
class QPushButton;
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// class : GEOMBase_aWarningDlg
|
||||||
|
// purpose :
|
||||||
|
//=================================================================================
|
||||||
|
class GEOMBase_aWarningDlg : public QDialog
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
public:
|
||||||
|
GEOMBase_aWarningDlg( QWidget* parent, const char* name, QString theText, int nb );
|
||||||
|
~GEOMBase_aWarningDlg();
|
||||||
|
|
||||||
|
private:
|
||||||
|
QPushButton* myButtonOk;
|
||||||
|
QPushButton* myButtonCancel;
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
@ -41,17 +41,19 @@ LIB = libGEOMBase.la
|
|||||||
EXPORT_HEADERS= GEOMBase.h \
|
EXPORT_HEADERS= GEOMBase.h \
|
||||||
GEOMBase_Skeleton.h \
|
GEOMBase_Skeleton.h \
|
||||||
GEOMBase_Helper.h \
|
GEOMBase_Helper.h \
|
||||||
|
GEOMBase_aWarningDlg.h \
|
||||||
GEOM_Operation.h
|
GEOM_Operation.h
|
||||||
|
|
||||||
LIB_SRC = GEOMBase.cxx \
|
LIB_SRC = GEOMBase.cxx \
|
||||||
GEOMBase_Skeleton.cxx \
|
GEOMBase_Skeleton.cxx \
|
||||||
GEOMBase_aParameterDlg.cxx \
|
GEOMBase_aParameterDlg.cxx \
|
||||||
|
GEOMBase_aWarningDlg.cxx \
|
||||||
GEOMBase_Helper.cxx \
|
GEOMBase_Helper.cxx \
|
||||||
GEOM_Operation.cxx
|
GEOM_Operation.cxx
|
||||||
|
|
||||||
LIB_MOC = \
|
LIB_MOC = GEOMBase_Skeleton.h \
|
||||||
GEOMBase_Skeleton.h \
|
GEOMBase_aParameterDlg.h \
|
||||||
GEOMBase_aParameterDlg.h
|
GEOMBase_aWarningDlg.h
|
||||||
|
|
||||||
LIB_CLIENT_IDL = SALOME_Exception.idl \
|
LIB_CLIENT_IDL = SALOME_Exception.idl \
|
||||||
SALOMEDS.idl \
|
SALOMEDS.idl \
|
||||||
|
@ -31,6 +31,7 @@
|
|||||||
#include "GeometryGUI.h"
|
#include "GeometryGUI.h"
|
||||||
#include "GEOM_Actor.h"
|
#include "GEOM_Actor.h"
|
||||||
#include "GEOMBase.h"
|
#include "GEOMBase.h"
|
||||||
|
#include "GEOMBase_aWarningDlg.h"
|
||||||
|
|
||||||
#include "GEOM_Operation.h"
|
#include "GEOM_Operation.h"
|
||||||
#include "GEOM_Displayer.h"
|
#include "GEOM_Displayer.h"
|
||||||
@ -315,20 +316,22 @@ void GEOMToolsGUI::OnEditDelete()
|
|||||||
}
|
}
|
||||||
// VSR 17/11/04: check if all objects selected belong to GEOM component <-- finish
|
// VSR 17/11/04: check if all objects selected belong to GEOM component <-- finish
|
||||||
QString aNameList;
|
QString aNameList;
|
||||||
int nbSel = selected.Extent();
|
int nbSel = 0;
|
||||||
for ( SALOME_ListIteratorOfListIO It( selected ); It.More(); It.Next() )
|
for ( SALOME_ListIteratorOfListIO It( selected ); It.More(); It.Next() )
|
||||||
{
|
{
|
||||||
Handle(SALOME_InteractiveObject) io = It.Value();
|
Handle(SALOME_InteractiveObject) io = It.Value();
|
||||||
aNameList.append("\n - ");
|
QString aName = io->getName();
|
||||||
aNameList.append(io->getName());
|
if ( aName != "" && aName.ref(0) != '*') {
|
||||||
|
aNameList.append("\n - " + aName);
|
||||||
|
nbSel++;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( SUIT_MessageBox::warn2( app->desktop(),
|
GEOMBase_aWarningDlg* Dialog = new GEOMBase_aWarningDlg( app->desktop(), QObject::tr( "GEOM_WRN_WARNING" ), aNameList, nbSel);
|
||||||
QObject::tr( "GEOM_WRN_WARNING" ),
|
int r = Dialog->exec();
|
||||||
QObject::tr( "GEOM_REALLY_DELETE" ).arg( nbSel ).arg( aNameList ),
|
|
||||||
QObject::tr( "GEOM_BUT_YES" ),
|
if (!r)
|
||||||
QObject::tr( "GEOM_BUT_NO" ), 1, 0, 0 ) != 1 )
|
return;
|
||||||
return;
|
|
||||||
|
|
||||||
// QAD_Operation* op = new SALOMEGUI_ImportOperation(.....);
|
// QAD_Operation* op = new SALOMEGUI_ImportOperation(.....);
|
||||||
// op->start();
|
// op->start();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user