From: nds Date: Mon, 20 Jul 2015 06:25:04 +0000 (+0300) Subject: Apply action enable state correction. X-Git-Tag: V_1.4.0_beta4~457 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=8a3aaa8971528932753e86f7e9721ca086cd3104;p=modules%2Fshaper.git Apply action enable state correction. Create sketch with a closed contour. Edit sketch, move contour by point. Apply is disabled until the second move. --- diff --git a/src/PartSet/PartSet_SketcherMgr.cpp b/src/PartSet/PartSet_SketcherMgr.cpp index 4c83fb774..5dd9eaf20 100644 --- a/src/PartSet/PartSet_SketcherMgr.cpp +++ b/src/PartSet/PartSet_SketcherMgr.cpp @@ -529,8 +529,13 @@ void PartSet_SketcherMgr::onMouseMoved(ModuleBase_IViewWindow* theWnd, QMouseEve } // the modified state of the current operation should be updated if there are features, which // were changed here - if (isModified) + if (isModified) { aCurrentOperation->onValuesChanged(); + ModuleBase_IWorkshop* anIWorkshop = myModule->workshop(); + XGUI_ModuleConnector* aConnector = dynamic_cast(anIWorkshop); + XGUI_Workshop* aWorkshop = aConnector->workshop(); + aWorkshop->updateCompositeActionState(); + } Events_Loop::loop()->flush(aMoveEvent); // up all move events - to be processed in the solver //Events_Loop::loop()->flush(aUpdateEvent); // up update events - to redisplay presentations diff --git a/src/XGUI/XGUI_Workshop.cpp b/src/XGUI/XGUI_Workshop.cpp index 0fdec6b58..27ef45623 100644 --- a/src/XGUI/XGUI_Workshop.cpp +++ b/src/XGUI/XGUI_Workshop.cpp @@ -857,9 +857,11 @@ void XGUI_Workshop::updateCompositeActionState() // e.g. sketch can be applyed only if at least one nested element create is finished bool aCanUndo = ModelAPI_Session::get()->canUndo(); bool aParentValid = operationMgr()->isParentOperationValid(); + bool aCurrentValid = operationMgr()->currentOperation() && + operationMgr()->currentOperation()->isValid(); QAction* aAcceptAllAct = myActionsMgr->operationStateAction(XGUI_ActionsMgr::AcceptAll); - aAcceptAllAct->setEnabled(aParentValid && aCanUndo); + aAcceptAllAct->setEnabled(aParentValid && (aCanUndo || aCurrentValid)); } void XGUI_Workshop::updateHistory()