From 72197a261d1f8668a22f4d448e2864d70eba987c Mon Sep 17 00:00:00 2001 From: abn Date: Tue, 4 Nov 2014 10:14:47 +0100 Subject: [PATCH] Fixing filter display issues. --- src/PVGUI/PVGUI_Module.cxx | 19 +++++++++---------- src/PVGUI/PVGUI_Module_actions.cxx | 26 +++++++++++++------------- 2 files changed, 22 insertions(+), 23 deletions(-) diff --git a/src/PVGUI/PVGUI_Module.cxx b/src/PVGUI/PVGUI_Module.cxx index b94515ef..a62e2fc8 100644 --- a/src/PVGUI/PVGUI_Module.cxx +++ b/src/PVGUI/PVGUI_Module.cxx @@ -350,9 +350,7 @@ void PVGUI_Module::initialize( CAM_Application* app ) { LightApp_Module::initialize( app ); - // Create ParaViS actions createActions(); - // Create ParaViS menus createMenus(); // Uncomment to debug ParaView initialization @@ -375,19 +373,17 @@ void PVGUI_Module::initialize( CAM_Application* app ) // Remember current state of desktop toolbars QList foreignToolbars = aDesktop->findChildren(); + // [ABN]: careful with the order of the GUI element creation, the loading of the configuration + // and the connection to the server. This order is very sensitive if one wants to make + // sure all menus, etc ... are correctly populated. + // Reference points are: ParaViewMainWindow.cxx and branded_paraview_initializer.cxx.in setupDockWidgets(); - // Behaviors and connection must be instanciated *after* widgets are in place - // In PARAVIS module we do not wait for PVViewer_ViewWindow to be instanciated to have this: - PVViewer_ViewManager::ParaviewInitBehaviors(true, aDesktop); - pvCreateActions(); pvCreateMenus(); pvCreateToolBars(); - // Connect after toolbar creation, etc ... as some activations of the toolbars is triggered - // by the ServerConnection event: - PVViewer_ViewManager::ConnectToExternalPVServer(aDesktop); + PVViewer_ViewManager::ParaviewInitBehaviors(true, aDesktop); QList activeDocks = aDesktop->findChildren(); QList activeMenus = aDesktop->findChildren(); @@ -419,7 +415,10 @@ void PVGUI_Module::initialize( CAM_Application* app ) // } // } - PVViewer_ViewManager::ParaviewLoadConfigurations(); + // Connect after toolbar creation, etc ... as some activations of the toolbars is triggered + // by the ServerConnection event: + PVViewer_ViewManager::ParaviewLoadConfigurations(true); + PVViewer_ViewManager::ConnectToExternalPVServer(aDesktop); updateObjBrowser(); // Find created toolbars diff --git a/src/PVGUI/PVGUI_Module_actions.cxx b/src/PVGUI/PVGUI_Module_actions.cxx index 303d4ff7..cf88c7d0 100644 --- a/src/PVGUI/PVGUI_Module_actions.cxx +++ b/src/PVGUI/PVGUI_Module_actions.cxx @@ -541,19 +541,19 @@ void PVGUI_Module::pvCreateMenus() pqPipelineBrowserWidget * pq = guiElements->getPipelineBrowserWidget(); pqParaViewMenuBuilders::buildPipelineBrowserContextMenu( *pq ); - // Reload configuration to populate dynamic menus from ParaView: - PVViewer_ViewManager::ParaviewLoadConfigurations(true); - - // Disable all filters for now (for some weird reasons they are all on when starting?) - QList sub_menus = filtersMenu->findChildren(); - foreach(QMenu * m, sub_menus) - { - QList act_list = m->actions(); - foreach(QAction * a, act_list) - { - a->setEnabled(false); - } - } +// // Reload configuration to populate dynamic menus from ParaView: +// PVViewer_ViewManager::ParaviewLoadConfigurations(true); +// +// // Disable all filters for now (for some weird reasons they are all on when starting?) +// QList sub_menus = filtersMenu->findChildren(); +// foreach(QMenu * m, sub_menus) +// { +// QList act_list = m->actions(); +// foreach(QAction * a, act_list) +// { +// a->setEnabled(false); +// } +// } } /*! -- 2.39.2