Salome HOME
Fix for IPAL10387 ( Supervisor viewer has no "View Operations" toolbar ) :
[modules/superv.git] / src / SUPERVGUI / SUPERVGUI_CanvasView.cxx
index 0d2b30fc9aee301e9db83ff4a3bf6fda1d3e70f6..3e52a413e50c30ef05fade6d30c8c11a45b760d8 100644 (file)
@@ -153,6 +153,12 @@ SUPERVGUI_CanvasView::SUPERVGUI_CanvasView(SUPERVGUI_Canvas* theCanvas, SUPERVGU
   // add "change dataflow parameters" popup item
   myPopup->insertSeparator();
   myDSParamsItem = myPopup->insertItem( tr( "MSG_SET_GRAPHPARAMS" ), myMain, SLOT( changeDSGraphParameters() ) );
+
+  SUPERVGraph_ViewFrame* anActiveVF = (SUPERVGraph_ViewFrame*)myMain->parent();
+  if ( anActiveVF ) {
+    myPopup->insertSeparator();
+    myShowToolBarItem = myPopup->insertItem( tr( "MEN_SHOW_TOOLBAR" ), myMain, SLOT( onShowToolbar() ) );
+  }
 }
  
 
@@ -233,6 +239,8 @@ void SUPERVGUI_CanvasView::contentsMousePressEvent(QMouseEvent* theEvent)
        
     myPopup->setItemEnabled( myDSParamsItem, isHavingStreamPort()/*myMain->getDataflow()->IsStreamGraph()*/ );
 
+    myPopup->setItemEnabled( myShowToolBarItem, !((SUPERVGraph_ViewFrame*)myMain->parent())->getToolBar()->isVisible() );
+
     myMain->showPopup(myPopup, theEvent);
     return;
   }