Salome HOME
Fix for IPAL10387 ( Supervisor viewer has no "View Operations" toolbar ) :
authormkr <mkr@opencascade.com>
Thu, 24 Nov 2005 14:35:53 +0000 (14:35 +0000)
committermkr <mkr@opencascade.com>
Thu, 24 Nov 2005 14:35:53 +0000 (14:35 +0000)
add "Show toolbar" item into Supervisor background popup menus in Full,
Control and Table views.

src/SUPERVGUI/SUPERVGUI_ArrayView.cxx
src/SUPERVGUI/SUPERVGUI_ArrayView.h
src/SUPERVGUI/SUPERVGUI_CanvasView.cxx
src/SUPERVGUI/SUPERVGUI_CanvasView.h
src/SUPERVGUI/SUPERVGUI_Main.cxx
src/SUPERVGUI/SUPERVGUI_Main.h
src/SUPERVGUI/SUPERV_msg_en.po

index de53d8c3ed88212557ce7c55d15679e832e363c3..b8c2be47d487280da4787b8b39afc49f371c4ff5 100644 (file)
@@ -69,7 +69,13 @@ SUPERVGUI_ArrayView::SUPERVGUI_ArrayView(SUPERVGUI_CanvasArray* theArray, SUPERV
 
   myPopup->insertSeparator();
   myPopup->insertItem(tr("MSG_CHANGE_BACKGROUND"), this, SLOT(changeBackground()));
+
+  SUPERVGraph_ViewFrame* anActiveVF = (SUPERVGraph_ViewFrame*)myMain->parent();
+  if ( anActiveVF ) {
+    myPopup->insertSeparator();
+    myShowToolBarItem = myPopup->insertItem( tr( "MEN_SHOW_TOOLBAR" ), myMain, SLOT( onShowToolbar() ) );
+  }
+
   hide();
 }
  
@@ -143,6 +149,7 @@ void SUPERVGUI_ArrayView::contentsMousePressEvent(QMouseEvent* theEvent) {
     }
 
     myPopup->setItemEnabled(myAddStudyItem, !myMain->isDataflowInStudy());
+    myPopup->setItemEnabled(myShowToolBarItem, !((SUPERVGraph_ViewFrame*)myMain->parent())->getToolBar()->isVisible());
     myMain->showPopup(myPopup, theEvent);
     return;
   }
index 358c27d80e72e8565deb03119eea28ca7d5b598f..a02aa39c7d1917666076f6a6e1dcb62240fb889e 100644 (file)
@@ -48,6 +48,7 @@ class SUPERVGUI_ArrayView: public QCanvasView {
     SUPERVGUI_Main* myMain;
     QPopupMenu*     myPopup;
     int             myAddStudyItem;
+    int             myShowToolBarItem;
 
     QCursor         myCursor;
 
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;
   }
index e44fb2a75b3683069dbb475a5bd610d1048b626f..feda50168b02caa0a792882d6c5e5b13fb81c06d 100644 (file)
@@ -74,6 +74,7 @@ class SUPERVGUI_CanvasView: public QCanvasView {
     QPopupMenu*     mySketchPopup;
     int             myDelPntItem;
     int             myOrtoItem;
+    int             myShowToolBarItem;
 
     bool         myIsPanBtnClicked;
     bool         myIsPanActivated;
index 7ecc679bfde810410025243872151b72d499b1e2..3ffa305d5aaac52c2840d305c031f60401e78c64 100644 (file)
@@ -549,6 +549,13 @@ void SUPERVGUI_Main::onSubGraphClosed(SUIT_ViewWindow* theStudyFrame)
   }
 }
 
+void SUPERVGUI_Main::onShowToolbar()
+{
+  SUPERVGraph_ViewFrame* aVF = (SUPERVGraph_ViewFrame*)this->parent();
+  if ( aVF )
+    aVF->getToolBar()->show();
+}
+
 void SUPERVGUI_Main::run( const bool andSuspend ) {
   Trace("SUPERVGUI_Main::run");
   if ( SUPERV_isNull(dataflow) ) 
index 1559b74f07e10800d43b829fcd065ffd45dd6754..5fde3aeeecf62c989f114dbea625d45b7831c5a1 100644 (file)
@@ -156,6 +156,8 @@ class SUPERVGUI_Main: public SUPERVGraph_View {
     void changeDSGraphParameters();
     void onSubGraphClosed( SUIT_ViewWindow* );
     void onSubGraphActivated( SUIT_ViewWindow* );
+
+    void onShowToolbar();
  
   private slots:
     void chooseData(QListViewItem* item);
index 8d65080af78fd6d58f616cdf4ad145b5c8d8c4c4..706508f8034a993027880202090e18db0ea5a15c 100644 (file)
@@ -972,3 +972,6 @@ msgstr "Execution"
 
 msgid "MSG_INCORRECT_INDENT"
 msgstr "Incorrect indent of the python function name (must be 0)!"
+
+msgid "MEN_SHOW_TOOLBAR"
+msgstr "Show toolbar"