From 525f726ed5116848bcb237e38ed14c5dd5c2eff3 Mon Sep 17 00:00:00 2001 From: vsr Date: Thu, 24 Feb 2011 12:48:47 +0000 Subject: [PATCH] Fix regression in Python modules: second activation of Python module does not activate menus and Python module is not called. --- .../SALOME_PYQT_GUI/SALOME_PYQT_Module.cxx | 8 ++++++++ .../SALOME_PYQT_ModuleLight.cxx | 15 +++++++++++++++ .../SALOME_PYQT_ModuleLight.h | 1 + 3 files changed, 24 insertions(+) diff --git a/src/SALOME_PYQT/SALOME_PYQT_GUI/SALOME_PYQT_Module.cxx b/src/SALOME_PYQT/SALOME_PYQT_GUI/SALOME_PYQT_Module.cxx index a702c2f2a..9c507481e 100644 --- a/src/SALOME_PYQT/SALOME_PYQT_GUI/SALOME_PYQT_Module.cxx +++ b/src/SALOME_PYQT/SALOME_PYQT_GUI/SALOME_PYQT_Module.cxx @@ -148,6 +148,14 @@ QString SALOME_PYQT_Module::engineIOR() const */ bool SALOME_PYQT_Module::activateModule( SUIT_Study* theStudy ) { + // call base implementation + bool res = SalomeApp_Module::activateModule( theStudy ); + + if ( !res ) + return res; + + // internal activation + return activateModuleInternal( theStudy ); } /*! diff --git a/src/SALOME_PYQT/SALOME_PYQT_GUILight/SALOME_PYQT_ModuleLight.cxx b/src/SALOME_PYQT/SALOME_PYQT_GUILight/SALOME_PYQT_ModuleLight.cxx index 675ac783b..0f9746cfa 100644 --- a/src/SALOME_PYQT/SALOME_PYQT_GUILight/SALOME_PYQT_ModuleLight.cxx +++ b/src/SALOME_PYQT/SALOME_PYQT_GUILight/SALOME_PYQT_ModuleLight.cxx @@ -384,6 +384,21 @@ bool SALOME_PYQT_ModuleLight::activateModule( SUIT_Study* theStudy ) if ( !res ) return res; + // internal activation + return activateModuleInternal( theStudy ); +} + +/*! + \brief Perform internal activation of the module. + + The only goal of this function is to extract common functionality + for LightApp_Module and SalomeApp_module classes requried by the + specific architecture aspects of "light" / "full" SALOME modes. + + \sa activateModule() +*/ +bool SALOME_PYQT_ModuleLight::activateModuleInternal( SUIT_Study* theStudy ) +{ // reset the activation status to the default value myLastActivateStatus = true; diff --git a/src/SALOME_PYQT/SALOME_PYQT_GUILight/SALOME_PYQT_ModuleLight.h b/src/SALOME_PYQT/SALOME_PYQT_GUILight/SALOME_PYQT_ModuleLight.h index 1fa012262..fded1b871 100644 --- a/src/SALOME_PYQT/SALOME_PYQT_GUILight/SALOME_PYQT_ModuleLight.h +++ b/src/SALOME_PYQT/SALOME_PYQT_GUILight/SALOME_PYQT_ModuleLight.h @@ -165,6 +165,7 @@ public slots: protected: /* create data model */ virtual CAM_DataModel* createDataModel(); + virtual bool activateModuleInternal( SUIT_Study* ); private: void init( CAM_Application* ); -- 2.39.2