From: nds Date: Fri, 27 Feb 2015 16:51:21 +0000 (+0300) Subject: Key_Delete shortcut for both delete action - 1. workshop, 2. partset module. X-Git-Tag: V_1.1.0~153 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=6cbb9ad1ea9d50dfecd1045c1e465240bdc92edd;p=modules%2Fshaper.git Key_Delete shortcut for both delete action - 1. workshop, 2. partset module. Crash fix for SALOME mode. --- diff --git a/src/XGUI/XGUI_ContextMenuMgr.cpp b/src/XGUI/XGUI_ContextMenuMgr.cpp index a1940fee8..2f2ff1206 100644 --- a/src/XGUI/XGUI_ContextMenuMgr.cpp +++ b/src/XGUI/XGUI_ContextMenuMgr.cpp @@ -7,6 +7,7 @@ #include "XGUI_Displayer.h" #include "XGUI_ViewerProxy.h" #include "XGUI_Selection.h" +#include "XGUI_SalomeConnector.h" #include @@ -48,7 +49,10 @@ void XGUI_ContextMenuMgr::createActions() addAction("DEACTIVATE_PART_CMD", aAction); aAction = new QAction(QIcon(":pictures/delete.png"), tr("Delete"), this); - myWorkshop->mainWindow()->addAction(aAction); + QMainWindow* aDesktop = myWorkshop->mainWindow(); + if (!aDesktop) + aDesktop = myWorkshop->salomeConnector()->desktop(); + aDesktop->addAction(aAction); addAction("DELETE_CMD", aAction); aAction->setShortcut(Qt::Key_Delete); aAction->setShortcutContext(Qt::ApplicationShortcut);