myFeatureId = theData->featureId();
myIsInternal = theData->getBooleanAttribute(ATTR_INTERNAL, false);
+ myUseExternalParts = theData->getBooleanAttribute("allow_parts_content", false);
myIsModifiedInEdit = theData->getProperty(ATTR_MODIFIED_IN_EDIT);
virtual bool isReadOnly() const { return !isEnabled(); }
+ /// Returns true if the widget should have access to external parts
+ bool canUseExternalParts() const { return myUseExternalParts; }
+
signals:
/// The signal about widget values are to be changed
void beforeValuesChanged();
bool myFlushUpdateBlocked;
bool myUpdateVisualAttributes;
+
+ /// A flag which indicates that current widget should have access to external parts
+ bool myUseExternalParts;
};
#endif
#include "ModuleBase_ViewerFilters.h"
#include "ModuleBase_IWorkshop.h"
#include "ModuleBase_IModule.h"
+#include "ModuleBase_Operation.h"
+#include "ModuleBase_IPropertyPanel.h"
+#include "ModuleBase_ModelWidget.h"
#include <ModelAPI_Session.h>
#include <ModelAPI_Document.h>
if (aObj) {
DocumentPtr aDoc = aObj->document();
SessionPtr aMgr = ModelAPI_Session::get();
- // TODO: disable the next line for the ImportResult feature "objects" widget only
- aValid = (aDoc == aMgr->activeDocument() || aDoc == aMgr->moduleDocument());
+
+ ModuleBase_ModelWidget* aWidget = anOperation->propertyPanel()->activeWidget();
+ if (aWidget && aWidget->canUseExternalParts())
+ aValid = Standard_True;
+ else
+ aValid = (aDoc == aMgr->activeDocument() || aDoc == aMgr->moduleDocument());
}
else {
// This object is not controlled by the filter