From: abn Date: Mon, 27 Oct 2014 10:55:25 +0000 (+0100) Subject: Fixing menus in PARAVIS. X-Git-Tag: V7_5_0b1~8 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=374c8ed744051c890fb95ea9d08a1b1c15fddff9;p=modules%2Fgui.git Fixing menus in PARAVIS. --- diff --git a/src/PVViewer/PVViewer_GUIElements.cxx b/src/PVViewer/PVViewer_GUIElements.cxx index ff139e682..b68bc1ead 100644 --- a/src/PVViewer/PVViewer_GUIElements.cxx +++ b/src/PVViewer/PVViewer_GUIElements.cxx @@ -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 act_list = sourcesMenu->actions(); - foreach(QAction * a, act_list) - { - menu->addAction(a); - } - } -} - -void PVViewer_GUIElements::updateFiltersMenu(QMenu *menu) -{ - if (menu) - { - menu->clear(); - QList act_list = filtersMenu->actions(); - foreach(QAction * a, act_list) - { - menu->addAction(a); - } - } -} - -void PVViewer_GUIElements::updateMacrosMenu(QMenu *menu) -{ - if (menu) - { - menu->clear(); - QList act_list = macrosMenu->actions(); - foreach(QAction * a, act_list) - { - menu->addAction(a); - } - } -} +//void PVViewer_GUIElements::updateSourcesMenu(QMenu *menu) +//{ +// if (menu) +// { +// menu->clear(); +// QList 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 act_list = filtersMenu->actions(); +// foreach(QAction * a, act_list) +// { +// menu->addAction(a); +// } +// } +//} +// +//void PVViewer_GUIElements::updateMacrosMenu(QMenu *menu) +//{ +// if (menu) +// { +// menu->clear(); +// QList act_list = macrosMenu->actions(); +// foreach(QAction * a, act_list) +// { +// menu->addAction(a); +// } +// } +//} void PVViewer_GUIElements::onEmulateApply() diff --git a/src/PVViewer/PVViewer_GUIElements.h b/src/PVViewer/PVViewer_GUIElements.h index aa22f4b2d..1615efc48 100644 --- a/src/PVViewer/PVViewer_GUIElements.h +++ b/src/PVViewer/PVViewer_GUIElements.h @@ -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" diff --git a/src/PVViewer/PVViewer_ViewManager.cxx b/src/PVViewer/PVViewer_ViewManager.cxx index 74baf63fa..0d4b2ec4f 100644 --- a/src/PVViewer/PVViewer_ViewManager.cxx +++ b/src/PVViewer/PVViewer_ViewManager.cxx @@ -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()); diff --git a/src/PVViewer/PVViewer_ViewManager.h b/src/PVViewer/PVViewer_ViewManager.h index fad78159f..9061eb65a 100644 --- a/src/PVViewer/PVViewer_ViewManager.h +++ b/src/PVViewer/PVViewer_ViewManager.h @@ -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