Salome HOME
Merge branch merge_1_2_d
[modules/smesh.git] / src / SMESHGUI / SMESHGUI_StudyAPI.cxx
index 253252f2271cbfd225a353e78c14fb084506b4c6..42e2724d937d2d3b41cb927201cb1a150f50d5b6 100644 (file)
@@ -1,12 +1,32 @@
-using namespace std;
-//  File      : SMESHGUI_StudyAPI.cxx
-//  Created   : Fri May 17 15:23:35 CEST 2002
-//  Author    : Yves FRICAUD 
-//  Project   : SALOME
-//  Module    : SMESH
-//  Copyright : Open CASCADE
+//  SMESH SMESHGUI : GUI for SMESH component
+//
+//  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
+// 
+//  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. 
+// 
+//  This library is distributed in the hope that it will be useful, 
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of 
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
+//  Lesser General Public License for more details. 
+// 
+//  You should have received a copy of the GNU Lesser General Public 
+//  License along with this library; if not, write to the Free Software 
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
+// 
+//  See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org 
+//
+//
+//
+//  File   : SMESHGUI_StudyAPI.cxx
+//  Author : Yves FRICAUD 
+//  Module : SMESH
 //  $Header: 
 
 //  $Header: 
 
+using namespace std;
 #include "SMESHGUI_StudyAPI.h"
 #include "utilities.h"
 #include "Utils_ORB_INIT.hxx"
 #include "SMESHGUI_StudyAPI.h"
 #include "utilities.h"
 #include "Utils_ORB_INIT.hxx"
@@ -69,10 +89,10 @@ SMESHGUI_StudyAPI::SMESHGUI_StudyAPI ( SALOMEDS::Study_ptr aStudy,
 
   // NRI : Temporary added
   if ( myStudy->GetProperties()->IsLocked() ) {
 
   // NRI : Temporary added
   if ( myStudy->GetProperties()->IsLocked() ) {
-    QAD_MessageBox::warn1 ( (QWidget*)QAD_Application::getDesktop(),
-                           QObject::tr("WARNING"), 
-                           QObject::tr("WRN_STUDY_LOCKED"),
-                           QObject::tr("BUT_OK") );
+//    QAD_MessageBox::warn1 ( (QWidget*)QAD_Application::getDesktop(),
+//                         QObject::tr("WARNING"), 
+//                         QObject::tr("WRN_STUDY_LOCKED"),
+//                         QObject::tr("BUT_OK") );
     
     return;
   }
     
     return;
   }
@@ -85,14 +105,15 @@ SMESHGUI_StudyAPI::SMESHGUI_StudyAPI ( SALOMEDS::Study_ptr aStudy,
   
   if (father->_is_nil()) {
     father = myStudyBuilder->NewComponent("MESH");
   
   if (father->_is_nil()) {
     father = myStudyBuilder->NewComponent("MESH");
-    anAttr = myStudyBuilder->FindOrCreateAttribute(father, "AttributeName");
-    aName = SALOMEDS::AttributeName::_narrow(anAttr);
-    //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, "AttributeName");
+  aName = SALOMEDS::AttributeName::_narrow(anAttr);
+  //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" );
+  
   myStudyBuilder->DefineComponentInstance(father, CompMesh );
   mySComponentMesh = SALOMEDS::SComponent::_narrow( father );
 }
   myStudyBuilder->DefineComponentInstance(father, CompMesh );
   mySComponentMesh = SALOMEDS::SComponent::_narrow( father );
 }