Salome HOME
Merge branch merge_1_2_d
[modules/smesh.git] / src / SMESHGUI / SMESHGUI_Swig.cxx
index f34629ff6727cfbedfdd4e4b19cb1f25793f0b83..2eace0798fe7e606fb17d09624b7130345aeee14 100644 (file)
@@ -91,17 +91,19 @@ void SMESH_Swig::Init(int studyID)
   SALOMEDS::SComponent_var father = myStudy->FindComponent("MESH");
   
   if (father->_is_nil()) {
   SALOMEDS::SComponent_var father = myStudy->FindComponent("MESH");
   
   if (father->_is_nil()) {
+    bool aLocked = myStudy->GetProperties()->IsLocked();
+    if (aLocked) myStudy->GetProperties()->SetLocked(false);
     father = myStudyBuilder->NewComponent("MESH");
     anAttr = myStudyBuilder->FindOrCreateAttribute(father, "AttributeName");
     aName = SALOMEDS::AttributeName::_narrow(anAttr);
     father = myStudyBuilder->NewComponent("MESH");
     anAttr = myStudyBuilder->FindOrCreateAttribute(father, "AttributeName");
     aName = SALOMEDS::AttributeName::_narrow(anAttr);
-    aName->SetValue(QObject::tr("SMESH_MEN_COMPONENT"));
+    //NRI    aName->SetValue(QObject::tr("SMESH_MEN_COMPONENT"));
+    aName->SetValue( QAD_Application::getDesktop()->getComponentUserName( "SMESH" ) );
     anAttr = myStudyBuilder->FindOrCreateAttribute(father, "AttributePixMap");
     aPixmap = SALOMEDS::AttributePixMap::_narrow(anAttr);
     aPixmap->SetPixMap( "ICON_OBJBROWSER_SMESH" );
     anAttr = myStudyBuilder->FindOrCreateAttribute(father, "AttributePixMap");
     aPixmap = SALOMEDS::AttributePixMap::_narrow(anAttr);
     aPixmap->SetPixMap( "ICON_OBJBROWSER_SMESH" );
+    myStudyBuilder->DefineComponentInstance(father, CompMesh );
+    if (aLocked) myStudy->GetProperties()->SetLocked(true);
   }
   }
-  myStudyBuilder->DefineComponentInstance(father, CompMesh );
-  mySComponentMesh = SALOMEDS::SComponent::_narrow( father );
-
   // Tags definition 
   Tag_HypothesisRoot  = 1;
   Tag_AlgorithmsRoot  = 2;
   // Tags definition 
   Tag_HypothesisRoot  = 1;
   Tag_AlgorithmsRoot  = 2;