]> SALOME platform Git repositories - modules/gui.git/commitdiff
Salome HOME
0022847: [CEA 1408] Regression : in 7.5.1rc1 switching to Paravis to some other modul... V7_5_BR V7_5_1 V7_5_1rc2 V7_5_1rc3
authorvsr <vsr@opencascade.com>
Thu, 22 Jan 2015 07:31:40 +0000 (10:31 +0300)
committervsr <vsr@opencascade.com>
Thu, 22 Jan 2015 07:31:40 +0000 (10:31 +0300)
- Manage additionally "Common" and "DataAnalysis" toolbars
- Add a method to get all desktop toolbars managed by PVViewer

src/PVViewer/PVViewer_GUIElements.cxx
src/PVViewer/PVViewer_GUIElements.h

index 1d5c3e6ad66542fbcbd04747af75fb2e2ed8091b..2b38530639094e05e9ff5ce00f6a7aeef618cbaa 100644 (file)
@@ -112,7 +112,13 @@ void PVViewer_GUIElements::myBuildToolbars(SUIT_Desktop* mainWindow)
 
   macrosToolbar = new QToolBar("Macros Toolbars", mainWindow)
       << pqSetName("MacrosToolbar");
-    manager->addWidgetForRunMacros(macrosToolbar);
+  manager->addWidgetForRunMacros(macrosToolbar);
+
+  commonToolbar = new QToolBar("Common", mainWindow) << pqSetName("Common");
+  commonToolbar->layout()->setSpacing(0);
+
+  dataToolbar = new QToolBar("DataAnalysis", mainWindow) << pqSetName("DataAnalysis");
+  dataToolbar->layout()->setSpacing(0);
 
   addToolbars(mainWindow);
 }
@@ -121,21 +127,35 @@ void PVViewer_GUIElements::setToolBarVisible(bool show)
 {
   QCoreApplication::processEvents();
   mainAction->setChecked(!show);
+  mainAction->setVisible(show);
   mainAction->trigger();
   vcrAction->setChecked(!show);
+  vcrAction->setVisible(show);
   vcrAction->trigger();
   timeAction->setChecked(!show);
+  timeAction->setVisible(show);
   timeAction->trigger();
   colorAction->setChecked(!show);
+  colorAction->setVisible(show);
   colorAction->trigger();
   reprAction->setChecked(!show);
+  reprAction->setVisible(show);
   reprAction->trigger();
   cameraAction->setChecked(!show);
+  cameraAction->setVisible(show);
   cameraAction->trigger();
   axesAction->setChecked(!show);
+  axesAction->setVisible(show);
   axesAction->trigger();
   macrosAction->setChecked(!show);
+  macrosAction->setVisible(show);
   macrosAction->trigger();
+  commonAction->setChecked(!show);
+  commonAction->setVisible(show);
+  commonAction->trigger();
+  dataAction->setChecked(!show);
+  dataAction->setVisible(show);
+  dataAction->trigger();
 }
 
 void PVViewer_GUIElements::addToolbars(SUIT_Desktop* desk)
@@ -149,6 +169,8 @@ void PVViewer_GUIElements::addToolbars(SUIT_Desktop* desk)
   desk->addToolBar(Qt::TopToolBarArea, cameraToolbar);
   desk->addToolBar(Qt::TopToolBarArea, axesToolbar);
   desk->addToolBar(Qt::TopToolBarArea, macrosToolbar);
+  desk->addToolBar(Qt::TopToolBarArea, commonToolbar);
+  desk->addToolBar(Qt::TopToolBarArea, dataToolbar);
 
   mainAction = mainToolBar->toggleViewAction();
   vcrAction = vcrToolbar->toggleViewAction();
@@ -158,6 +180,8 @@ void PVViewer_GUIElements::addToolbars(SUIT_Desktop* desk)
   cameraAction = cameraToolbar->toggleViewAction();
   axesAction = axesToolbar->toggleViewAction();
   macrosAction = macrosToolbar->toggleViewAction();
+  commonAction = commonToolbar->toggleViewAction();
+  dataAction = dataToolbar->toggleViewAction();
 }
 
 void PVViewer_GUIElements::onEmulateApply()
