Salome HOME
Fix for the issue #2456 : Fatal error when remove part
[modules/shaper.git] / src / XGUI / XGUI_ContextMenuMgr.cpp
index 4d97e46d0dd67020cd2760875188e42cbb54a1b2..87c91f9753ec01b48737e0a66f23e9cdd044b48b 100644 (file)
@@ -24,8 +24,9 @@
 #include "XGUI_SelectionMgr.h"
 #include "XGUI_Displayer.h"
 #include "XGUI_ViewerProxy.h"
-#include "XGUI_Selection.h"
 #include "XGUI_SalomeConnector.h"
+#include "XGUI_Selection.h"
+#include "XGUI_SelectionActivate.h"
 #include "XGUI_DataModel.h"
 #include "XGUI_OperationMgr.h"
 #include "XGUI_Tools.h"
@@ -541,7 +542,7 @@ void XGUI_ContextMenuMgr::updateViewerMenu()
 #endif
 
   // Update selection menu
-  QIntList aModes = aDisplayer->activeSelectionModes();
+  QIntList aModes = myWorkshop->selectionActivate()->activeSelectionModes();
   action("SELECT_VERTEX_CMD")->setEnabled(true);
   action("SELECT_EDGE_CMD")->setEnabled(true);
   action("SELECT_FACE_CMD")->setEnabled(true);
@@ -675,6 +676,7 @@ void XGUI_ContextMenuMgr::buildObjBrowserMenu()
   //-------------------------------------
 
   aList.clear();
+  aList.append(action("RENAME_CMD"));
   aList.append(action("DELETE_CMD"));
   myObjBrowserMenus[ModelAPI_Folder::group()] = aList;
 
@@ -781,9 +783,8 @@ void XGUI_ContextMenuMgr::addViewerMenu(QMenu* theMenu) const
 
   // Create selection menu
   XGUI_OperationMgr* aOpMgr = myWorkshop->operationMgr();
-  QIntList aModes;
-  myWorkshop->module()->activeSelectionModes(aModes);
-  if ((!aOpMgr->hasOperation()) && aModes.isEmpty()) {
+  if (!aOpMgr->hasOperation() &&
+      myWorkshop->selectionActivate()->activeSelectionPlace() == XGUI_SelectionActivate::Workshop) {
     QMenu* aSelMenu = new QMenu(tr("Selection mode"), theMenu);
     aSelMenu->addAction(action("SELECT_VERTEX_CMD"));
     aSelMenu->addAction(action("SELECT_EDGE_CMD"));