Salome HOME
Python console has been added for HYDRO module (Bug #22).
[modules/hydro.git] / src / HYDROGUI / HYDROGUI_ObjSelector.cxx
index 04bd20f0c0c4d67f5386a436cfe388b0278763d3..f97212a04ae532b222dc4ef024fcceb7530c43e8 100644 (file)
 #include <QLineEdit>
 #include <QToolButton>
 
-HYDROGUI_ObjSelector::HYDROGUI_ObjSelector( HYDROGUI_Module* theModule, QWidget* theParent )
-: QAbstractButton( theParent ), myModule( theModule )
+HYDROGUI_ObjSelector::HYDROGUI_ObjSelector( HYDROGUI_Module* theModule,
+                                            const ObjectKind theObjectKind,
+                                            QWidget* theParent )
+: QAbstractButton( theParent ),
+  myObjectKind( theObjectKind ),
+  myModule( theModule )
 {
   QHBoxLayout* aLayout = new QHBoxLayout( this );
   aLayout->setMargin( 0 );
@@ -97,7 +101,8 @@ void HYDROGUI_ObjSelector::OnSelectionChanged()
   QString anObjName;
   Handle(HYDROData_Object) anObject = HYDROGUI_Tool::GetSelectedObject( myModule );
   if( !anObject.IsNull() )
-    anObjName = anObject->GetName();
+    if( myObjectKind == KIND_UNKNOWN || myObjectKind == anObject->GetKind() )
+      anObjName = anObject->GetName();
 
   SetName( anObjName );
 }