Salome HOME
BugID IPAL9186: Modified method GetSMESHGen
[modules/smesh.git] / src / SMESHGUI / SMESHGUI.cxx
index e3d8df78712a71c96f9a8da371ae57cde8fec782..2b1da3a9c13cf26b2272c6cafe73671271ba5e4a 100644 (file)
@@ -240,6 +240,8 @@ namespace{
                                QObject::tr("SMESH_BUT_OK"));
          wc.resume();
        }
+
+       SMESHGUI::GetSMESHGUI()->updateObjBrowser();
       }
       catch (const SALOME::SALOME_Exception& S_ex){
        wc.suspend();
@@ -1352,6 +1354,7 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
                              tr("SMESH_WRN_VIEWER_VTK"),
                              tr("SMESH_BUT_OK"));
       }
+      updateObjBrowser();
       break;
     }
 
@@ -1894,6 +1897,7 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
           }
         }
       }
+      updateObjBrowser( true );
       break;
     }
 
@@ -2279,7 +2283,7 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
 
   }
 
-  updateObjBrowser();
+  //updateObjBrowser();
   return true;
 }
 
@@ -2856,7 +2860,7 @@ void SMESHGUI::initialize( CAM_Application* app )
 
   QString aSelCount = QString( "%1 = 1" ).arg( QtxPopupMgr::Selection::defSelCountParam() );
   QString lc = QtxPopupMgr::Selection::defEquality();
-  QString aClient = QString( "%1client in {%2}" ).arg( lc ).arg( "'VTKViewer' 'ObjectBrowser'" );
+  QString aClient = QString( "%1client in {%2}" ).arg( lc ).arg( "'VTKViewer'" );
   QString aType = QString( "%1type in {%2}" ).arg( QtxPopupMgr::Selection::defEquality() ).arg( mesh_group );
   QString aMeshInVTK = aClient + "&&" + aType;// + "&&" + aSelCount;
   
@@ -3073,6 +3077,12 @@ void SMESHGUI::OnGUIEvent()
 
 SMESH::SMESH_Gen_var SMESHGUI::GetSMESHGen()
 {
+   
+  if ( CORBA::is_nil( myComponentSMESH ) )
+    {
+      SMESHGUI aGUI; //SRN BugID: IPAL9186: Create an instance of SMESHGUI to initialize myComponentSMESH
+      return aGUI.myComponentSMESH;
+    }  
   return myComponentSMESH;
 }