From 943ce176c670b2c02b53bb5aacbec3064941aabf Mon Sep 17 00:00:00 2001 From: nds Date: Thu, 9 Jul 2015 11:42:09 +0300 Subject: [PATCH] 1. ExtrusionCut: Apply Sketch button(in tool bar) should be applyed only to the sketch. Correction to update Redo enable state --- src/XGUI/XGUI_Workshop.cpp | 26 ++++++++++++++------------ src/XGUI/XGUI_Workshop.h | 8 ++++---- 2 files changed, 18 insertions(+), 16 deletions(-) diff --git a/src/XGUI/XGUI_Workshop.cpp b/src/XGUI/XGUI_Workshop.cpp index 0f01b6230..875b58e63 100644 --- a/src/XGUI/XGUI_Workshop.cpp +++ b/src/XGUI/XGUI_Workshop.cpp @@ -660,18 +660,7 @@ void XGUI_Workshop::onUndo(int theTimes) aMgr->undo(); } updateCompositeActionState(); -} - -//****************************************************** -void XGUI_Workshop::updateCompositeActionState() -{ - // in order to apply is enabled only if there are modifications in the model - // 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(); - - QAction* aAcceptAllAct = myActionsMgr->operationStateAction(XGUI_ActionsMgr::AcceptAll); - aAcceptAllAct->setEnabled(aParentValid && aCanUndo); + updateCommandStatus(); } //****************************************************** @@ -690,6 +679,7 @@ void XGUI_Workshop::onRedo(int theTimes) for (int i = 0; i < theTimes; ++i) { aMgr->redo(); } + updateCompositeActionState(); updateCommandStatus(); // unblock the viewer update functionality and make update on purpose @@ -852,6 +842,18 @@ void XGUI_Workshop::updateCommandStatus() emit commandStatusUpdated(); } +//****************************************************** +void XGUI_Workshop::updateCompositeActionState() +{ + // in order to apply is enabled only if there are modifications in the model + // 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(); + + QAction* aAcceptAllAct = myActionsMgr->operationStateAction(XGUI_ActionsMgr::AcceptAll); + aAcceptAllAct->setEnabled(aParentValid && aCanUndo); +} + void XGUI_Workshop::updateHistory() { std::list aUndoList = ModelAPI_Session::get()->undoList(); diff --git a/src/XGUI/XGUI_Workshop.h b/src/XGUI/XGUI_Workshop.h index cb7a51dca..92be69c9d 100644 --- a/src/XGUI/XGUI_Workshop.h +++ b/src/XGUI/XGUI_Workshop.h @@ -252,6 +252,10 @@ signals: /// Update of commands status void updateCommandStatus(); + // Update enable state of accept all button. It is enabled if the the parent operation is + // valid and there are modifications in sesstion(undo can be performed). + void updateCompositeActionState(); + /// update history list (undo/redo commands) void updateHistory(); @@ -279,10 +283,6 @@ signals: /// Rebuild data tree void onRebuild(); - // Update enable state of accept all button. It is enabled if the the parent operation is - // valid and there are modifications in sesstion(undo can be performed). - void updateCompositeActionState(); - /// Open preferences dialog box void onPreferences(); -- 2.39.2