X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FXGUI%2FXGUI_ActionsMgr.cpp;h=8cc05c494a8a75a01b8c96e38c0ecfd844f3d32e;hb=d86c77d1c6210bbe04fbc3e5b00f9e212e1ec930;hp=0d652dceba7eed7cdeba455230e3056d03bc361f;hpb=f3c113af79cf08e90316b2d27303a0a12d93fddc;p=modules%2Fshaper.git diff --git a/src/XGUI/XGUI_ActionsMgr.cpp b/src/XGUI/XGUI_ActionsMgr.cpp index 0d652dceb..8cc05c494 100644 --- a/src/XGUI/XGUI_ActionsMgr.cpp +++ b/src/XGUI/XGUI_ActionsMgr.cpp @@ -29,22 +29,22 @@ void XGUI_ActionsMgr::setActionsDisabled(bool isDisabled) { //Re-enable actions (just restore their state) if (!isDisabled) { + myNestedActions.clear(); restoreCommandState(); return; } //Disable all actions, but caller and unblockable (defined in a xml) saveCommandsState(); - QStringList aSkippedIds; XGUI_Command* aToggledFeature = dynamic_cast(sender()); - aSkippedIds.append(aToggledFeature->unblockableCommands()); - aSkippedIds.append(aToggledFeature->id()); + QString aSkippedId = aToggledFeature->id(); QStringList anActionIdsList = myActions.keys(); foreach(QString eachKey, anActionIdsList) { - if (aSkippedIds.removeAll(eachKey) > 0) { + if (eachKey == aSkippedId) { continue; } myActions[eachKey]->setEnabled(false); } + myNestedActions = aToggledFeature->unblockableCommands(); } void XGUI_ActionsMgr::saveCommandsState() @@ -65,3 +65,10 @@ void XGUI_ActionsMgr::restoreCommandState() myActions[eachKey]->setChecked(false); } } + +void XGUI_ActionsMgr::setNestedActionsEnabled(bool isEnabled) +{ + foreach(QString eachKey, myNestedActions) { + myActions[eachKey]->setEnabled(isEnabled); + } +}