Salome HOME
Fixing filter display issues.
authorabn <adrien.bruneton@cea.fr>
Tue, 4 Nov 2014 09:14:47 +0000 (10:14 +0100)
committerabn <adrien.bruneton@cea.fr>
Tue, 4 Nov 2014 09:14:47 +0000 (10:14 +0100)
src/PVGUI/PVGUI_Module.cxx
src/PVGUI/PVGUI_Module_actions.cxx

index b94515efa3edff9f56d430afa7bec1362da5ab11..a62e2fc8721b49aa12b3d27bba0449a9f4e9293f 100644 (file)
@@ -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<QToolBar*> foreignToolbars = aDesktop->findChildren<QToolBar*>();
 
+  // [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<QDockWidget*> activeDocks = aDesktop->findChildren<QDockWidget*>();
   QList<QMenu*> activeMenus = aDesktop->findChildren<QMenu*>();
@@ -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
index 303d4ff781dd059c8457ed3e1dacbf0af36c3106..cf88c7d084ed08c368dc6c81815af3b60416fdc7 100644 (file)
@@ -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<QMenu*> sub_menus = filtersMenu->findChildren<QMenu*>();
-  foreach(QMenu * m, sub_menus)
-    {
-      QList<QAction *> 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<QMenu*> sub_menus = filtersMenu->findChildren<QMenu*>();
+//  foreach(QMenu * m, sub_menus)
+//    {
+//      QList<QAction *> act_list = m->actions();
+//      foreach(QAction * a, act_list)
+//      {
+//        a->setEnabled(false);
+//      }
+//    }
 }
 
 /*!