#include <SUIT_ResourceMgr.h>
#include <SUIT_Session.h>
#include <SUIT_OverrideCursor.h>
+#include <SUIT_ExceptionHandler.h>
// SALOME Includes
#include "SALOME_LifeCycleCORBA.hxx"
#include <pqPipelineSource.h>
#include <pqActiveObjects.h>
#include <vtkProcessModule.h>
+#include <vtkSMSession.h>
+#include <vtkPVProgressHandler.h>
#include <pqParaViewBehaviors.h>
#include <pqHelpReaction.h>
#include <vtkOutputWindow.h>
return aSComponent;
}
+/*!
+ Clean up function; used to stop ParaView progress events when
+ exception is caught by global exception handler.
+*/
+void paravisCleanUp()
+{
+ if ( pqApplicationCore::instance() ) {
+ pqServer* s = pqApplicationCore::instance()->getActiveServer();
+ if ( s ) s->session()->GetProgressHandler()->CleanupPendingProgress();
+ }
+}
+
/*!
\brief Constructor. Sets the default name for the module.
*/
bool PVGUI_Module::activateModule( SUIT_Study* study )
{
myOldMsgHandler = qInstallMsgHandler(ParavisMessageOutput);
+
+ SUIT_ExceptionHandler::addCleanUpRoutine( paravisCleanUp );
bool isDone = SalomeApp_Module::activateModule( study );
if ( !isDone ) return false;
saveDockWidgetsState();
+ SUIT_ExceptionHandler::removeCleanUpRoutine( paravisCleanUp );
+
if (myOldMsgHandler)
qInstallMsgHandler(myOldMsgHandler);