X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=Examples%2Fcppgui1%2FcppcomposGUI.cxx;h=177b9a67d889989f26cb29bcae340147957b77b0;hb=cc7cc752cd3ec1a65c2453f68fb6df4b996642b1;hp=ec6f48fdea1eb3f36cc937f0c8591720113be1a4;hpb=fc1d6a20160960da2fb38416034ed51eb066253e;p=tools%2Fyacsgen.git diff --git a/Examples/cppgui1/cppcomposGUI.cxx b/Examples/cppgui1/cppcomposGUI.cxx index ec6f48f..177b9a6 100644 --- a/Examples/cppgui1/cppcomposGUI.cxx +++ b/Examples/cppgui1/cppcomposGUI.cxx @@ -1,9 +1,9 @@ -// Copyright (C) 2009-2012 EDF R&D +// Copyright (C) 2009-2022 EDF R&D // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either -// version 2.1 of the License. +// version 2.1 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -24,6 +24,7 @@ #include #include #include +#include #include #include CORBA_CLIENT_HEADER(cppcompos) @@ -100,10 +101,7 @@ bool cppcomposGUI::activateModule( SUIT_Study* theStudy ) setMenuShown( true ); setToolShown( true ); - 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 = KERNEL::getStudyServant(); SALOMEDS::SComponent_var aFather = aDSStudy->FindComponent("cppcompos"); if (aFather->_is_nil()) @@ -117,7 +115,7 @@ bool cppcomposGUI::activateModule( SUIT_Study* theStudy ) aStudyBuilder->DefineComponentInstance(aFather, engine); } CORBA::Boolean valid; - engine->DumpPython(aDSStudy,1,0,valid); + engine->DumpPython(1,0,valid); return bOk; } @@ -135,7 +133,7 @@ bool cppcomposGUI::deactivateModule( SUIT_Study* theStudy ) void cppcomposGUI::OnGetBanner() { // Dialog to get the Name - bool ok = FALSE; + bool ok = false; QString myName = QInputDialog::getText( getApp()->desktop(), "label", "name", QLineEdit::Normal, QString::null, &ok ); if ( ok && !myName.isEmpty())