-void XGUI_OperationMgr::validateOperation(ModuleBase_Operation* theOperation)
-{
- //Get operation Id and feature to validate
- QString anOperationId = theOperation->id();
- FeaturePtr aFeature = theOperation->feature();
- //Get validators for the Id
- PluginManagerPtr aMgr = ModelAPI_PluginManager::get();
- ModelAPI_ValidatorsFactory* aFactory = aMgr->validators();
- std::list<ModelAPI_Validator*> aValidators;
- std::list<std::list<std::string> > anArguments;
- aFactory->validators(anOperationId.toStdString(), aValidators, anArguments);
- //
- std::list<ModelAPI_Validator*>::iterator it = aValidators.begin();
- bool isValid = true;
- for (; it != aValidators.end(); it++) {
- const ModelAPI_FeatureValidator* aFeatureValidator =
- dynamic_cast<const ModelAPI_FeatureValidator*>(*it);
- if (!aFeatureValidator)
- continue;
- if (!aFeatureValidator->isValid(aFeature)) {
- isValid = false;
- break;
+void XGUI_OperationMgr::setLockValidating(bool toLock)
+{
+ myIsValidationLock = toLock;
+ onValidateOperation();
+}
+
+void XGUI_OperationMgr::setApplyEnabled(const bool theEnabled)
+{
+ myIsApplyEnabled = theEnabled;
+ emit validationStateChanged(theEnabled);
+}
+
+void XGUI_OperationMgr::updateApplyOfOperations(ModuleBase_Operation* theOperation)
+{
+ if (theOperation)
+ emit nestedStateChanged(theOperation->getDescription()->operationId().toStdString(),
+ theOperation->isValid());
+ else {
+ foreach(ModuleBase_Operation* anOperation, myOperations) {
+ emit nestedStateChanged(anOperation->getDescription()->operationId().toStdString(),
+ anOperation->isValid());