Salome HOME
PAL10195: SALOME V2 study with a mesh leads to SIGSEGV of SALOME V3
[modules/smesh.git] / src / StdMeshersGUI / StdMeshersGUI.cxx
index aa7bd34bd3bdf86de5c09256dbb13783696bb87f..fa48527deebd38095f1681559cb3dfb86c824536 100644 (file)
@@ -40,6 +40,8 @@
 #include "SUIT_Desktop.h"
 #include "SUIT_ResourceMgr.h"
 
+#include <SalomeApp_Tools.h>
+
 #include <qobject.h>
 
 #include "utilities.h"
@@ -97,9 +99,16 @@ void StdMeshersGUI_HypothesisCreator::CreateHypothesis
   else
   {
     if ( StdMeshersGUI_Parameters::HasParameters( myHypType ))
-    // Show Dialog for hypothesis creation
-      //StdMeshersGUI_CreateStdHypothesisDlg *aDlg =
-        new StdMeshersGUI_CreateStdHypothesisDlg(myHypType, parent, "");
+    {
+      // Show Dialog for hypothesis creation
+      StdMeshersGUI_CreateStdHypothesisDlg *aDlg =
+          new StdMeshersGUI_CreateStdHypothesisDlg(myHypType, parent, "");
+      /* Move widget on the botton right corner of main widget */
+//       int x, y ;
+//       mySMESHGUI->DefineDlgPosition( aDlg, x, y ) ;
+//       aDlg->move( x, y ) ;
+      aDlg->exec() ; /* displays Dialog */
+    }
     else
       SMESH::CreateHypothesis(myHypType, aHypName, isAlgo); // without GUI
   }
@@ -121,8 +130,18 @@ void StdMeshersGUI_HypothesisCreator::EditHypothesis
   StdMeshersGUI_Parameters::GetParameters( theHyp, paramList );
 
   bool modified = false;
-  if ( SMESHGUI_aParameterDlg::Parameters( paramList, QObject::tr("SMESH_VALUE")) )
-    modified = StdMeshersGUI_Parameters::SetParameters( theHyp, paramList );
+  if ( SMESHGUI_aParameterDlg::Parameters( SMESHGUI::GetSMESHGUI(), paramList, QObject::tr("SMESH_VALUE")) )
+  {
+    try
+    {
+      modified = StdMeshersGUI_Parameters::SetParameters( theHyp, paramList );
+    }
+    catch (const SALOME::SALOME_Exception& S_ex)
+    {
+      SalomeApp_Tools::QtCatchCorbaException(S_ex);
+      return;
+    }    
+  }
 
   if ( modified ) {
     //set new Attribute Comment for hypothesis which parameters were modified