From ae629fcd7e21122781792214f9440f69aecb1517 Mon Sep 17 00:00:00 2001 From: mpv Date: Mon, 8 Jun 2020 13:37:57 +0300 Subject: [PATCH] connectToStudy added to connect the data model of a light module to support dumps and save without activation of the module --- src/LightApp/LightApp_Application.cxx | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/LightApp/LightApp_Application.cxx b/src/LightApp/LightApp_Application.cxx index 5bcbd1598..baf53032e 100644 --- a/src/LightApp/LightApp_Application.cxx +++ b/src/LightApp/LightApp_Application.cxx @@ -4956,7 +4956,7 @@ void LightApp_Application::onDesktopMessage( const QString& message ) if ( !vtype.isEmpty() ) getViewManager( vtype, true ); } - else if ( message.toLower().startsWith("load_module" ) ) { + else if ( message.toLower().startsWith("register_module_in_study" ) ) { QString moduleName = message.split( sectionSeparator ).last(); CAM_Module* mod = module( moduleName ); if ( !mod ) @@ -4965,7 +4965,12 @@ void LightApp_Application::onDesktopMessage( const QString& message ) mod = loadModule( moduleName ); if ( !mod ) mod = loadModule( moduleTitle( moduleName) ); - addModule(mod); + if ( mod ) { + addModule(mod); + CAM_Study* anActiveStudy = dynamic_cast(activeStudy()); + if (anActiveStudy) + mod->connectToStudy(anActiveStudy); + } } } else { -- 2.39.2