Salome HOME
Merge from PortingMED3 07Apr11
[modules/smesh.git] / src / SMESHGUI / SMESHGUI_TranslationDlg.cxx
index 5ec665216fa77d72d67e38cbe97dcf641e5abd7f..ccb5eae4da52392fae43e0cc1d538d6fc49e2b4a 100644 (file)
@@ -504,6 +504,7 @@ bool SMESHGUI_TranslationDlg::ClickOnApply()
 
     int actionButton = ActionGroup->checkedId();
     bool makeGroups = ( MakeGroupsCheck->isEnabled() && MakeGroupsCheck->isChecked() );
+    QStringList anEntryList;
     try {
       SUIT_OverrideCursor aWaitCursor;
       SMESH::SMESH_MeshEditor_var aMeshEditor = myMesh->GetMeshEditor();
@@ -543,6 +544,8 @@ bool SMESHGUI_TranslationDlg::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
@@ -555,9 +558,14 @@ bool SMESHGUI_TranslationDlg::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();
@@ -575,6 +583,7 @@ bool SMESHGUI_TranslationDlg::ClickOnApply()
 //=================================================================================
 void SMESHGUI_TranslationDlg::ClickOnOk()
 {
+  setIsApplyAndClose( true );
   if( ClickOnApply() )
     ClickOnCancel();
 }
@@ -1005,6 +1014,7 @@ void SMESHGUI_TranslationDlg::onActionClicked(int button)
     break;
   }
   setNewMeshName();
+  toDisplaySimulation();
 }
 
 //=======================================================================
@@ -1132,7 +1142,8 @@ void SMESHGUI_TranslationDlg::onDisplaySimulation( bool toDisplayPreview ) {
       }
 
       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())