Salome HOME
Copyright update 2022
[modules/paravis.git] / src / PVGUI / PVGUI_Module_actions.cxx
index 91e840e049c19f8ee0fa2065c469110d5fc7c659..9b328237c8a347219df8abc4f9d654bf5d33adc2 100644 (file)
@@ -1,6 +1,6 @@
 // PARAVIS : ParaView wrapper SALOME module
 //
-// Copyright (C) 2010-2016  CEA/DEN, EDF R&D
+// Copyright (C) 2010-2022  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
@@ -67,7 +67,7 @@
 #include <pqAboutDialogReaction.h>
 #include <pqHelpReaction.h>
 #include <pqDataQueryReaction.h>
-#include <pqPythonShellReaction.h>
+//#include <pqPythonShellReaction.h>
 
 #include <pqViewManager.h>
 #include <pqViewMenuManager.h>
@@ -88,7 +88,7 @@ void PVGUI_Module::pvCreateActions()
 
   QPixmap aPixmap;
   QAction* anAction;
-
+  
   // --- Menu "File"
 
   // Open File
@@ -98,14 +98,14 @@ void PVGUI_Module::pvCreateActions()
   anAction->setStatusTip(tr("STB_OPEN_FILE"));
   registerAction(OpenFileId, anAction);
   new pqLoadDataReaction(anAction);
-
+  
   // Load State
   anAction = new QAction(tr("MEN_LOAD_STATE"), this);
   anAction->setToolTip(tr("TOP_LOAD_STATE"));
   anAction->setStatusTip(tr("STB_LOAD_STATE"));
   registerAction(LoadStateId, anAction);
   new pqLoadStateReaction(anAction);
-
+  
   // Save State
   anAction = new QAction(tr("MEN_SAVE_STATE"), this);
   anAction->setToolTip(tr("TOP_SAVE_STATE"));
@@ -193,7 +193,7 @@ void PVGUI_Module::pvCreateActions()
   anAction->setStatusTip(tr("STB_CAMERA_UNDO"));
   registerAction(CameraUndoId, anAction);
   new pqCameraUndoRedoReaction(anAction, true);
-
+  
   // Camera Redo
   aPixmap = resMgr->loadPixmap( "ParaView", tr("ICON_CAMERA_REDO"), false );
   anAction = new QAction(QIcon(aPixmap), tr("MEN_CAMERA_REDO"), this);
@@ -208,7 +208,7 @@ void PVGUI_Module::pvCreateActions()
   anAction->setStatusTip("");
   registerAction(FindDataId, anAction);
   new pqDataQueryReaction(anAction);
-
+  
   // Change Input
   anAction = new QAction(tr("MEN_CHANGE_INPUT"), this);
   anAction->setToolTip(tr("TOP_CHANGE_INPUT"));
@@ -245,7 +245,7 @@ void PVGUI_Module::pvCreateActions()
   anAction->setStatusTip(tr("STB_SETTINGS"));
   registerAction(SettingsId, anAction);
   new pqApplicationSettingsReaction(anAction);*/
-
+  
   // View Settings
 //  anAction = new QAction(tr("MEN_VIEW_SETTINGS"), this);
 //  anAction->setToolTip(tr("TOP_VIEW_SETTINGS"));
@@ -257,7 +257,7 @@ void PVGUI_Module::pvCreateActions()
   //pqViewManager* viewManager = qobject_cast<pqViewManager*>(
   //                             pqApplicationCore::instance()->manager("MULTIVIEW_WIDGET"));
 
-  //rnv: Commented to implement issue
+  //rnv: Commented to implement issue 
   //21318: EDF 1615 ALL: Display in full screen mode
   //Switching to the "Full screen" mode added in the SALOME GUI module.
   //if (viewManager) {
@@ -343,20 +343,17 @@ void PVGUI_Module::pvCreateActions()
   registerAction(TimerLogId, anAction);
   new pqTimerLogReaction(anAction << pqSetName("actionToolsTimerLog"));
 
-  // Output Window
-  anAction = new QAction(tr("MEN_OUTPUT_WINDOW"), this);
-  anAction->setToolTip(tr("TOP_OUTPUT_WINDOW"));
-  anAction->setStatusTip(tr("STB_OUTPUT_WINDOW"));
-  registerAction(OutputWindowId, anAction);
-  anAction << pqSetName("actionToolsOutputWindow");
-  connect(anAction, SIGNAL(triggered()), pqApplicationCore::instance(), SLOT(showOutputWindow()));
-
- // Python Shell
+  // Python Shell
+  // ???
+  // No more pqPythonShellReaction class, but there is a pqPythonShell class.
+  // Is that equivalent? I don't know what to do at this stage.
   anAction = new QAction(tr("MEN_PYTHON_SHELL"), this);
   anAction->setToolTip(tr("TOP_PYTHON_SHELL"));
   anAction->setStatusTip(tr("STB_PYTHON_SHELL"));
   registerAction(PythonShellId, anAction);
+  /*
   new pqPythonShellReaction(anAction << pqSetName("actionToolsPythonShell"));
+  */
 
   //Show Trace
   anAction = new QAction(tr("MEN_SHOW_TRACE"), this);
