Salome HOME
0021308: Remove hard-coded dependency of the external mesh plugins from the SMESH...
[modules/smesh.git] / src / SMESHGUI / SMESHGUI_Hypotheses.cxx
index 49618fc8b47b5350702a9f25971a39f3fd5cc79d..f94f397852facfefa6fe66fa26232d4da6d9d3ac 100644 (file)
@@ -150,8 +150,10 @@ void SMESHGUI_GenericHypothesisCreator::editHypothesis( SMESH::SMESH_Hypothesis_
     Dlg->show();
     Dlg->resize( Dlg->minimumSizeHint() );
   }
-  else
+  else {
     emit finished( QDialog::Accepted );
+        delete myDlg;
+  }
 }
 
 QFrame* SMESHGUI_GenericHypothesisCreator::buildStdFrame()
@@ -330,18 +332,20 @@ bool SMESHGUI_GenericHypothesisCreator::getStdParamFromDlg( ListOfStdParams& par
     {
       SalomeApp_IntSpinBox* sb = ( SalomeApp_IntSpinBox* )( *anIt );
       item.myValue = sb->value();
+      item.myText = sb->text();
       params.append( item );
     }
     else if( (*anIt)->inherits( "SalomeApp_DoubleSpinBox" ) )
     {
       SalomeApp_DoubleSpinBox* sb = ( SalomeApp_DoubleSpinBox* )( *anIt );
       item.myValue = sb->value();
+      item.myText = sb->text();
       params.append( item );
     }
     else if( (*anIt)->inherits( "QLineEdit" ) )
     {
       QLineEdit* line = ( QLineEdit* )( *anIt );
-      item.myValue = line->text();
+      item.myValue = item.myText = line->text();
       params.append( item );
     }
     else if ( getParamFromCustomWidget( item, *anIt ))
@@ -354,6 +358,16 @@ bool SMESHGUI_GenericHypothesisCreator::getStdParamFromDlg( ListOfStdParams& par
   return res;
 }
 
+QString SMESHGUI_GenericHypothesisCreator::getVariableName(const char* methodName) const
+{
+  SMESH::SMESH_Hypothesis_var h = hypothesis();
+  if ( !h->_is_nil() )
+  {
+    CORBA::String_var aVaribaleName = h->GetVarParameter( methodName );
+    return QString( aVaribaleName.in() );
+  }
+  return QString();
+}
 
 QStringList SMESHGUI_GenericHypothesisCreator::getVariablesFromDlg() const
 {