X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FXGUI%2FXGUI_ModuleConnector.cpp;h=b0ee40950c0511083162f829f87ded6aa77b1d55;hb=814a346c0ef4b2625779c5ef96be5ff87980acbb;hp=61bc814f47c7db8fdfb36ce8cc1bc2104faf7868;hpb=3f066c11279ec63c380e4aa491e65649577d314e;p=modules%2Fshaper.git diff --git a/src/XGUI/XGUI_ModuleConnector.cpp b/src/XGUI/XGUI_ModuleConnector.cpp index 61bc814f4..b0ee40950 100644 --- a/src/XGUI/XGUI_ModuleConnector.cpp +++ b/src/XGUI/XGUI_ModuleConnector.cpp @@ -130,13 +130,7 @@ void XGUI_ModuleConnector::setSelected(const QList& the myWorkshop->selector()->clearSelection(); aBrowser->treeView()->clearSelection(); } else { - aDisp->setSelected(theValues); - // Synchronise the selection with Object browser - QObjectPtrList anObjects; - foreach(ModuleBase_ViewerPrsPtr aVal, theValues) { - anObjects.append(aVal->object()); - } - aBrowser->setObjectsSelected(anObjects); + myWorkshop->selector()->setSelected(theValues); } } @@ -232,4 +226,38 @@ void XGUI_ModuleConnector::applyCurrentSelectionModes(const AISObjectPtr& theAIS { Handle(AIS_InteractiveObject) anIO = theAIS->impl(); myWorkshop->selectionActivate()->activate(anIO, false); -} \ No newline at end of file +} + + +void XGUI_ModuleConnector::undo() +{ + myWorkshop->onUndo(); +} + +void XGUI_ModuleConnector::setCancelEnabled(bool toEnable) +{ + XGUI_ActionsMgr* anActionsMgr = workshop()->actionsMgr(); + QAction* aAbortAction = anActionsMgr->operationStateAction(XGUI_ActionsMgr::AbortAll); + QAction* aAbortAllAction = anActionsMgr->operationStateAction(XGUI_ActionsMgr::Abort); + if (aAbortAction) { + aAbortAction->setEnabled(toEnable); + } + if (aAbortAllAction) { + aAbortAllAction->setEnabled(toEnable); + } +} + +bool XGUI_ModuleConnector::isCancelEnabled() const +{ + XGUI_ActionsMgr* anActionsMgr = workshop()->actionsMgr(); + QAction* aAbortAction = anActionsMgr->operationStateAction(XGUI_ActionsMgr::AbortAll); + QAction* aAbortAllAction = anActionsMgr->operationStateAction(XGUI_ActionsMgr::Abort); + bool isEnabled = false; + if (aAbortAction) { + isEnabled = true; + } + if (aAbortAllAction) { + isEnabled &= true; + } + return isEnabled; +}