X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FSMESHGUI%2FSMESHGUI_MeshDlg.cxx;h=b877f7fc076810d2506e1031f3f9ef8df6273fd3;hb=62c4337c5becb0add8bff676b465f70cc5f4e513;hp=f01212a3d6b55c4c1ed0e1a45c774246e2fee189;hpb=d303154d91eb916a55ac93a372cbdb918aa18d14;p=modules%2Fsmesh.git diff --git a/src/SMESHGUI/SMESHGUI_MeshDlg.cxx b/src/SMESHGUI/SMESHGUI_MeshDlg.cxx index f01212a3d..b877f7fc0 100644 --- a/src/SMESHGUI/SMESHGUI_MeshDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_MeshDlg.cxx @@ -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 @@ -268,7 +268,7 @@ void SMESHGUI_MeshTab::onCreateHyp() QMenu aPopup( this ); QStringList aHypNames = isMainHyp ? - myAvailableHyps[ MainHyp ] : aHypNames = myAvailableHyps[ AddHyp ]; + myAvailableHyps[ MainHyp ] : myAvailableHyps[ AddHyp ]; QList 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( 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) )); } } }