From 0a7eb0dc2414063e079866c6eb5c87d56f12c74f Mon Sep 17 00:00:00 2001 From: vsv Date: Mon, 18 May 2015 12:58:50 +0300 Subject: [PATCH] Hide disabled features --- src/ModelAPI/ModelAPI_Object.h | 3 +++ src/XGUI/XGUI_Workshop.cpp | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/ModelAPI/ModelAPI_Object.h b/src/ModelAPI/ModelAPI_Object.h index b13420f07..86cb4b51f 100644 --- a/src/ModelAPI/ModelAPI_Object.h +++ b/src/ModelAPI/ModelAPI_Object.h @@ -54,6 +54,9 @@ class ModelAPI_Object /// Request for initialization of data model of the object: adding all attributes virtual void initAttributes() = 0; + /// Returns the feature is disabled or not. + virtual bool isDisabled() const = 0; + /// Called on change of any argument-attribute of this object /// \param theID identifier of changed attribute MODELAPI_EXPORT virtual void attributeChanged(const std::string& theID); diff --git a/src/XGUI/XGUI_Workshop.cpp b/src/XGUI/XGUI_Workshop.cpp index d726e86b2..81604d8aa 100644 --- a/src/XGUI/XGUI_Workshop.cpp +++ b/src/XGUI/XGUI_Workshop.cpp @@ -466,7 +466,7 @@ void XGUI_Workshop::onFeatureRedisplayMsg(const std::shared_ptrdata() || !aObj->data()->isValid(); + bool aHide = !aObj->data() || !aObj->data()->isValid() || aObj->isDisabled(); if (!aHide) { // check that this is not hidden result ResultPtr aRes = std::dynamic_pointer_cast(aObj); aHide = aRes && aRes->isConcealed(); -- 2.39.2