--- /dev/null
+// 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
+}
+
+
+
--- /dev/null
+// 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
#include "GeometryGUI.h"
#include "GEOM_Actor.h"
#include "GEOMBase.h"
+#include "GEOMBase_aWarningDlg.h"
#include "GEOM_Operation.h"
#include "GEOM_Displayer.h"
}
// VSR 17/11/04: check if all objects selected belong to GEOM component <-- finish
QString aNameList;
- int nbSel = selected.Extent();
+ int nbSel = 0;
for ( SALOME_ListIteratorOfListIO It( selected ); It.More(); It.Next() )
{
Handle(SALOME_InteractiveObject) io = It.Value();
- aNameList.append("\n - ");
- aNameList.append(io->getName());
+ QString aName = io->getName();
+ if ( aName != "" && aName.ref(0) != '*') {
+ aNameList.append("\n - " + aName);
+ nbSel++;
+ }
}
-
- if ( SUIT_MessageBox::warn2( app->desktop(),
- QObject::tr( "GEOM_WRN_WARNING" ),
- QObject::tr( "GEOM_REALLY_DELETE" ).arg( nbSel ).arg( aNameList ),
- QObject::tr( "GEOM_BUT_YES" ),
- QObject::tr( "GEOM_BUT_NO" ), 1, 0, 0 ) != 1 )
- return;
+
+ GEOMBase_aWarningDlg* Dialog = new GEOMBase_aWarningDlg( app->desktop(), QObject::tr( "GEOM_WRN_WARNING" ), aNameList, nbSel);
+ int r = Dialog->exec();
+
+ if (!r)
+ return;
// QAD_Operation* op = new SALOMEGUI_ImportOperation(.....);
// op->start();