From e14b6ab9f409fe42f5c210582b1520e213eb3e8c Mon Sep 17 00:00:00 2001 From: Viktor Uzlov Date: Mon, 18 Jul 2022 10:17:31 +0300 Subject: [PATCH] bos #30440 [CEA 30439] new salome doesn't clean paraview view in FIELDS --- src/MEDCalc/gui/MEDModule.cxx | 8 ++++++++ src/MEDCalc/gui/MEDModule.hxx | 1 + src/MEDCalc/gui/PresentationController.cxx | 9 ++++++++- src/MEDCalc/gui/PresentationController.hxx | 2 ++ 4 files changed, 19 insertions(+), 1 deletion(-) diff --git a/src/MEDCalc/gui/MEDModule.cxx b/src/MEDCalc/gui/MEDModule.cxx index 3abeeb69d..0042ad52d 100644 --- a/src/MEDCalc/gui/MEDModule.cxx +++ b/src/MEDCalc/gui/MEDModule.cxx @@ -313,6 +313,14 @@ MEDModule::deactivateModule( SUIT_Study* theStudy ) return SalomeApp_Module::deactivateModule( theStudy ); } +void MEDModule::studyClosed(SUIT_Study* study) +{ + STDLOG("MEDModule::studyClosed()"); + _presentationController->resetPVSession(); + + SalomeApp_Module::studyClosed(study); +} + // // ===================================================================== // This part add custom widgets (a dockwidget containing a tree view diff --git a/src/MEDCalc/gui/MEDModule.hxx b/src/MEDCalc/gui/MEDModule.hxx index 832bd66b8..af08df25b 100644 --- a/src/MEDCalc/gui/MEDModule.hxx +++ b/src/MEDCalc/gui/MEDModule.hxx @@ -109,6 +109,7 @@ signals: public slots: virtual bool activateModule(SUIT_Study* theStudy); virtual bool deactivateModule(SUIT_Study* theStudy); + virtual void studyClosed( SUIT_Study* theStudy); virtual void onDblClick(const QModelIndex& index); virtual void onClick(const QModelIndex& index); diff --git a/src/MEDCalc/gui/PresentationController.cxx b/src/MEDCalc/gui/PresentationController.cxx index 9ce5b777c..c7f12753e 100644 --- a/src/MEDCalc/gui/PresentationController.cxx +++ b/src/MEDCalc/gui/PresentationController.cxx @@ -1011,4 +1011,11 @@ void PresentationController::updateVisibilityState(long presId) std::string PresentationController::presentationName2Type(const std::string& name) { return std::regex_replace(name, std::regex("MEDPresentation"), std::string("")); -} \ No newline at end of file +} + +void PresentationController::resetPVSession() +{ + QStringList commands; + commands += QString("pvs.ResetSession()"); + _consoleDriver->exec(commands); +} diff --git a/src/MEDCalc/gui/PresentationController.hxx b/src/MEDCalc/gui/PresentationController.hxx index f65b8b9fb..5635a3504 100644 --- a/src/MEDCalc/gui/PresentationController.hxx +++ b/src/MEDCalc/gui/PresentationController.hxx @@ -62,6 +62,8 @@ public: void emitPresentationSignal(const PresentationEvent* event); + void resetPVSession(); + signals: void presentationSignal(const PresentationEvent*); -- 2.39.2