From: srn Date: Wed, 22 Jun 2005 11:27:49 +0000 (+0000) Subject: BugID: IPAL9186, Modified method Init. Added a loading SMESHGUI if it hasn't been... X-Git-Tag: T3_0_0_a4~13 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=b2833ae90ea99ce9d705edce80536bfd96b91219;p=modules%2Fsmesh.git BugID: IPAL9186, Modified method Init. Added a loading SMESHGUI if it hasn't been loaded. --- diff --git a/src/SMESHGUI/SMESHGUI_Swig.cxx b/src/SMESHGUI/SMESHGUI_Swig.cxx index 6ed39d3c8..b77d0c177 100644 --- a/src/SMESHGUI/SMESHGUI_Swig.cxx +++ b/src/SMESHGUI/SMESHGUI_Swig.cxx @@ -109,7 +109,19 @@ void SMESH_Swig::Init(int studyID) anAttr = myStudyBuilder->FindOrCreateAttribute(father, "AttributeName"); aName = SALOMEDS::AttributeName::_narrow(anAttr); //NRI aName->SetValue(QObject::tr("SMESH_MEN_COMPONENT")); - aName->SetValue( SMESHGUI::GetSMESHGUI()->moduleName() ); + SMESHGUI* gui = SMESHGUI::GetSMESHGUI(); //SRN: BugID IPAL9186, load a SMESH gui if it hasn't been loaded + if(!gui) { + SalomeApp_Application* app = dynamic_cast(SUIT_Session::session()->activeApplication()); + if(app) { + CAM_Module* module = app->module( "Mesh" ); + if(!module) module = app->loadModule("Mesh"); + gui = dynamic_cast( module ); + } + else { + MESSAGE("Can't find the application"); + } + } //SRN: BugID IPAL9186: end of a fix + aName->SetValue( gui->moduleName() ); anAttr = myStudyBuilder->FindOrCreateAttribute(father, "AttributePixMap"); aPixmap = SALOMEDS::AttributePixMap::_narrow(anAttr); aPixmap->SetPixMap( "ICON_OBJBROWSER_SMESH" );