Salome HOME
0021177: EDF 1563 SMESH: Preview of mesh during a modification
[modules/smesh.git] / src / SMESHGUI / SMESHGUI_MeshDlg.cxx
index a3446f2997310181f4820abfd354d6b942d8e628..d2fb709892f82c193a752c33f770b6f1547b155f 100644 (file)
@@ -1,4 +1,4 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//  Copyright (C) 2007-2010  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 //  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
 //  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
@@ -19,6 +19,7 @@
 //
 //  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 // SMESH SMESHGUI : GUI for SMESH component
 // File   : SMESHGUI_MeshDlg.cxx
 // Author : Sergey LITONIN, Open CASCADE S.A.S.
@@ -478,9 +479,13 @@ void SMESHGUI_MeshDlg::setMaxHypoDim( const int maxDim )
   const int DIM = maxDim;
   for ( int dim = Dim0D; dim <= Dim3D; ++dim ) {
     bool enable = ( dim <= DIM );
-    if ( !enable )
+    if ( !enable ) {
       myTabs[ dim ]->reset();
-    myTabWg->setTabEnabled( myTabWg->indexOf( myTabs[ dim ] ), enable );
+      disableTab( dim );
+    }
+    else {
+      enableTab( dim );
+    }
   }
   // deselect desabled tab
   if ( !myTabWg->isTabEnabled( myTabWg->currentIndex() ) )
@@ -564,6 +569,7 @@ void SMESHGUI_MeshDlg::setGeomPopupEnabled( const bool enable )
 //================================================================================
 void SMESHGUI_MeshDlg::disableTab(const int theTabId) {
   myTabWg->setTabEnabled( myTabWg->indexOf( myTabs[ theTabId ] ), false );
+  if ( theTabId == Dim3D ) myHypoSetButton->setEnabled( false );
 }
 
 //================================================================================
@@ -574,6 +580,10 @@ void SMESHGUI_MeshDlg::disableTab(const int theTabId) {
 //================================================================================
 void SMESHGUI_MeshDlg::enableTab(const int theTabId) {
   myTabWg->setTabEnabled( myTabWg->indexOf( myTabs[ theTabId ] ), true );
+  if ( theTabId == Dim3D ) {
+    QMenu* aHypoSetPopup = myHypoSetButton->menu();
+    myHypoSetButton->setEnabled( aHypoSetPopup && !aHypoSetPopup->actions().isEmpty() );
+  }
 }
 
 //================================================================================