Salome HOME
Merge from PortingMED3 07Apr11
[modules/smesh.git] / src / SMESHGUI / SMESHGUI_SymmetryDlg.cxx
index e0437bd8e45504312fb173a1a066f34d8531bb27..3d93e13d5aed3f4987f727a9cfffb0a46d36bf9c 100644 (file)
@@ -494,7 +494,7 @@ bool SMESHGUI_SymmetryDlg::ClickOnApply()
 
     int actionButton = ActionGroup->checkedId();
     bool makeGroups = ( MakeGroupsCheck->isEnabled() && MakeGroupsCheck->isChecked() );
-
+    QStringList anEntryList;
     try {
       SUIT_OverrideCursor aWaitCursor;
       SMESH::SMESH_MeshEditor_var aMeshEditor = myMesh->GetMeshEditor();
@@ -538,6 +538,8 @@ bool SMESHGUI_SymmetryDlg::ClickOnApply()
                                              LineEditNewMesh->text().toLatin1().data());
         if (!mesh->_is_nil()) {
           mesh->SetParameters(aParameters.join(":").toLatin1().constData());
+          if( _PTR(SObject) aSObject = SMESH::ObjectToSObject( mesh ) )
+            anEntryList.append( aSObject->GetID().c_str() );
 #ifdef WITHGENERICOBJ
           // obj has been published in study. Its refcount has been incremented.
           // It is safe to decrement its refcount
@@ -552,9 +554,13 @@ bool SMESHGUI_SymmetryDlg::ClickOnApply()
     }
 
     SMESH::UpdateView();
-    if ( MakeGroupsCheck->isEnabled() && MakeGroupsCheck->isChecked() ||
-         actionButton == MAKE_MESH_BUTTON )
+    if ( ( MakeGroupsCheck->isEnabled() && MakeGroupsCheck->isChecked() ) ||
+         actionButton == MAKE_MESH_BUTTON ) {
       mySMESHGUI->updateObjBrowser(true); // new groups may appear
+      if( LightApp_Application* anApp =
+          dynamic_cast<LightApp_Application*>( SUIT_Session::session()->activeApplication() ) )
+        anApp->browseObjects( anEntryList, isApplyAndClose() );
+    }
     Init(false);
     ConstructorsClicked(GetConstructorId());
     mySelectedObject = SMESH::SMESH_IDSource::_nil();
@@ -571,6 +577,7 @@ bool SMESHGUI_SymmetryDlg::ClickOnApply()
 //=================================================================================
 void SMESHGUI_SymmetryDlg::ClickOnOk()
 {
+  setIsApplyAndClose( true );
   if( ClickOnApply() )
     ClickOnCancel();
 }
@@ -1155,7 +1162,8 @@ void SMESHGUI_SymmetryDlg::onDisplaySimulation( bool toDisplayPreview ) {
       getMirror(aMirror,aMirrorType);
 
       try {
-        bool copy = ActionGroup->checkedId() == COPY_ELEMS_BUTTON;
+        bool copy = ( ActionGroup->checkedId() == COPY_ELEMS_BUTTON ||
+                      ActionGroup->checkedId() == MAKE_MESH_BUTTON );
         SUIT_OverrideCursor aWaitCursor;
         SMESH::SMESH_MeshEditor_var aMeshEditor = myMesh->GetMeshEditPreviewer();
         if(CheckBoxMesh->isChecked())