From 51d945d084a5331ab2e0949ce82732a8824f96eb Mon Sep 17 00:00:00 2001 From: jfa Date: Mon, 10 Jun 2013 08:13:27 +0000 Subject: [PATCH] Mantis issue 0022209: Warn the user when he does a bad selection in the create group dialog --- src/GroupGUI/GroupGUI_GroupDlg.cxx | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/GroupGUI/GroupGUI_GroupDlg.cxx b/src/GroupGUI/GroupGUI_GroupDlg.cxx index dfe16cfb7..2bb576966 100644 --- a/src/GroupGUI/GroupGUI_GroupDlg.cxx +++ b/src/GroupGUI/GroupGUI_GroupDlg.cxx @@ -18,7 +18,6 @@ // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -// // GEOM GEOMGUI : GUI for Geometry component // File : GroupGUI_GroupDlg.cxx @@ -43,9 +42,10 @@ #include #include -#include #include +#include #include +#include #include #include #include @@ -720,7 +720,7 @@ int GroupGUI_GroupDlg::getSelectedSubshapes (TColStd_IndexedMapOfInteger& theMap anEntry.remove(0, index+1); int anIndex = anEntry.toInt(); if (anIndex) - theMapIndex.Add(anIndex); + theMapIndex.Add(anIndex); } else // selection among published shapes { @@ -742,7 +742,11 @@ int GroupGUI_GroupDlg::getSelectedSubshapes (TColStd_IndexedMapOfInteger& theMap for (; anExp.More(); anExp.Next()) { TopoDS_Shape aSubShape = anExp.Current(); int anIndex = aMainMap.FindIndex(aSubShape); - if (anIndex >= 0) { + if (anIndex == 0) { + SUIT_MessageBox::warning(app->desktop(), QObject::tr("WRN_WARNING"), + tr("WRN_NOT_SUBSHAPE")); + } + else { if (subSelectionWay() != ALL_SUBSHAPES && !myMain2InPlaceIndices.IsBound(anIndex)) continue; -- 2.39.2