-// Copyright (C) 2011-2015 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2011-2021 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
#include "StandardApp_Module.hxx"
+#include "SALOME_GuiServices.hxx"
+
#include <SUIT_Desktop.h>
#include <SUIT_Study.h>
#include <SalomeApp_Application.h>
}
// Creating the action
- QAction * action= this->createAction( effIdentifier, label, actionIcon,
- label, effToolTip, 0, getApp()->desktop(),
- false, slotobject, slotmember);
+ this->createAction( effIdentifier, label, actionIcon,
+ label, effToolTip, 0, getApp()->desktop(),
+ false, slotobject, slotmember);
return effIdentifier;
}
setToolShown( true );
if ( this->createStudyComponentAtActivation() ) {
- this->createStudyComponent(theStudy);
+ this->createStudyComponent();
}
return bOk;
* the module. This component is associated to the engine (return by
* getEngine()) if the engine is a SALOMEDS::Driver.
*/
-void StandardApp_Module::createStudyComponent(SUIT_Study* theStudy) {
+void StandardApp_Module::createStudyComponent() {
- SALOME_NamingService *aNamingService = SalomeApp_Application::namingService();
- CORBA::Object_var aSMObject = aNamingService->Resolve("/myStudyManager");
- SALOMEDS::StudyManager_var aStudyManager = SALOMEDS::StudyManager::_narrow(aSMObject);
- SALOMEDS::Study_var aDSStudy = aStudyManager->GetStudyByID(theStudy->id());
+ SALOMEDS::Study_var aDSStudy = GUI::getStudyServant();
SALOMEDS::SComponent_var aFather = aDSStudy->FindComponent(QCHARSTAR(moduleName()));
if (aFather->_is_nil())