Salome HOME
0020045: EDF 852 SMESH: Documention of Projection algorithms
[modules/smesh.git] / src / SMESHGUI / SMESHGUI_MeshDlg.cxx
index f01212a3d6b55c4c1ed0e1a45c774246e2fee189..efa644e5675b216e835b3ce086aa2bf18f9d9c83 100644 (file)
@@ -268,7 +268,7 @@ void SMESHGUI_MeshTab::onCreateHyp()
   QMenu aPopup( this );
   
   QStringList aHypNames = isMainHyp ? 
-    myAvailableHyps[ MainHyp ] : aHypNames = myAvailableHyps[ AddHyp ];
+    myAvailableHyps[ MainHyp ] : myAvailableHyps[ AddHyp ];
 
   QList<QAction*> actions;
   for ( int i = 0, n = aHypNames.count(); i < n; i++ )
@@ -353,6 +353,7 @@ SMESHGUI_MeshDlg::SMESHGUI_MeshDlg( const bool theToCreate, const bool theIsMesh
 {
   // Create top controls
 
+  setObjectPixmap( "SMESH", tr( "ICON_SELECT" ) );
   // name 
   createObject( tr( "NAME" ), mainFrame(), Obj );
   setNameIndication( Obj, OneName );
@@ -379,6 +380,8 @@ SMESHGUI_MeshDlg::SMESHGUI_MeshDlg( const bool theToCreate, const bool theIsMesh
   myHypoSetButton = new QToolButton( mainFrame() );
   myHypoSetButton->setText( tr( "HYPOTHESES_SETS" ) );
   myHypoSetButton->setEnabled( false );
+  myHypoSetButton->setSizePolicy( QSizePolicy::MinimumExpanding, 
+                                 myHypoSetButton->sizePolicy().verticalPolicy() );
   
   // Fill layout
   QGridLayout* aLay = new QGridLayout( mainFrame() );
@@ -481,7 +484,7 @@ void SMESHGUI_MeshDlg::setMaxHypoDim( const int maxDim )
   }
   // deselect desabled tab
   if ( !myTabWg->isTabEnabled( myTabWg->currentIndex() ) )
-    setCurrentTab( DIM - 1 );
+    setCurrentTab( DIM );
 }
 
 //================================================================================
@@ -533,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) ));
     }
   }
 }