Salome HOME
Merge branch 'V7_main'
[modules/adao.git] / src / daSalome / daGUI / daGuiImpl / adaoStudyEditor.py
index aa0dc9adc31943682430122cad904c60d7bcb747..3e7df28097d044dab66bc579d7e8f1a50fd1c5f5 100644 (file)
@@ -1,5 +1,5 @@
 # -*- coding: utf-8 -*-
-#  Copyright (C) 2010 EDF R&D
+#  Copyright (C) 2010-2013 EDF R&D
 #
 #  This library is free software; you can redistribute it and/or
 #  modify it under the terms of the GNU Lesser General Public
 
 __author__="aribes/gboulant"
 
-from enumerate import Enumerate
+from daUtils.enumerate import Enumerate
 
 from salome.kernel import studyedit
 
 import adaoModuleHelper
-from daGuiImpl.adaoCase import AdaoCase
 
 #
 # ==============================================================================
@@ -66,10 +65,15 @@ def addInStudy(salomeStudyId, adaoCase):
     itemValue = adaoCase.filename
     itemType  = ADAO_ITEM_TYPES.ADAO_CASE
 
+    icon = adaoModuleHelper.studyItemPixmapNOk()
+    if adaoCase.isOk():
+      icon = adaoModuleHelper.studyItemPixmapOk()
+
     salomeStudyItem = studyEditor.createItem(
         adaoRootEntry, itemName,
         comment = itemValue,
-        typeId  = itemType)
+        typeId  = itemType,
+        icon    = icon)
 
     return salomeStudyItem
 
@@ -82,11 +86,16 @@ def updateItem(salomeStudyId, salomeStudyItem, adaoCase):
       itemValue = adaoCase.filename
     else:
       itemName  = salomeStudyItem.GetName()
-      itemValue = adaoCase.get_filename()
+      itemValue = adaoCase.filename
+
+    icon = adaoModuleHelper.studyItemPixmapNOk()
+    if adaoCase.isOk():
+      icon = adaoModuleHelper.studyItemPixmapOk()
 
     studyEditor.setItem(salomeStudyItem,
         name    = itemName,
-        comment = itemValue)
+        comment = itemValue,
+        icon    = icon)
 
 def removeItem(salomeStudyId, item):
     """