]> SALOME platform Git repositories - modules/shaper.git/blobdiff - src/PartSet/PartSet_TreeNodes.cpp
Salome HOME
Auto-rebuild management
[modules/shaper.git] / src / PartSet / PartSet_TreeNodes.cpp
index 92d25db69152fea370540718a10e4e6f84b308b3..08e9e3681a3fe8c1f15e5e6ddda9ed6097153687 100644 (file)
@@ -22,6 +22,7 @@
 
 #include <ModuleBase_IconFactory.h>
 #include <ModuleBase_IWorkshop.h>
+#include <ModuleBase_Tools.h>
 
 #include <PartSetPlugin_Part.h>
 
@@ -1184,6 +1185,32 @@ void PartSet_ObjectFolderNode::getFirstAndLastIndex(int& theFirst, int& theLast)
 }
 
 
+QVariant PartSet_ObjectFolderNode::data(int theColumn, int theRole) const
+{
+  const QImage anAditional(":icons/hasWarning.png");
+
+  if ((theRole == Qt::DecorationRole) && (theColumn == 1)) {
+    ObjectPtr aObject;
+    bool aHasWarning = false;
+    foreach(ModuleBase_ITreeNode* aNode, myChildren) {
+      aObject = aNode->object();
+      if (aObject.get()) {
+        ModelAPI_ExecState aState = aObject->data()->execState();
+        if ((aState == ModelAPI_StateExecFailed) || (aState == ModelAPI_StateMustBeUpdated)) {
+          aHasWarning = true;
+          break;
+        }
+      }
+    }
+    if (aHasWarning) {
+      return QIcon(ModuleBase_Tools::composite(":icons/hasWarning.png",
+                                               ":pictures/features_folder.png"));
+    }
+  }
+  return PartSet_ObjectNode::data(theColumn, theRole);
+}
+
+
 //////////////////////////////////////////////////////////////////////////////////
 QVariant PartSet_StepNode::data(int theColumn, int theRole) const
 {