@@ -165,3 +189,12 @@ void PVViewer_GUIElements::onEmulateApply()
   if (propertiesPanel)
     propertiesPanel->apply();
 }
+
+QList<QToolBar*> PVViewer_GUIElements::getToolbars()
+{
+  QList<QToolBar*> l;
+  l << mainToolBar << vcrToolbar << timeToolbar << colorToolbar
+    << reprToolbar << cameraToolbar << axesToolbar << macrosToolbar
+    << commonToolbar << dataToolbar;
+  return l;
+}
index 4360de94a5ebced16b0668180abfa0b01093341c..c1ba7de9db4a9b047c8abb9107d3af93dca9cb1e 100644 (file)
@@ -24,6 +24,7 @@
 #include "PVViewer.h"
 
 #include <QObject>
+#include <QList>
 
 class pqPropertiesPanel;
 class pqPipelineBrowserWidget;
@@ -48,16 +49,17 @@ public:
   pqPropertiesPanel * getPropertiesPanel() { return propertiesPanel; }
   pqPipelineBrowserWidget * getPipelineBrowserWidget() { return pipelineBrowserWidget; }
 
-  QMenu * getFiltersMenu() { return filtersMenu; }
-  QMenu * getSourcesMenu() { return sourcesMenu; }
-  QMenu * getMacrosMenu()  { return macrosMenu; }
+  QMenu* getFiltersMenu() { return filtersMenu; }
+  QMenu* getSourcesMenu() { return sourcesMenu; }
+  QMenu* getMacrosMenu()  { return macrosMenu; }
 
-  pqVCRToolbar * getVCRToolbar() { return vcrToolbar; }
-  pqAnimationTimeToolbar * getTimeToolbar() { return timeToolbar; }
+  pqVCRToolbar* getVCRToolbar() { return vcrToolbar; }
+  pqAnimationTimeToolbar* getTimeToolbar() { return timeToolbar; }
 
   void myBuildToolbars(SUIT_Desktop* desk);
   void addToolbars(SUIT_Desktop* desk);
   void setToolBarVisible(bool show);
+  QList<QToolBar*> getToolbars();
 
 public slots:
   void onEmulateApply();  // better use the slot from PVViewer_ViewManager if you want to trigger "Apply"
@@ -66,36 +68,40 @@ private:
   PVViewer_GUIElements(SUIT_Desktop* desk);
   virtual ~PVViewer_GUIElements() {}
 
-  static PVViewer_GUIElements * theInstance;
+  static PVViewer_GUIElements* theInstance;
 
   // Widgets
-  pqPropertiesPanel * propertiesPanel;
-  pqPipelineBrowserWidget * pipelineBrowserWidget;
+  pqPropertiesPanel* propertiesPanel;
+  pqPipelineBrowserWidget* pipelineBrowserWidget;
 
   // Dummy QMenus receiving ParaView's reaction for automatic add when new sources are added
-  QMenu * sourcesMenu;
-  QMenu * filtersMenu;
-  QMenu * macrosMenu;
+  QMenu* sourcesMenu;
+  QMenu* filtersMenu;
+  QMenu* macrosMenu;
 
   // Toolbars also need to be instanciated early:
   QToolBar* mainToolBar;
   pqVCRToolbar* vcrToolbar;
-  pqAnimationTimeToolbar * timeToolbar;
+  pqAnimationTimeToolbar* timeToolbar;
   QToolBar* colorToolbar;
   QToolBar* reprToolbar;
   QToolBar* cameraToolbar;
   QToolBar* axesToolbar;
   QToolBar* macrosToolbar;
+  QToolBar* commonToolbar;
+  QToolBar* dataToolbar;
 
 public:
-  QAction * mainAction;
-  QAction *  vcrAction;
-  QAction *  timeAction;
-  QAction *  colorAction;
-  QAction *  reprAction;
-  QAction *  cameraAction;
-  QAction *  axesAction;
-  QAction *  macrosAction;
+  QAction* mainAction;
+  QAction* vcrAction;
+  QAction* timeAction;
+  QAction* colorAction;
+  QAction* reprAction;
+  QAction* cameraAction;
+  QAction* axesAction;
+  QAction* macrosAction;
+  QAction* commonAction;
+  QAction* dataAction;
 };
 
 #endif /* PVVIEWERGUIELEMENTS_H_ */