- if (aId == "UNDO_CMD")
- aCmd->setEnabled(myModule->canUndo());
- else if (aId == "REDO_CMD")
- aCmd->setEnabled(myModule->canRedo());
+ if (aId == "UNDO_CMD") {
+ bool isActionEnabled = false;
+ // if ultimate is true -> using result of operation only, or using OR combination
+ ModuleBase_ModelWidget* anActiveWidget = myOperationMgr->activeWidget();
+ if (anActiveWidget && anActiveWidget->canProcessAction(ActionUndo, isActionEnabled))
+ aCmd->setEnabled(isActionEnabled);
+ else
+ aCmd->setEnabled(myModule->canUndo());
+ }
+ else if (aId == "REDO_CMD") {
+ bool isActionEnabled = false;
+ // if ultimate is true -> using result of operation only, or using OR combination
+ ModuleBase_ModelWidget* anActiveWidget = myOperationMgr->activeWidget();
+ if (anActiveWidget && anActiveWidget->canProcessAction(ActionRedo, isActionEnabled))
+ aCmd->setEnabled(isActionEnabled);
+ else
+ aCmd->setEnabled(myModule->canRedo());
+ }