From: André Ribes Date: Thu, 24 Feb 2011 15:33:00 +0000 (+0100) Subject: Ajout des icones etats dans l'arbre d'étude (+ gestion activation) X-Git-Tag: V6_4_0rc3~77 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=78a97424af2abed074ebec479cbade8b14cda37c;p=modules%2Fadao.git Ajout des icones etats dans l'arbre d'étude (+ gestion activation) --- diff --git a/doc/resources/ADAO_small_rouge.png b/doc/resources/ADAO_small_rouge.png new file mode 100644 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 index 0000000..765f713 Binary files /dev/null and b/doc/resources/ADAO_small_vert.png differ diff --git a/src/daSalome/daGUI/daGuiImpl/adaoCase.py b/src/daSalome/daGUI/daGuiImpl/adaoCase.py index c783894..ca2e2c0 100644 --- a/src/daSalome/daGUI/daGuiImpl/adaoCase.py +++ b/src/daSalome/daGUI/daGuiImpl/adaoCase.py @@ -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 == ""): diff --git a/src/daSalome/daGUI/daGuiImpl/adaoGuiManager.py b/src/daSalome/daGUI/daGuiImpl/adaoGuiManager.py index 88c0caf..bce5d31 100644 --- a/src/daSalome/daGUI/daGuiImpl/adaoGuiManager.py +++ b/src/daSalome/daGUI/daGuiImpl/adaoGuiManager.py @@ -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): diff --git a/src/daSalome/daGUI/daGuiImpl/adaoModuleHelper.py b/src/daSalome/daGUI/daGuiImpl/adaoModuleHelper.py index 6f1af04..958a1ba 100644 --- a/src/daSalome/daGUI/daGuiImpl/adaoModuleHelper.py +++ b/src/daSalome/daGUI/daGuiImpl/adaoModuleHelper.py @@ -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__ diff --git a/src/daSalome/daGUI/daGuiImpl/adaoStudyEditor.py b/src/daSalome/daGUI/daGuiImpl/adaoStudyEditor.py index aa0dc9a..b4d5391 100644 --- a/src/daSalome/daGUI/daGuiImpl/adaoStudyEditor.py +++ b/src/daSalome/daGUI/daGuiImpl/adaoStudyEditor.py @@ -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): """