From 78a2a4a0028bfc77071bc9883699ce2f84c14c3c Mon Sep 17 00:00:00 2001 From: abn Date: Wed, 12 Nov 2014 15:30:30 +0100 Subject: [PATCH] Fixing #22791: some entries not appearing in teh Filters menu of PARAVIS. --- src/CAM/CAM_Module.cxx | 4 ++-- src/CAM/CAM_Module.h | 2 +- src/PVViewer/PVViewer_Behaviors.cxx | 2 +- src/PVViewer/PVViewer_GUIElements.cxx | 12 ++++++------ src/PVViewer/PVViewer_GUIElements.h | 8 ++++---- src/Qtx/QtxActionMenuMgr.cxx | 9 +++++++-- src/Qtx/QtxActionMenuMgr.h | 2 +- 7 files changed, 22 insertions(+), 17 deletions(-) diff --git a/src/CAM/CAM_Module.cxx b/src/CAM/CAM_Module.cxx index 2cba7bc1e..8dea53da8 100755 --- a/src/CAM/CAM_Module.cxx +++ b/src/CAM/CAM_Module.cxx @@ -572,12 +572,12 @@ int CAM_Module::createTool( const int id, const QString& tBar, const int idx ) \return menu item ID or -1 if menu item could not be added */ int CAM_Module::createMenu( const QString& subMenu, const int menu, - const int id, const int group, const int idx ) + const int id, const int group, const int idx, QMenu * menuObj ) { if ( !menuMgr() ) return -1; - return menuMgr()->insert( subMenu, menu, group, id, idx ); + return menuMgr()->insert( subMenu, menu, group, id, idx, menuObj ); } /*! diff --git a/src/CAM/CAM_Module.h b/src/CAM/CAM_Module.h index 49fbaf4e7..a49447a9f 100755 --- a/src/CAM/CAM_Module.h +++ b/src/CAM/CAM_Module.h @@ -105,7 +105,7 @@ public: int createTool( QAction*, const int, const int = -1, const int = -1 ); int createTool( QAction*, const QString&, const int = -1, const int = -1 ); - int createMenu( const QString&, const int, const int = -1, const int = -1, const int = -1 ); + int createMenu( const QString&, const int, const int = -1, const int = -1, const int = -1,QMenu * = 0); int createMenu( const QString&, const QString&, const int = -1, const int = -1, const int = -1 ); int createMenu( const int, const int, const int = -1, const int = -1 ); int createMenu( const int, const QString&, const int = -1, const int = -1 ); diff --git a/src/PVViewer/PVViewer_Behaviors.cxx b/src/PVViewer/PVViewer_Behaviors.cxx index 4b85167b4..5b2a4772a 100644 --- a/src/PVViewer/PVViewer_Behaviors.cxx +++ b/src/PVViewer/PVViewer_Behaviors.cxx @@ -79,7 +79,6 @@ void PVViewer_Behaviors::instanciateMinimalBehaviors(SUIT_Desktop * desk) new pqDefaultViewBehavior(this); // shows a 3D view as soon as a server connection is made new pqAlwaysConnectedBehavior(this); // client always connected to a server - new pqAutoLoadPluginXMLBehavior(this); // auto load plugins new pqVerifyRequiredPluginBehavior(this); new pqPluginSettingsBehavior(this); new pqFixPathsInStateFilesBehavior(this); @@ -111,6 +110,7 @@ void PVViewer_Behaviors::instanciateAllBehaviors(SUIT_Desktop * desk) new pqSpreadSheetVisibilityBehavior(this); new pqPipelineContextMenuBehavior(this); new pqUndoRedoBehavior(this); + new pqAutoLoadPluginXMLBehavior(this); // auto load plugins GUI stuff new pqPluginDockWidgetsBehavior(desk); new pqPluginActionGroupBehavior(desk); new pqPersistentMainWindowStateBehavior(desk); diff --git a/src/PVViewer/PVViewer_GUIElements.cxx b/src/PVViewer/PVViewer_GUIElements.cxx index b68bc1ead..c534b8a72 100644 --- a/src/PVViewer/PVViewer_GUIElements.cxx +++ b/src/PVViewer/PVViewer_GUIElements.cxx @@ -40,12 +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 QPVMenu(desk); -// pqParaViewMenuBuilders::buildFiltersMenu(*filtersMenu, desk); -// macrosMenu = new QMenu(desk); -// pqParaViewMenuBuilders::buildMacrosMenu(*macrosMenu); + sourcesMenu = new QMenu(0); + pqParaViewMenuBuilders::buildSourcesMenu(*sourcesMenu, desk); + filtersMenu = new QMenu(0); + pqParaViewMenuBuilders::buildFiltersMenu(*filtersMenu, desk); + macrosMenu = new QMenu(0); + pqParaViewMenuBuilders::buildMacrosMenu(*macrosMenu); } PVViewer_GUIElements * PVViewer_GUIElements::GetInstance(SUIT_Desktop* desk) diff --git a/src/PVViewer/PVViewer_GUIElements.h b/src/PVViewer/PVViewer_GUIElements.h index 1615efc48..c9d2d3f2d 100644 --- a/src/PVViewer/PVViewer_GUIElements.h +++ b/src/PVViewer/PVViewer_GUIElements.h @@ -44,10 +44,10 @@ public: pqPropertiesPanel * getPropertiesPanel() { return propertiesPanel; } 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 *); + QMenu * getFiltersMenu() { return filtersMenu; } + QMenu * getSourcesMenu() { return sourcesMenu; } + QMenu * getMacrosMenu() { return macrosMenu; } + public slots: void onEmulateApply(); // better use the slot from PVViewer_ViewManager if you want to trigger "Apply" diff --git a/src/Qtx/QtxActionMenuMgr.cxx b/src/Qtx/QtxActionMenuMgr.cxx index c6b8affc4..f0b8d162d 100644 --- a/src/Qtx/QtxActionMenuMgr.cxx +++ b/src/Qtx/QtxActionMenuMgr.cxx @@ -312,7 +312,8 @@ int QtxActionMenuMgr::insert( QAction* a, const int pId, const int group, const \param idx menu index inside the menu group \return action ID */ -int QtxActionMenuMgr::insert( const QString& title, const int pId, const int group, const int id, const int idx ) +int QtxActionMenuMgr::insert( const QString& title, const int pId, const int group, + const int id, const int idx, QMenu* _menu) { MenuNode* pNode = pId == -1 ? myRoot : find( pId ); if ( !pNode ) @@ -333,7 +334,11 @@ int QtxActionMenuMgr::insert( const QString& title, const int pId, const int gro int gid = (id == -1 || eNode ) ? generateId() : id; - QMenu* menu = new QMenu( 0 ); + QMenu* menu; + if (_menu) + menu = _menu; + else + menu = new QMenu( 0 ); QAction* ma = menu->menuAction(); ma->setText( title ); diff --git a/src/Qtx/QtxActionMenuMgr.h b/src/Qtx/QtxActionMenuMgr.h index cea6ddedd..a09ddc7e2 100644 --- a/src/Qtx/QtxActionMenuMgr.h +++ b/src/Qtx/QtxActionMenuMgr.h @@ -71,7 +71,7 @@ public: int insert( const QString&, const QString&, const int, const int = -1, const int = -1 ); int insert( const QString&, const QStringList&, const int, const int = -1, const int = -1 ); - virtual int insert( const QString&, const int, const int, const int = -1, const int = -1 ); + virtual int insert( const QString&, const int, const int, const int = -1, const int = -1 , QMenu* = 0); int append( const int, const int, const int ); int append( QAction*, const int, const int ); -- 2.39.2