]> SALOME platform Git repositories - modules/gui.git/commitdiff
Salome HOME
Fixing menus in PARAVIS.
authorabn <adrien.bruneton@cea.fr>
Mon, 27 Oct 2014 10:55:25 +0000 (11:55 +0100)
committerabn <adrien.bruneton@cea.fr>
Mon, 27 Oct 2014 10:55:25 +0000 (11:55 +0100)
src/PVViewer/PVViewer_GUIElements.cxx
src/PVViewer/PVViewer_GUIElements.h
src/PVViewer/PVViewer_ViewManager.cxx
src/PVViewer/PVViewer_ViewManager.h

index ff139e682c2cff50d2983a86526ccdd9238db051..b68bc1eada5146f0908516c8f70a30116177d288 100644 (file)
@@ -40,14 +40,12 @@ PVViewer_GUIElements::PVViewer_GUIElements(SUIT_Desktop* desk) :
   pipelineBrowserWidget  = new pqPipelineBrowserWidget(desk);
   pipelineBrowserWidget->hide();
 
-  sourcesMenu = new QMenu(desk);
-  pqParaViewMenuBuilders::buildSourcesMenu(*sourcesMenu, desk);
-
-  filtersMenu = new QMenu(desk);
-  pqParaViewMenuBuilders::buildFiltersMenu(*filtersMenu, desk);
-
-  macrosMenu = new QMenu(desk);
-  pqParaViewMenuBuilders::buildMacrosMenu(*macrosMenu);
+//  sourcesMenu = new QMenu(desk);
+//  pqParaViewMenuBuilders::buildSourcesMenu(*sourcesMenu, desk);
+//  filtersMenu = new QPVMenu(desk);
+//  pqParaViewMenuBuilders::buildFiltersMenu(*filtersMenu, desk);
+//  macrosMenu = new QMenu(desk);
+//  pqParaViewMenuBuilders::buildMacrosMenu(*macrosMenu);
 }
 
 PVViewer_GUIElements * PVViewer_GUIElements::GetInstance(SUIT_Desktop* desk)
@@ -57,44 +55,45 @@ PVViewer_GUIElements * PVViewer_GUIElements::GetInstance(SUIT_Desktop* desk)
   return theInstance;
 }
 
-void PVViewer_GUIElements::updateSourcesMenu(QMenu *menu)
-{
-  if (menu)
-    {
-      menu->clear();
-      QList<QAction *> act_list = sourcesMenu->actions();
-      foreach(QAction * a, act_list)
-      {
-        menu->addAction(a);
-      }
-    }
-}
-
-void PVViewer_GUIElements::updateFiltersMenu(QMenu *menu)
-{
-  if (menu)
-    {
-      menu->clear();
-      QList<QAction *> act_list = filtersMenu->actions();
-      foreach(QAction * a, act_list)
-      {
-        menu->addAction(a);
-      }
-    }
-}
-
-void PVViewer_GUIElements::updateMacrosMenu(QMenu *menu)
-{
-  if (menu)
-    {
-      menu->clear();
-      QList<QAction *> act_list = macrosMenu->actions();
-      foreach(QAction * a, act_list)
-      {
-        menu->addAction(a);
-      }
-    }
-}
+//void PVViewer_GUIElements::updateSourcesMenu(QMenu *menu)
+//{
+//  if (menu)
+//    {
+//      menu->clear();
+//      QList<QAction *> act_list = sourcesMenu->actions();
+//      foreach(QAction * a, act_list)
+//      {
+//        menu->addAction(a);
+//      }
+//    }
+//}
+//
+//void PVViewer_GUIElements::updateFiltersMenu(QMenu *menu)
+//{
+//  if (menu)
+//    {
+//      filtersMenu->linkToMenu(menu);
+//      menu->clear();
+//      QList<QAction *> act_list = filtersMenu->actions();
+//      foreach(QAction * a, act_list)
+//      {
+//        menu->addAction(a);
+//      }
+//    }
+//}
+//
+//void PVViewer_GUIElements::updateMacrosMenu(QMenu *menu)
+//{
+//  if (menu)
+//    {
+//      menu->clear();
+//      QList<QAction *> act_list = macrosMenu->actions();
+//      foreach(QAction * a, act_list)
+//      {
+//        menu->addAction(a);
+//      }
+//    }
+//}
 
 
 void PVViewer_GUIElements::onEmulateApply()
index aa22f4b2d9b8d7f18db5af84cb2e326cadbd4fe2..1615efc48ef77cf0dca70a501d747c64665ec657 100644 (file)
@@ -33,8 +33,6 @@ class QMenu;
 /*!
  * Some GUI elements of ParaView need to be instanciated in a proper order. This class
  * holds all of them for the sake of clarity.
- * For example sources menu should be built *before* loading ParaView's configuration, so that the
- * list of sources gets properly populated.
  */
 class PVVIEWER_EXPORT PVViewer_GUIElements: public QObject
 {
@@ -47,9 +45,9 @@ public:
   pqPipelineBrowserWidget * getPipelineBrowserWidget() { return pipelineBrowserWidget; }
 
   // Update the sources menu from what was built in private member 'sourcesMenu'
-  void updateSourcesMenu(QMenu *);
-  void updateFiltersMenu(QMenu *);
-  void updateMacrosMenu(QMenu *);
+//  void updateSourcesMenu(QMenu *);
+//  void updateFiltersMenu(QMenu *);
+//  void updateMacrosMenu(QMenu *);
 
 public slots:
   void onEmulateApply();  // better use the slot from PVViewer_ViewManager if you want to trigger "Apply"
index 74baf63fab3dc3f1617a0c7dc52672b721073006..0d4b2ec4f3f0e5a7f6b75265a408952475a58054 100644 (file)
@@ -135,9 +135,9 @@ void PVViewer_ViewManager::ParaviewInitBehaviors(bool fullSetup, SUIT_Desktop* a
     ParaviewBehaviors->instanciateMinimalBehaviors(aDesktop);
 }
 
-void PVViewer_ViewManager::ParaviewLoadConfigurations()
+void PVViewer_ViewManager::ParaviewLoadConfigurations(bool force)
 {
-  if (!ConfigLoaded)
+  if (!ConfigLoaded || force)
     {
       SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
       QString aPath = resMgr->stringValue("resources", "PVViewer", QString());
index fad78159f3f39f90a9e64fd18ea17eefdb29ecb0..9061eb65a7cb7a503509aaa5615cfefdcb577d3b 100644 (file)
@@ -48,7 +48,7 @@ public:
   //! Initialize ParaView if not yet done (once per session)
   static bool   ParaviewInitApp(SUIT_Desktop* aDesktop, LogWindow * w);
   static void   ParaviewInitBehaviors(bool fullSetup=false, SUIT_Desktop* aDesktop=0);
-  static void   ParaviewLoadConfigurations();
+  static void   ParaviewLoadConfigurations(bool force=false);
   static void   ParaviewCleanup();
 
   //! Connect to the external PVServer, using the PARAVIS engine to launch it if it is not