]> SALOME platform Git repositories - modules/adao.git/commitdiff
Salome HOME
Ajout des icones etats dans l'arbre d'étude (+ gestion activation)
authorAndré Ribes <andre.ribes@edf.fr>
Thu, 24 Feb 2011 15:33:00 +0000 (16:33 +0100)
committerAndré Ribes <andre.ribes@edf.fr>
Thu, 24 Feb 2011 15:33:00 +0000 (16:33 +0100)
doc/resources/ADAO_small_rouge.png [new file with mode: 0644]
doc/resources/ADAO_small_vert.png [new file with mode: 0644]
src/daSalome/daGUI/daGuiImpl/adaoCase.py
src/daSalome/daGUI/daGuiImpl/adaoGuiManager.py
src/daSalome/daGUI/daGuiImpl/adaoModuleHelper.py
src/daSalome/daGUI/daGuiImpl/adaoStudyEditor.py

diff --git a/doc/resources/ADAO_small_rouge.png b/doc/resources/ADAO_small_rouge.png
new file mode 100644 (file)
index 0000000..b600e06
Binary files /dev/null and b/doc/resources/ADAO_small_rouge.png differ
diff --git a/doc/resources/ADAO_small_vert.png b/doc/resources/ADAO_small_vert.png
new file mode 100644 (file)
index 0000000..765f713
Binary files /dev/null and b/doc/resources/ADAO_small_vert.png differ
index c7838943dac54b99cda16cde6ab5c535b8ad55a8..ca2e2c00068a094fde008999e078f59cdb826877 100644 (file)
@@ -37,6 +37,11 @@ class AdaoCase:
 
     self.eficas_editor = None               # Editor object from Eficas
 
+  def isOk(self):
+    if self.eficas_editor.jdc:
+      return self.eficas_editor.jdc.isvalid()
+    return False
+
   def createYACSFile(self):
     rtn = ""
     if (self.filename == ""):
index 88c0caf485ba78e47d173c527b51e55f1d7f2aa9..bce5d318f82ebe8131528b64e5e0bed427b69781 100644 (file)
@@ -121,6 +121,7 @@ class AdaoCaseManager(EficasObserver):
 
   def activate(self):
     self.eficas_manager.setEnabled(True)
+    sgPyQt.activateView(self.eficas_viewId)
     self.harmonizeSelectionFromEficas()
 
   def deactivate(self):
index 6f1af04df40c4b3e10de48cdeb6af7f3e4c646d6..958a1ba54fa4ac8309b6683bdbbe8c24d48a79f3 100644 (file)
@@ -91,6 +91,18 @@ def modulePixmap():
     """
     return "ADAO_small.png"
 
+def studyItemPixmapOk():
+    """
+    Get the reference pixmap for items of this module.
+    """
+    return "ADAO_small_vert.png"
+
+def studyItemPixmapNOk():
+    """
+    Get the reference pixmap for items of this module.
+    """
+    return "ADAO_small_rouge.png"
+
 __verbose__ = None
 def verbose():
     global __verbose__
index aa0dc9adc31943682430122cad904c60d7bcb747..b4d539175a4e6da13fc58ffd7e30e837030d420c 100644 (file)
@@ -66,10 +66,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
 
@@ -84,9 +89,14 @@ def updateItem(salomeStudyId, salomeStudyItem, adaoCase):
       itemName  = salomeStudyItem.GetName()
       itemValue = adaoCase.get_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):
     """