X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2FXGUI%2FXGUI_Workshop.cpp;h=b5b0b5f6baeeb50b95d9cd621859c12dd4d9cfdf;hb=47c18d4de2719126f6b045b5c37525cd8f170aa1;hp=c6b5f55bdba54bdae36878bed97f64a6cbe8613a;hpb=1ae46761293cceffc4e65b851da944b0de81ef8e;p=modules%2Fshaper.git diff --git a/src/XGUI/XGUI_Workshop.cpp b/src/XGUI/XGUI_Workshop.cpp index c6b5f55bd..b5b0b5f6b 100644 --- a/src/XGUI/XGUI_Workshop.cpp +++ b/src/XGUI/XGUI_Workshop.cpp @@ -10,6 +10,7 @@ #include "XGUI_Viewer.h" #include "ModuleBase_WidgetFactory.h" #include "XGUI_SelectionMgr.h" +#include "XGUI_Selection.h" #include "XGUI_ObjectsBrowser.h" #include "XGUI_Displayer.h" #include "XGUI_OperationMgr.h" @@ -38,7 +39,7 @@ #include #include #include -#include +#include #include #include @@ -857,7 +858,7 @@ XGUI_SalomeViewer* XGUI_Workshop::salomeViewer() const //************************************************************** void XGUI_Workshop::onContextMenuCommand(const QString& theId, bool isChecked) { - QFeatureList aFeatures = mySelector->selectedFeatures(); + QFeatureList aFeatures = mySelector->selection()->selectedFeatures(); if ((theId == "ACTIVATE_PART_CMD") && (aFeatures.size() > 0)) activatePart(aFeatures.first()); else if (theId == "DEACTIVATE_PART_CMD") @@ -964,17 +965,17 @@ void XGUI_Workshop::updateCommandsOnViewSelection() { PluginManagerPtr aMgr = ModelAPI_PluginManager::get(); ModelAPI_ValidatorsFactory* aFactory = aMgr->validators(); - Handle(AIS_InteractiveContext) aContext = viewer()->AISContext(); + XGUI_Selection* aSelection = mySelector->selection(); QList aActions = getModuleCommands(); foreach(QAction* aAction, aActions) { QString aId = aAction->data().toString(); const ModelAPI_Validator* aValidator = aFactory->validator(aId.toStdString()); if (aValidator) { - const ModuleBase_ViewSelectionValidator* aSelValidator = - dynamic_cast(aValidator); + const ModuleBase_SelectionValidator* aSelValidator = + dynamic_cast(aValidator); if (aSelValidator) { - aAction->setEnabled(aSelValidator->isValid(aContext)); + aAction->setEnabled(aSelValidator->isValid(aSelection)); } } }