From: Viktor Uzlov Date: Mon, 18 Jul 2022 07:17:31 +0000 (+0300) Subject: bos #30440 [CEA 30439] new salome doesn't clean paraview view in FIELDS X-Git-Tag: V9_9_1b1^0 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=refs%2Fheads%2FV9_9_1_BR;p=modules%2Fmed.git bos #30440 [CEA 30439] new salome doesn't clean paraview view in FIELDS --- 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*);