Salome HOME
NRI : Display Component UserName and Icon.
[modules/smesh.git] / src / SMESHGUI / SMESHGUI_StudyAPI.cxx
index ff871b1c5aa8fe55d0cfd6b09f92a84657e75034..6c5fdc5d673c94a37a5e7e035a205fe5a4ac5f52 100644 (file)
@@ -1,18 +1,39 @@
-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: 
 
+using namespace std;
 #include "SMESHGUI_StudyAPI.h"
 #include "utilities.h"
 #include "Utils_ORB_INIT.hxx"
 #include "Utils_SINGLETON.hxx"
 
 #include "QAD_MessageBox.h"
+#include "QAD_Desktop.h"
 #include "QAD_Application.h"
 
 // QT Includes
@@ -84,14 +105,15 @@ SMESHGUI_StudyAPI::SMESHGUI_StudyAPI ( SALOMEDS::Study_ptr aStudy,
   
   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 );
 }