@@ -396,14 +393,14 @@ void PVGUI_Module::pvCreateActions()
   \brief Create menus for ParaView GUI operations
   duplicating menus in pqMainWindow ParaView class
 
-  In particular, ParaView is responsible for updating "Sources" and "Filters" menus.
+  In particular, ParaView is responsible for updating "Sources" and "Filters" menus. 
   For this, specific menu managers created by pqMainWindowCore class are used, and PVGUI_Module
   is responsible for creation of corresponding QMenu objects only.
 */
 void PVGUI_Module::pvCreateMenus()
 {
   SUIT_Desktop* desk = application()->desktop();
-
+  
   // --- Menu "File"
   int aPVMnu = createMenu( tr( "MEN_DESK_FILE" ), -1, -1 );
 
@@ -412,7 +409,7 @@ void PVGUI_Module::pvCreateMenus()
   // Recent Files
    myRecentMenuId = createMenu( tr( "MEN_RECENT_FILES" ), aPVMnu, -1, 5 );
    QMenu* aMenu = menuMgr()->findMenu( myRecentMenuId );
-   pqRecentFilesMenu* aRecentFilesMenu = new pqRecentFilesMenu( *aMenu, getApp()->desktop() );
+   /*pqRecentFilesMenu* aRecentFilesMenu = */new pqRecentFilesMenu( *aMenu, getApp()->desktop() );
    QList<QAction*> anActns = aMenu->actions();
    for (int i = 0; i < anActns.size(); ++i)
      createMenu( anActns.at(i), myRecentMenuId );
@@ -462,30 +459,23 @@ void PVGUI_Module::pvCreateMenus()
   aPVMnu = createMenu( tr( "MEN_DESK_VIEW" ), -1, -1 );
 
   createMenu( FullScreenId, aPVMnu );
-
+  
   // --- Menu "Sources"
   // Install ParaView managers for "Sources" menu
   QMenu* aRes = 0;
   PVViewer_GUIElements * guiElements = PVViewer_GUIElements::GetInstance(desk);
   aRes = guiElements->getSourcesMenu();
   mySourcesMenuId = createMenu( tr( "MEN_DESK_SOURCES" ), -1, -1, 60, -1, aRes);
-
+  
   // --- Menu "Filters"
   // Install ParaView managers for "Filters" menu
   aRes = guiElements->getFiltersMenu();
   myFiltersMenuId = createMenu( tr( "MEN_DESK_FILTERS" ), -1, -1, 70, -1, aRes);
 
-  // --- Menu "Catalyst"
-  // Install ParaView managers for "Catalyst" menu
-#ifdef PVCATALYST_ENABLED
-  aRes = guiElements->getCatalystMenu();
-  myCatalystMenuId = createMenu( tr( "MEN_DESK_CATALYST" ), -1, -1, 75, -1, aRes);
-#endif
-
    // --- Menu "Macros"
   aRes = guiElements->getMacrosMenu();
   myMacrosMenuId = createMenu( tr( "MEN_MACROS" ), -1, -1, 80, -1, aRes);
-
   // --- Menu "Tools"
   int aToolsMnu = createMenu( tr( "MEN_DESK_TOOLS" ), -1, -1, 90 );
 
@@ -504,7 +494,6 @@ void PVGUI_Module::pvCreateMenus()
   createMenu( separator(), aToolsMnu );
 
   createMenu( TimerLogId, aToolsMnu );
-  createMenu( OutputWindowId, aToolsMnu );
   createMenu( separator(), aToolsMnu );
 
   createMenu( PythonShellId, aToolsMnu );
@@ -512,10 +501,15 @@ void PVGUI_Module::pvCreateMenus()
   createMenu( ShowTraceId, aToolsMnu );
   createMenu( RestartTraceId, aToolsMnu );
 
+  // --- Menu "Catalyst"
+  aRes = guiElements->getCatalystMenu();
+  myCatalystMenuId = createMenu( tr( "MEN_DESK_CATALYST" ), -1, -1, 100, -1, aRes);
+
   // --- Menu "Help"
 
   int aHelpMnu = createMenu( tr( "MEN_DESK_HELP" ), -1, -1 );
-  int aPVHelpMnu = createMenu( tr( "ParaViS module" ), aHelpMnu, -1, 0 );
+  int aUsersGuide = createMenu( tr( "User's Guide" ), aHelpMnu, -1 );
+  int aPVHelpMnu = createMenu( tr( "ParaViS module" ), aUsersGuide, -1, 5 );
 #ifdef HAS_PV_DOC
   createMenu( ParaViewHelpId,  aPVHelpMnu );
   createMenu( separator(),     aPVHelpMnu );
@@ -524,7 +518,7 @@ void PVGUI_Module::pvCreateMenus()
 
   // -- Context menu in the pipeline browser
   pqPipelineBrowserWidget * pq = guiElements->getPipelineBrowserWidget();
-  pqParaViewMenuBuilders::buildPipelineBrowserContextMenu( *pq );
+  pqParaViewMenuBuilders::buildPipelineBrowserContextMenu( *(pq->contextMenu()) );
 }
 
 /*!