Salome HOME
Join modifications from branch OCC_development_for_3_2_0a2
[modules/smesh.git] / src / SMESHGUI / SMESHGUI_RemoveElementsDlg.cxx
index 16529726e7d9342c6f2780ce67137bcb1d26b06e..885fd642c5b98e6f26797df9a3fb312a421f1691 100644 (file)
@@ -45,6 +45,7 @@
 #include "SVTK_ViewWindow.h"
 #include "SALOME_ListIO.hxx"
 
+#include "SalomeApp_Tools.h"
 #include "utilities.h"
 
 // OCCT Includes
@@ -218,10 +219,6 @@ void SMESHGUI_RemoveElementsDlg::Init()
   connect(myEditCurrentArgument, SIGNAL(textChanged(const QString&)),
            SLOT(onTextChange(const QString&)));
 
-  /* Move widget on the botton right corner of main widget */
-  int x, y;
-  mySMESHGUI->DefineDlgPosition(this, x, y);
-  this->move(x, y);
   this->show(); /* displays Dialog */
 
   if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
@@ -257,11 +254,16 @@ void SMESHGUI_RemoveElementsDlg::ClickOnApply()
     try {
       SMESH::SMESH_MeshEditor_var aMeshEditor = myMesh->GetMeshEditor();
       aResult = aMeshEditor->RemoveElements(anArrayOfIdeces.inout());
-    } catch (...) {
+    } catch (const SALOME::SALOME_Exception& S_ex) {
+      SalomeApp_Tools::QtCatchCorbaException(S_ex);
+      myEditCurrentArgument->clear();
+    } catch (...){
+      myEditCurrentArgument->clear();
     }
 
     if (aResult) {
       myEditCurrentArgument->clear();
+      mySelector->ClearIndex();
       SMESH::UpdateView();
     }
   }
@@ -285,7 +287,7 @@ void SMESHGUI_RemoveElementsDlg::ClickOnOk()
 //=================================================================================
 void SMESHGUI_RemoveElementsDlg::ClickOnCancel()
 {
-  mySelectionMgr->clearSelected();
+  //mySelectionMgr->clearSelected();
   if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
     aViewWindow->SetSelectionMode(ActorSelection);
   disconnect(mySelectionMgr, 0, this, 0);