]> SALOME platform Git repositories - modules/paravis.git/commitdiff
Salome HOME
Merge from V6_main 19/03/2013
authorvsr <vsr@opencascade.com>
Tue, 19 Mar 2013 16:29:41 +0000 (16:29 +0000)
committervsr <vsr@opencascade.com>
Tue, 19 Mar 2013 16:29:41 +0000 (16:29 +0000)
src/PVGUI/PVGUI_Module.cxx

index fa3cfb7ebd0884bcad05ac4bfe58f3d22551c033..df3f7b7d7f27730d9d718e2df7e6e731179644f6 100644 (file)
 #include <pqActiveObjects.h>
 #include <vtkProcessModule.h>
 #include <vtkSMSession.h>
+#include <vtkPVSession.h>
 #include <vtkPVProgressHandler.h>
 #include <pqParaViewBehaviors.h>
 #include <pqHelpReaction.h>
@@ -531,13 +532,21 @@ void PVGUI_Module::initialize( CAM_Application* app )
     startTimer( 50 );
 
   this->VTKConnect = vtkEventQtSlotConnect::New();
+  
   vtkProcessModule* pm = vtkProcessModule::GetProcessModule();
-
-  this->VTKConnect->Connect(pm, vtkCommand::StartEvent,
-    this, SLOT(onStartProgress()));
-  this->VTKConnect->Connect(pm, vtkCommand::EndEvent,
-    this, SLOT(onEndProgress()));
-
+  if(pm) {
+    vtkPVSession* pvs = dynamic_cast<vtkPVSession*>(pm->GetSession());
+    if(pvs) {
+      vtkPVProgressHandler* ph = pvs->GetProgressHandler();
+      if(ph) {
+       this->VTKConnect->Connect(ph, vtkCommand::StartEvent,
+                                 this, SLOT(onStartProgress()));
+       this->VTKConnect->Connect(ph, vtkCommand::EndEvent,
+                                 this, SLOT(onEndProgress()));
+      }
+    }
+  }
+  
   connect(&pqActiveObjects::instance(),
          SIGNAL(representationChanged(pqRepresentation*)),
          this, SLOT(onRepresentationChanged(pqRepresentation*)));