X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FXGUI%2FXGUI_ModuleConnector.cpp;h=13be4aa361df22050eed063136b704e98fc222d1;hb=fc72d43b677baa05ae7fd317346fd8b723b799ed;hp=be83f401c0a653f9f4a03c7b4e6b2cd358273280;hpb=4c74e5b864eef28128e27b3ece944990ca8f3fbe;p=modules%2Fshaper.git diff --git a/src/XGUI/XGUI_ModuleConnector.cpp b/src/XGUI/XGUI_ModuleConnector.cpp index be83f401c..13be4aa36 100644 --- a/src/XGUI/XGUI_ModuleConnector.cpp +++ b/src/XGUI/XGUI_ModuleConnector.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2014-2019 CEA/DEN, EDF R&D +// Copyright (C) 2014-2023 CEA/DEN, EDF R&D // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public @@ -124,19 +124,12 @@ ObjectPtr XGUI_ModuleConnector::findPresentedObject(const AISObjectPtr& theAIS) void XGUI_ModuleConnector::setSelected(const QList& theValues) { - XGUI_Displayer* aDisp = myWorkshop->displayer(); XGUI_ObjectsBrowser* aBrowser = myWorkshop->objectBrowser(); if (theValues.isEmpty()) { 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); } } @@ -225,4 +218,50 @@ QObjectPtrList XGUI_ModuleConnector::displayedObjects() const bool XGUI_ModuleConnector::enableUpdateViewer(bool isEnabled) { return myWorkshop->displayer()->enableUpdateViewer(isEnabled); -} \ No newline at end of file +} + + +void XGUI_ModuleConnector::applyCurrentSelectionModes(const AISObjectPtr& theAIS) +{ + Handle(AIS_InteractiveObject) anIO = theAIS->impl(); + myWorkshop->selectionActivate()->activate(anIO, false); +} + + +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; +} + +void XGUI_ModuleConnector::showHelpPage(const QString& thePage) const +{ + workshop()->showHelpPage(thePage); +}