From 7d64007f4f54b8a347acc7d0c8e4b5e7d34bd7ea Mon Sep 17 00:00:00 2001 From: vsr Date: Tue, 19 Mar 2013 16:29:41 +0000 Subject: [PATCH] Merge from V6_main 19/03/2013 --- src/PVGUI/PVGUI_Module.cxx | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/src/PVGUI/PVGUI_Module.cxx b/src/PVGUI/PVGUI_Module.cxx index fa3cfb7e..df3f7b7d 100644 --- a/src/PVGUI/PVGUI_Module.cxx +++ b/src/PVGUI/PVGUI_Module.cxx @@ -103,6 +103,7 @@ #include #include #include +#include #include #include #include @@ -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(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*))); -- 2.39.2