-// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 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
+// 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
#include <SVTK_ViewWindow.h>
#include <SALOME_ListIO.hxx>
+// SALOME KERNEL includes
+#include <SALOMEDSClient_SObject.hxx>
+
// Qt includes
#include <QHBoxLayout>
#include <QVBoxLayout>
SMESHGUI_GroupOpDlg::SMESHGUI_GroupOpDlg( SMESHGUI* theModule )
: QDialog( SMESH::GetDesktop( theModule ) ),
mySMESHGUI( theModule ),
- mySelectionMgr( SMESH::GetSelectionMgr( theModule ) )
+ mySelectionMgr( SMESH::GetSelectionMgr( theModule ) ),
+ myIsApplyAndClose( false )
{
setModal(false);
*/
void SMESHGUI_GroupOpDlg::onOk()
{
+ setIsApplyAndClose( true );
if ( onApply() )
onClose();
+ setIsApplyAndClose( false );
}
/*!
return false;
}
+/*!
+ \brief Set value of the flag indicating that the dialog is
+ accepted by Apply & Close button
+ \param theFlag value of the flag
+ \sa isApplyAndClose()
+*/
+void SMESHGUI_GroupOpDlg::setIsApplyAndClose( const bool theFlag )
+{
+ myIsApplyAndClose = theFlag;
+}
+
+/*!
+ \brief Get value of the flag indicating that the dialog is
+ accepted by Apply & Close button
+ \return value of the flag
+ \sa setApplyAndClose()
+*/
+bool SMESHGUI_GroupOpDlg::isApplyAndClose() const
+{
+ return myIsApplyAndClose;
+}
+
// === === === === === === === === === === === === === === === === === === === === ===
/*!
QString aName = getName();
bool aRes = false;
+ QStringList anEntryList;
try
{
SMESH::ListOfGroups_var aList = convert( myGroups );
if ( !CORBA::is_nil( aNewGrp ) )
{
aNewGrp->SetColor( getColor() );
+ if( _PTR(SObject) aSObject = SMESH::ObjectToSObject( aNewGrp ) )
+ anEntryList.append( aSObject->GetID().c_str() );
aRes = true;
}
}
if ( aRes )
{
+ SMESHGUI::Modified();
getSMESHGUI()->updateObjBrowser(true);
reset();
+ if( LightApp_Application* anApp =
+ dynamic_cast<LightApp_Application*>( SUIT_Session::session()->activeApplication() ) )
+ anApp->browseObjects( anEntryList, isApplyAndClose() );
return true;
}
else
QString aName = getName();
bool aRes = false;
+ QStringList anEntryList;
try
{
SMESH::ListOfGroups_var aList = convert( myGroups );
if ( !CORBA::is_nil( aNewGrp ) )
{
aNewGrp->SetColor( getColor() );
+ if( _PTR(SObject) aSObject = SMESH::ObjectToSObject( aNewGrp ) )
+ anEntryList.append( aSObject->GetID().c_str() );
aRes = true;
}
}
if ( aRes )
{
+ SMESHGUI::Modified();
getSMESHGUI()->updateObjBrowser(true);
reset();
+ if( LightApp_Application* anApp =
+ dynamic_cast<LightApp_Application*>( SUIT_Session::session()->activeApplication() ) )
+ anApp->browseObjects( anEntryList, isApplyAndClose() );
return true;
}
else
QString aName = getName();
bool aRes = false;
+ QStringList anEntryList;
try
{
SMESH::ListOfGroups_var aList1 = convert( myGroups1 );
if ( !CORBA::is_nil( aNewGrp ) )
{
aNewGrp->SetColor( getColor() );
+ if( _PTR(SObject) aSObject = SMESH::ObjectToSObject( aNewGrp ) )
+ anEntryList.append( aSObject->GetID().c_str() );
aRes = true;
}
}
if ( aRes )
{
+ SMESHGUI::Modified();
getSMESHGUI()->updateObjBrowser(true);
reset();
+ if( LightApp_Application* anApp =
+ dynamic_cast<LightApp_Application*>( SUIT_Session::session()->activeApplication() ) )
+ anApp->browseObjects( anEntryList, isApplyAndClose() );
return true;
}
else
: SMESHGUI_GroupOpDlg( theModule )
{
setWindowTitle( tr( "CREATE_GROUP_OF_UNDERLYING_ELEMS" ) );
- setHelpFileName( "creating_groups_page.html#gui_create_dim_group" );
+ setHelpFileName( "group_of_underlying_elements_page.html" );
QGroupBox* anArgGrp = getArgGrp();
QString aName = getName();
bool aRes = false;
+ QStringList anEntryList;
try
{
SMESH::ListOfGroups_var aList = convert( myGroups );
if ( !CORBA::is_nil( aNewGrp ) )
{
aNewGrp->SetColor( getColor() );
+ if( _PTR(SObject) aSObject = SMESH::ObjectToSObject( aNewGrp ) )
+ anEntryList.append( aSObject->GetID().c_str() );
aRes = true;
}
}
if ( aRes )
{
+ SMESHGUI::Modified();
getSMESHGUI()->updateObjBrowser(true);
reset();
+ if( LightApp_Application* anApp =
+ dynamic_cast<LightApp_Application*>( SUIT_Session::session()->activeApplication() ) )
+ anApp->browseObjects( anEntryList, isApplyAndClose() );
return true;
}
else