Salome HOME
Debug
[modules/smesh.git] / src / SMESHGUI / SMESHGUI_ExtrusionAlongPathDlg.cxx
index 2131b25e6c403ce886222b302a82541b1ecc1090..0da6cb99a8fc4ce7ef1fb8873ebc2eac2bd27793 100644 (file)
@@ -54,6 +54,8 @@
 #include <LightApp_Application.h>
 #include <LightApp_SelectionMgr.h>
 
+#include <SalomeApp_Notebook.h>
+
 #include <SVTK_ViewWindow.h>
 
 // OCCT includes
@@ -109,6 +111,7 @@ private:
 //=================================================================================
 SMESHGUI_ExtrusionAlongPathDlg::SMESHGUI_ExtrusionAlongPathDlg( SMESHGUI* theModule )
   : QDialog( SMESH::GetDesktop( theModule ) ),
+    SMESHGUI_Helper( theModule ),
     mySMESHGUI( theModule ),
     mySelectionMgr( SMESH::GetSelectionMgr( theModule ) ),
     myFilterDlg( 0 )
@@ -621,7 +624,7 @@ bool SMESHGUI_ExtrusionAlongPathDlg::ClickOnApply()
 
 
     if( retVal == SMESH::SMESH_MeshEditor::EXTR_OK )
-      myMesh->SetParameters( aParameters.join(":").toLatin1().constData() );
+      getNotebook()->setParameters( myMesh, aParameters );
 
     //wc.stop();
     wc.suspend();
@@ -1132,14 +1135,9 @@ int SMESHGUI_ExtrusionAlongPathDlg::GetConstructorId()
 //=======================================================================
 void SMESHGUI_ExtrusionAlongPathDlg::OnAngleAdded()
 {
-  QString msg;
-  if( !AngleSpin->isValid( msg, true ) ) {
-    QString str( tr( "SMESH_INCORRECT_INPUT" ) );
-    if ( !msg.isEmpty() )
-      str += "\n" + msg;
-    SUIT_MessageBox::critical( this, tr( "SMESH_ERROR" ), str );
+  if( !checkParameters( true, 1, AngleSpin ) )
     return;
-  }
+
   AnglesList->addItem(AngleSpin->text());
   myAnglesList.append(AngleSpin->GetValue());
 
@@ -1242,20 +1240,7 @@ void SMESHGUI_ExtrusionAlongPathDlg::setFilters()
 //=================================================================================
 bool SMESHGUI_ExtrusionAlongPathDlg::isValid()
 {
-  QString msg;
-  bool ok = true;
-  ok = XSpin->isValid( msg, true ) && ok;
-  ok = YSpin->isValid( msg, true ) && ok;
-  ok = ZSpin->isValid( msg, true ) && ok;
-
-  if( !ok ) {
-    QString str( tr( "SMESH_INCORRECT_INPUT" ) );
-    if ( !msg.isEmpty() )
-      str += "\n" + msg;
-    SUIT_MessageBox::critical( this, tr( "SMESH_ERROR" ), str );
-    return false;
-  }
-  return true;
+  return checkParameters( true, 3, XSpin, YSpin, ZSpin );
 }
 
 //=================================================================================