ZE_KEY_TO_FIND_PV_ROOT_DIR="lib"
li=tmp.split(os.path.sep) ; li.reverse()
if ZE_KEY_TO_FIND_PV_ROOT_DIR not in li:
- raise Exception("PVSERVER_Impl.__init__ : error during dynamic deduction of PARAVIEW_ROOT_DIR : Loc of paraview module is \"%s\" ! \"%s\" is supposed to be the key to deduce it !"%(tmp,ZE_KEY_TO_FIND_PV_ROOT_DIR))
+ raise SALOME.SALOME_Exception(SALOME.ExceptionStruct(SALOME.INTERNAL_ERROR,
+ "PVSERVER_Impl.__init__ : error during dynamic deduction of PARAVIEW_ROOT_DIR : Loc of paraview module is \"%s\" ! \"%s\" is supposed to be the key to deduce it !"%(tmp,ZE_KEY_TO_FIND_PV_ROOT_DIR),
+ "PVSERVER.py", 0))
li=li[li.index("lib")+1:] ; li.reverse()
self.PARAVIEW_ROOT_DIR = os.path.sep.join(li)
if ( myToolbarsMenuId != -1 ) menuMgr()->show(myToolbarsMenuId);
// Update the various menus with the content pre-loaded in myGuiElements
- QMenu* srcMenu = menuMgr()->findMenu( mySourcesMenuId );
- myGuiElements->updateSourcesMenu(srcMenu);
- QMenu* filtMenu = menuMgr()->findMenu( myFiltersMenuId );
- myGuiElements->updateFiltersMenu(filtMenu);
- QMenu* macMenu = menuMgr()->findMenu( myMacrosMenuId );
- myGuiElements->updateMacrosMenu(macMenu);
+// QMenu* srcMenu = menuMgr()->findMenu( mySourcesMenuId );
+// myGuiElements->updateSourcesMenu(srcMenu);
+// QMenu* filtMenu = menuMgr()->findMenu( myFiltersMenuId );
+// myGuiElements->updateFiltersMenu(filtMenu);
+// QMenu* macMenu = menuMgr()->findMenu( myMacrosMenuId );
+// myGuiElements->updateMacrosMenu(macMenu);
setMenuShown( true );
setToolShown( true );
#include "PVGUI_Module.h"
#include <PVViewer_GUIElements.h>
+#include <PVViewer_ViewManager.h>
#include <QtxAction.h>
#include <QtxActionMenuMgr.h>
// --- Menu "Sources"
// Install ParaView managers for "Sources" menu
QMenu* aRes = 0;
+ QMenu* filtersMenu = 0;
PVViewer_GUIElements * guiElements = PVViewer_GUIElements::GetInstance(desk);
mySourcesMenuId = createMenu( tr( "MEN_DESK_SOURCES" ), -1, -1, 60);
if ( (aRes = getMenu( mySourcesMenuId )) )
- guiElements->updateSourcesMenu(aRes);
+ pqParaViewMenuBuilders::buildSourcesMenu(*aRes, desk);
// --- Menu "Filters"
// Install ParaView managers for "Filters" menu
myFiltersMenuId = createMenu( tr( "MEN_DESK_FILTERS" ), -1, -1, 70 );
- if ( (aRes = getMenu( myFiltersMenuId )) )
- guiElements->updateFiltersMenu(aRes);
+ if ( (filtersMenu = getMenu( myFiltersMenuId )) )
+ pqParaViewMenuBuilders::buildFiltersMenu(*filtersMenu, desk);
// --- Menu "Macros"
myMacrosMenuId = createMenu( tr( "MEN_MACROS" ), -1, -1, 80 );
if ( (aRes = getMenu( myMacrosMenuId )) )
- guiElements->updateMacrosMenu(aRes);
+ pqParaViewMenuBuilders::buildMacrosMenu(*aRes);
// --- Menu "Tools"
int aToolsMnu = createMenu( tr( "MEN_DESK_TOOLS" ), -1, -1, 90 );
createMenu( separator(), aPVHelpMnu );
#endif
createMenu( AboutParaViewId, aPVHelpMnu );
+
+ // 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);
+ }
+ }
}
/*!