]> SALOME platform Git repositories - modules/gui.git/commitdiff
Salome HOME
fix for PAL19420: correct implementation of popup items switching on/off the toolbars V5_0_0 V5_0_0rc1
authorasl <asl@opencascade.com>
Mon, 28 Apr 2008 12:49:12 +0000 (12:49 +0000)
committerasl <asl@opencascade.com>
Mon, 28 Apr 2008 12:49:12 +0000 (12:49 +0000)
src/SVTK/SVTK_ViewModel.cxx
src/SVTK/SVTK_ViewModel.h

index 8e5360537a1a9f93064d4581c86f3d556d57c7d6..b8edb171c6a705b1030d7668bc7481c2f98b2441 100644 (file)
@@ -196,9 +196,11 @@ SVTK_Viewer
   thePopup->addSeparator();
 
   if(TViewWindow* aView = dynamic_cast<TViewWindow*>(myViewManager->getActiveView())){
-    if ( !aView->getMainWindow()->getToolBar()->isVisible() ){
-      thePopup->addAction( VTKViewer_Viewer::tr( "MEN_SHOW_TOOLBAR" ), this, SLOT( onShowToolbar() ) );
-    }
+    //Support of several toolbars in the popup menu
+    QList<QToolBar*> lst = qFindChildren<QToolBar*>( aView );
+    QList<QToolBar*>::const_iterator it = lst.begin(), last = lst.end();
+    for( ; it!=last; it++ )
+      thePopup->addAction( (*it)->toggleViewAction() );
     aView->RefreshDumpImage();
   }
 }
@@ -275,29 +277,6 @@ SVTK_Viewer
   }
 }
 
-/*!
-  SLOT: called when popup item "Show toolbar" is activated, shows toolbar of active view window
-*/
-void
-SVTK_Viewer
-::onShowToolbar() 
-{
-  QVector<SUIT_ViewWindow*> aViews = myViewManager->getViews();
-  for(int i = 0, iEnd = aViews.size(); i < iEnd; i++){
-    if(TViewWindow* aView = dynamic_cast<TViewWindow*>(aViews.at(i))){
-      //aView->getMainWindow()->getToolBar()->show();
-      const QObjectList& aChildren = aView->getMainWindow()->children();
-      foreach (QObject* aObj, aChildren) {
-       if (aObj->inherits("QToolBar")) {
-         QToolBar* aToolBar = dynamic_cast<QToolBar*>(aObj);
-         if (aToolBar) aToolBar->show();
-       }
-      }
-    }
-  }
-}
-
-
 /*!
   Display presentation
   \param prs - presentation
index db6c4d79dda63d5b72ad96b6ba0e0ac4e8fb9b03..a76da1dbc0d64e357e7eaf16732b2661f65ab959 100644 (file)
@@ -113,7 +113,6 @@ protected slots:
   void onMouseRelease(SUIT_ViewWindow*, QMouseEvent*);
 
   void onDumpView();
-  void onShowToolbar();
   void onChangeBgColor();
 
 private: