X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FSMESHGUI%2FSMESHGUI_FilterDlg.cxx;h=baf6c82a65c173fd0c77228e27d31c7442cfb17f;hb=85c0f447729c6ed2f90d83051d79a4d308596a2e;hp=db1157c1def671fdb90df45d46b81581c3ade246;hpb=79b1ac2b6df9117f16f11d444b1f165d477a1813;p=modules%2Fsmesh.git diff --git a/src/SMESHGUI/SMESHGUI_FilterDlg.cxx b/src/SMESHGUI/SMESHGUI_FilterDlg.cxx index db1157c1d..baf6c82a6 100755 --- a/src/SMESHGUI/SMESHGUI_FilterDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_FilterDlg.cxx @@ -1,6 +1,6 @@ -// 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, +// 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 @@ -17,14 +17,13 @@ // 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_FilterDlg.cxx // Author : Sergey LITONIN // Module : SMESH - +// #include "SMESHGUI_FilterDlg.h" #include "SMESHGUI.h" @@ -1797,7 +1796,7 @@ QFrame* SMESHGUI_FilterDlg::createButtonFrame (QWidget* theParent) { QGroupBox* aGrp = new QGroupBox(1, Qt::Vertical, theParent); - myButtons[ BTN_OK ] = new QPushButton(tr("SMESH_BUT_OK" ), aGrp); + myButtons[ BTN_OK ] = new QPushButton(tr("SMESH_BUT_APPLY_AND_CLOSE"), aGrp); myButtons[ BTN_Apply ] = new QPushButton(tr("SMESH_BUT_APPLY"), aGrp); QLabel* aLbl = new QLabel(aGrp); @@ -2189,9 +2188,13 @@ void SMESHGUI_FilterDlg::SetSourceWg (QWidget* theWg) // name : SMESHGUI_FilterDlg::SetGroupIds // Purpose : Set mesh //======================================================================= -void SMESHGUI_FilterDlg::SetMesh (SMESH::SMESH_Mesh_ptr theMesh) +void SMESHGUI_FilterDlg::SetMesh (SMESH::SMESH_Mesh_var theMesh) { myMesh = theMesh; + if ( myMesh->_is_nil() ) { + myButtons[BTN_OK]->setEnabled(false); + myButtons[BTN_Apply]->setEnabled(false); + } } //======================================================================= @@ -2526,6 +2529,14 @@ void SMESHGUI_FilterDlg::onSelectionDone() int aRow, aCol; const SALOME_ListIO& aList = mySelector->StoredIObjects(); + if ( myMesh->_is_nil() && aList.Extent()>0 ) { + myMesh = SMESH::IObjectToInterface(aList.First()); + if ( !(myMesh->_is_nil()) ) { + myButtons[BTN_OK]->setEnabled(true); + myButtons[BTN_Apply]->setEnabled(true); + } + } + if (aList.Extent() != 1 || !myTable->CurrentCell(aRow, aCol) || myTable->GetCriterionType(aRow) != FT_BelongToGeom && @@ -2545,6 +2556,7 @@ void SMESHGUI_FilterDlg::onSelectionDone() } } + //======================================================================= // name : SMESHGUI_FilterDlg::onCriterionChanged // Purpose : SLOT called when cretarion of current row changed. Update selection