Salome HOME
Correction for Qt5/Eficas/Adao/Salome embedded frames compatibility
[modules/adao.git] / src / daSalome / daGUI / daGuiImpl / adaoStudyEditor.py
index 3bb857afd770b673c8d1a2c6d4af8480944c3205..e04b63c09392c41d73b403353ca3cb2eb5ad600f 100644 (file)
@@ -1,31 +1,32 @@
 # -*- coding: utf-8 -*-
-#  Copyright (C) 2010 EDF R&D
+# Copyright (C) 2008-2016 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
-#  License as published by the Free Software Foundation; either
-#  version 2.1 of the License.
+# This file is part of SALOME ADAO module
 #
-#  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.
+# 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.
 #
-#  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
+# 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.
 #
-#  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+# 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.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
 
 __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 +67,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
 
@@ -77,16 +83,21 @@ def updateItem(salomeStudyId, salomeStudyItem, adaoCase):
 
     studyEditor = studyedit.getStudyEditor(salomeStudyId)
 
-    if salomeStudyItem.GetName()[:-2] != adaoCase.get_name():
-      itemName  = adaoCase.get_name()
-      itemValue = adaoCase.get_filename()
+    if salomeStudyItem.GetName()[:-2] != adaoCase.name:
+      itemName  = adaoCase.name
+      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):
     """