]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Apply action enable state correction.
authornds <natalia.donis@opencascade.com>
Mon, 20 Jul 2015 06:25:04 +0000 (09:25 +0300)
committernds <natalia.donis@opencascade.com>
Mon, 20 Jul 2015 06:25:04 +0000 (09:25 +0300)
Create sketch with a closed contour. Edit sketch, move contour by point. Apply is disabled until the second move.

src/PartSet/PartSet_SketcherMgr.cpp
src/XGUI/XGUI_Workshop.cpp

index 4c83fb774ec9348671923f3cba9804f1ca6c1463..5dd9eaf20a7ff8260d453f40dc5e8437ea1d03b4 100644 (file)
@@ -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<XGUI_ModuleConnector*>(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
 
index 0fdec6b580b46c1f65e7dfa28ca97c6e4480134e..27ef45623acef008b35523d72895c2f86583bf35 100644 (file)
@@ -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()