From af3a400bcaade28f6d60565fbf3eca82af0ee704 Mon Sep 17 00:00:00 2001 From: mkr Date: Thu, 25 Dec 2008 14:22:03 +0000 Subject: [PATCH] Corrections for 1) the server connection saving, 2) adding the native paraview user documentation in the Help menu. --- src/PVGUI/PVGUI_Module.cxx | 28 +++++++++++++++++++++++-- src/PVGUI/PVGUI_Module.h | 3 +++ src/PVGUI/PVGUI_Module_actions.cxx | 17 ++++++++------- src/PVGUI/PVGUI_ProcessModuleHelper.cxx | 9 ++++++++ src/PVGUI/PVGUI_ProcessModuleHelper.h | 2 ++ src/PVGUI/resources/PARAVIS_images.ts | 4 ++++ src/PVGUI/resources/PARAVIS_msg_en.ts | 6 +++--- 7 files changed, 56 insertions(+), 13 deletions(-) diff --git a/src/PVGUI/PVGUI_Module.cxx b/src/PVGUI/PVGUI_Module.cxx index 0a558e42..ddec75c9 100644 --- a/src/PVGUI/PVGUI_Module.cxx +++ b/src/PVGUI/PVGUI_Module.cxx @@ -373,11 +373,12 @@ bool PVGUI_Module::pvInit() } /*! - \brief Static method, cleans up ParaView session at application exit. Not yet implemented. + \brief Static method, cleans up ParaView session at application exit. */ void PVGUI_Module::pvShutdown() { - // TODO... + if ( pqImplementation::myPVHelper ) + pqImplementation::myPVHelper->finalize(); } /*! @@ -549,6 +550,14 @@ void PVGUI_Module::onHelpAbout() dialog->show(); } +/*! + \brief Slot to show native ParaView user documentation. +*/ +void PVGUI_Module::onParaViewHelp() +{ + showHelpForProxy("index"); +} + /*! \brief Slot to show help for proxy. */ @@ -810,6 +819,21 @@ bool PVGUI_Module::deactivateModule( SUIT_Study* study ) return LightApp_Module::deactivateModule( study ); } +/*! + \brief Called when application is closed. + + Process finalize application functionality from ParaView in order to save server settings + and nullify application pointer if the application is being closed. + + \param theApp application +*/ +void PVGUI_Module::onApplicationClosed( SUIT_Application* theApp ) +{ + pvShutdown(); + + CAM_Module::onApplicationClosed(theApp); +} + /*! \brief Compares the contents of the window with the given reference image, returns true if they "match" within some tolerance. diff --git a/src/PVGUI/PVGUI_Module.h b/src/PVGUI/PVGUI_Module.h index f6802684..09454237 100644 --- a/src/PVGUI/PVGUI_Module.h +++ b/src/PVGUI/PVGUI_Module.h @@ -218,6 +218,8 @@ private slots: void onHelpAbout(); + void onParaViewHelp(); + void showHelpForProxy( const QString& proxy ); void makeAssistant(); void assistantError( const QString& err ); @@ -229,6 +231,7 @@ private slots: public slots: virtual bool activateModule( SUIT_Study* ); virtual bool deactivateModule( SUIT_Study* ); + virtual void onApplicationClosed( SUIT_Application* ); private: class pqImplementation; diff --git a/src/PVGUI/PVGUI_Module_actions.cxx b/src/PVGUI/PVGUI_Module_actions.cxx index c2469df2..38d55b4f 100644 --- a/src/PVGUI/PVGUI_Module_actions.cxx +++ b/src/PVGUI/PVGUI_Module_actions.cxx @@ -525,8 +525,11 @@ void PVGUI_Module::pvCreateActions() tr( "MEN_ABOUT" ), tr( "STB_ABOUT" ), 0, desk, false, this, SLOT( onHelpAbout() ) ); - // ParaView Help - // TODO... + // Native ParaView user documentation + aPixmap = resMgr->loadPixmap( "ParaView", tr("ICON_PARAVIEW_HELP"), false ); + createAction( ParaViewHelpId, tr( "TOP_PARAVIEW_HELP" ), QIcon(aPixmap), + tr( "MEN_PARAVIEW_HELP" ), tr( "STB_PARAVIEW_HELP" ), + 0, desk, false, this, SLOT( onParaViewHelp() ) ); // Enable Tooltips aQtxAction = new QtxAction( tr("TOP_ENABLE_TOOLTIPS"), QIcon(), @@ -690,11 +693,9 @@ void PVGUI_Module::pvCreateMenus() int aHelpMnu = createMenu( tr( "MEN_DESK_HELP" ), -1, -1 ); createMenu( AboutParaViewId, aHelpMnu ); - // ParaView Help - // It's needed to install module docs into _ROOT_DIR/share/doc/salome/gui/ - // createMenu( ParaViewHelpId, aHelpMnu ); - createMenu( EnableTooltipsId, aHelpMnu ); + createMenu( ParaViewHelpId, aHelpMnu ); createMenu( separator(), aHelpMnu ); + createMenu( EnableTooltipsId, aHelpMnu ); } @@ -719,8 +720,8 @@ void PVGUI_Module::pvCreateToolBars() createTool( separator(), aToolId ); createTool( ConnectId, aToolId ); createTool( DisconnectId, aToolId ); - //createTool( separator(), aToolId ); - //createTool( ParaViewHelpId, aToolId ); + createTool( separator(), aToolId ); + createTool( ParaViewHelpId, aToolId ); // --- Toolbar "Selection Controls" diff --git a/src/PVGUI/PVGUI_ProcessModuleHelper.cxx b/src/PVGUI/PVGUI_ProcessModuleHelper.cxx index 642c46ac..deb210cf 100644 --- a/src/PVGUI/PVGUI_ProcessModuleHelper.cxx +++ b/src/PVGUI/PVGUI_ProcessModuleHelper.cxx @@ -89,6 +89,15 @@ void PVGUI_ProcessModuleHelper::hideWindow() { } +//----------------------------------------------------------------------------- +/*! + \brief Finalize application in order to save server settings. +*/ +void PVGUI_ProcessModuleHelper::finalize() +{ + this->FinalizeApplication(); +} + //----------------------------------------------------------------------------- /*! \brief Calls the base implementation and redirects ParaView output to PVGUI_OutputWindowAdapter instance. diff --git a/src/PVGUI/PVGUI_ProcessModuleHelper.h b/src/PVGUI/PVGUI_ProcessModuleHelper.h index 87bc3aca..b59089a2 100644 --- a/src/PVGUI/PVGUI_ProcessModuleHelper.h +++ b/src/PVGUI/PVGUI_ProcessModuleHelper.h @@ -50,6 +50,8 @@ public: virtual void showWindow(); virtual void hideWindow(); + void finalize(); + protected: virtual int InitializeApplication(int argc, char** argv); diff --git a/src/PVGUI/resources/PARAVIS_images.ts b/src/PVGUI/resources/PARAVIS_images.ts index 5609995b..ad8b3c3f 100644 --- a/src/PVGUI/resources/PARAVIS_images.ts +++ b/src/PVGUI/resources/PARAVIS_images.ts @@ -149,6 +149,10 @@ ICON_LOOP pqVcrLoop24.png + + ICON_PARAVIEW_HELP + pqHelp24.png + diff --git a/src/PVGUI/resources/PARAVIS_msg_en.ts b/src/PVGUI/resources/PARAVIS_msg_en.ts index 530fa16c..7b2559f5 100644 --- a/src/PVGUI/resources/PARAVIS_msg_en.ts +++ b/src/PVGUI/resources/PARAVIS_msg_en.ts @@ -1013,15 +1013,15 @@ TOP_PARAVIEW_HELP - ParaView Help + ParaView User Documentation MEN_PARAVIEW_HELP - ParaView Help + ParaView User Documentation STB_PARAVIEW_HELP - ParaView Help + ParaView User Documentation reference TOP_ENABLE_TOOLTIPS -- 2.39.2