]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Key_Delete shortcut for both delete action - 1. workshop, 2. partset module.
authornds <natalia.donis@opencascade.com>
Fri, 27 Feb 2015 16:51:21 +0000 (19:51 +0300)
committernds <natalia.donis@opencascade.com>
Fri, 27 Feb 2015 16:51:21 +0000 (19:51 +0300)
Crash fix for SALOME mode.

src/XGUI/XGUI_ContextMenuMgr.cpp

index a1940fee8bcb1f359a9fa1850e457be8df96c8e2..2f2ff1206a37483e2afef3f205299847835b4ea3 100644 (file)
@@ -7,6 +7,7 @@
 #include "XGUI_Displayer.h"
 #include "XGUI_ViewerProxy.h"
 #include "XGUI_Selection.h"
+#include "XGUI_SalomeConnector.h"
 
 #include <AppElements_MainWindow.h>
 
@@ -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);