From 6fe5685ae61a0b74e9258de789d80dbe09d244ef Mon Sep 17 00:00:00 2001 From: akl Date: Thu, 25 Sep 2014 10:21:30 +0400 Subject: [PATCH] Send message to GUI that study was created to manage of 'Connect' action availability there. --- src/SALOMEDS/SALOMEDS_Study_i.cxx | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/SALOMEDS/SALOMEDS_Study_i.cxx b/src/SALOMEDS/SALOMEDS_Study_i.cxx index 2bc96b593..200a8b5ac 100644 --- a/src/SALOMEDS/SALOMEDS_Study_i.cxx +++ b/src/SALOMEDS/SALOMEDS_Study_i.cxx @@ -237,6 +237,18 @@ SALOMEDS_Study_i::SALOMEDS_Study_i(SALOMEDSImpl_Study* theImpl, theImpl->setNotifier(_notifier); theImpl->setGenObjRegister( _genObjRegister ); + + // Notify GUI that study was created + SALOME_NamingService *aNamingService = KERNEL::getNamingService(); + CORBA::Object_ptr obj = aNamingService->Resolve("/Kernel/Session"); + SALOME::Session_var aSession = SALOME::Session::_narrow(obj); + if ( !CORBA::is_nil(aSession) ) { + long studyId = aSession->GetActiveStudyId(); + std::stringstream ss; + ss << "studyCreated:" << studyId; + std::string str = ss.str(); + aSession->emitMessageOneWay(str.c_str()); + } } //============================================================================ -- 2.39.2