Salome HOME
53068: Create Mesh dialog box is frozen
[modules/smesh.git] / src / StdMeshersGUI / StdMeshersGUI_StdHypothesisCreator.cxx
index 5f38e7f6c97dc7ef0e720d134f50371934b1ae9a..a9b7782829e37291b4565813acdbd9469c1a5891 100644 (file)
@@ -30,7 +30,6 @@
 #include <SMESHGUI_HypothesesUtils.h>
 #include <SMESHGUI_Utils.h>
 #include <SMESHGUI_GEOMGenUtils.h>
-
 #include <SMESH_TypeFilter.hxx>
 #include <SMESH_NumberFilter.hxx>
 
@@ -47,8 +46,9 @@
 #include <GEOM_wrap.hxx>
 
 // SALOME GUI includes
-#include <SUIT_ResourceMgr.h>
 #include <SUIT_MessageBox.h>
+#include <SUIT_ResourceMgr.h>
+#include <SalomeApp_IntSpinBox.h>
 
 // IDL includes
 #include <SALOMEconfig.h>
@@ -1349,6 +1349,7 @@ void StdMeshersGUI_StdHypothesisCreator::attuneStdWidget (QWidget* w, const int)
     {
       sb->RangeStepAndValidator( VALUE_SMALL, VALUE_MAX, 1.0, "length_precision" );
       sb->setEnabled( !widget< QCheckBox >( 1 )->isChecked() );
+      sb->setMinimumWidth( 150 );
     }
     else if( hypType()=="MaxElementArea" )
     {
@@ -1382,6 +1383,14 @@ void StdMeshersGUI_StdHypothesisCreator::attuneStdWidget (QWidget* w, const int)
       sb->RangeStepAndValidator( VALUE_SMALL, VALUE_MAX, 1.0, "length_precision" );
     }
   }
+  else if ( SalomeApp_IntSpinBox* sb = qobject_cast< SalomeApp_IntSpinBox* >( w ))
+  {
+    if ( hypType().startsWith( "NumberOfLayers" ) ||
+         hypType().startsWith( "ViscousLayers" ))
+    {
+      sb->setMinimum( 1 );
+    }
+  }
 }
 
 //================================================================================
@@ -1617,9 +1626,10 @@ void StdMeshersGUI_StdHypothesisCreator::valueChanged( QWidget* paramWidget)
   }
   else if ( hypType().startsWith( "ViscousLayers" ) && paramWidget->inherits("QButtonGroup"))
   {
-    if ( QLabel* label = getLabel(4) )
+    int widgetNumber = hypType() == "ViscousLayers2D" ? 3 : 4;
+    if ( QLabel* label = getLabel( widgetNumber + 1 ) )
     {
-      bool toIgnore = widget< StdMeshersGUI_RadioButtonsGrpWdg >( 3 )->checkedId();
+      bool toIgnore = widget< StdMeshersGUI_RadioButtonsGrpWdg >( widgetNumber )->checkedId();
       if ( hypType() == "ViscousLayers2D" )
         label->setText( tr( toIgnore ? "SMESH_EDGES_WO_LAYERS" : "SMESH_EDGES_WITH_LAYERS" ));
       else