Salome HOME
Update copyright information
[modules/smesh.git] / src / SMESHGUI / SMESHGUI_MeshDlg.cxx
index 8544392acc1cc2b66c23f15810177fe97e002bba..b877f7fc076810d2506e1031f3f9ef8df6273fd3 100644 (file)
@@ -1,29 +1,29 @@
-// SMESH SMESHGUI : GUI for SMESH component
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// This library is free software; you can redistribute it and/or 
-// modify it under the terms of the GNU Lesser General Public 
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License. 
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
 //
-// This library is distributed in the hope that it will be useful, 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details. 
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
 //
-// You should have received a copy of the GNU Lesser General Public 
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  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.
-//
-
 // SMESH includes
+//
 #include "SMESHGUI_MeshDlg.h"
 
 // SALOME GUI includes
@@ -484,7 +484,7 @@ void SMESHGUI_MeshDlg::setMaxHypoDim( const int maxDim )
   }
   // deselect desabled tab
   if ( !myTabWg->isTabEnabled( myTabWg->currentIndex() ) )
-    setCurrentTab( DIM - 1 );
+    setCurrentTab( DIM );
 }
 
 //================================================================================
@@ -536,15 +536,21 @@ void SMESHGUI_MeshDlg::setGeomPopupEnabled( const bool enable )
 {
   if ( QToolButton* selBtn = qobject_cast<QToolButton*>( objectWg( Geom, Btn )))
   {
-    disconnect( selBtn, SIGNAL( toggled(bool) ), this, SLOT( onGeomSelectionButton(bool) ));
     if ( enable ) {
       if ( ! myGeomPopup ) {
         myGeomPopup = new QMenu();
         myGeomPopup->addAction( tr("DIRECT_GEOM_SELECTION") )->setData( DIRECT_GEOM_INDEX );
         myGeomPopup->addAction( tr("GEOM_BY_MESH_ELEM_SELECTION") )->setData( GEOM_BY_MESH_INDEX );
         connect( myGeomPopup, SIGNAL( triggered( QAction* ) ), SLOT( onGeomPopup( QAction* ) ) );
+       connect( selBtn, SIGNAL( toggled(bool) ), this, SLOT( onGeomSelectionButton(bool) ));
+      }
+    }
+    else {
+      disconnect( selBtn, SIGNAL( toggled(bool) ), this, SLOT( onGeomSelectionButton(bool) ));
+      if ( myGeomPopup ) {
+       delete myGeomPopup;
+       myGeomPopup = 0;
       }
-      connect( selBtn, SIGNAL( toggled(bool) ), this, SLOT( onGeomSelectionButton(bool) ));
     }
   }
 }