From e54d7d0f35c27bce114c5af20b2c492106c32d6a Mon Sep 17 00:00:00 2001 From: vsr Date: Thu, 22 Jan 2015 10:31:40 +0300 Subject: [PATCH] 0022847: [CEA 1408] Regression : in 7.5.1rc1 switching to Paravis to some other modules keeps the Paravis toolbars visible - Manage additionally "Common" and "DataAnalysis" toolbars - Add a method to get all desktop toolbars managed by PVViewer --- src/PVViewer/PVViewer_GUIElements.cxx | 35 +++++++++++++++++++- src/PVViewer/PVViewer_GUIElements.h | 46 +++++++++++++++------------ 2 files changed, 60 insertions(+), 21 deletions(-) diff --git a/src/PVViewer/PVViewer_GUIElements.cxx b/src/PVViewer/PVViewer_GUIElements.cxx index 1d5c3e6ad..2b3853063 100644 --- a/src/PVViewer/PVViewer_GUIElements.cxx +++ b/src/PVViewer/PVViewer_GUIElements.cxx @@ -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 PVViewer_GUIElements::getToolbars() +{ + QList l; + l << mainToolBar << vcrToolbar << timeToolbar << colorToolbar + << reprToolbar << cameraToolbar << axesToolbar << macrosToolbar + << commonToolbar << dataToolbar; + return l; +} diff --git a/src/PVViewer/PVViewer_GUIElements.h b/src/PVViewer/PVViewer_GUIElements.h index 4360de94a..c1ba7de9d 100644 --- a/src/PVViewer/PVViewer_GUIElements.h +++ b/src/PVViewer/PVViewer_GUIElements.h @@ -24,6 +24,7 @@ #include "PVViewer.h" #include +#include 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 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_ */ -- 2.39.2