From aa3e439b33682dc9fc1a604e4522cd44b75312d0 Mon Sep 17 00:00:00 2001 From: mkr Date: Thu, 23 Mar 2006 15:11:52 +0000 Subject: [PATCH] Add function for help context module. --- src/LightApp/LightApp_Application.cxx | 25 +++++++++++++++++++++++++ src/LightApp/LightApp_Application.h | 1 + 2 files changed, 26 insertions(+) diff --git a/src/LightApp/LightApp_Application.cxx b/src/LightApp/LightApp_Application.cxx index 799db0056..2d44578c7 100644 --- a/src/LightApp/LightApp_Application.cxx +++ b/src/LightApp/LightApp_Application.cxx @@ -892,6 +892,31 @@ void LightApp_Application::onHelpContentsModule() } } +//======================================================================= +// name : onHelpContextModule +/*! Purpose : SLOT. Display help contents for choosen dialog*/ +//======================================================================= +void LightApp_Application::onHelpContextModule(const QString& theComponentName, const QString& theFileName) +{ + QCString dir = getenv( theComponentName + "_ROOT_DIR"); + QString homeDir = Qtx::addSlash(Qtx::addSlash(dir)+Qtx::addSlash("doc")+Qtx::addSlash("salome")+Qtx::addSlash("gui")+Qtx::addSlash(theComponentName)); + + QString helpFile = QFileInfo( homeDir + theFileName ).absFilePath(); + SUIT_ResourceMgr* resMgr = resourceMgr(); + QString anApp = resMgr->stringValue("ExternalBrowser", "application"); + QString aParams = resMgr->stringValue("ExternalBrowser", "parameters"); + + if (!anApp.isEmpty()) { + RunBrowser* rs = new RunBrowser(anApp, aParams, helpFile); + rs->start(); + } + else { + SUIT_MessageBox::warn1(desktop(), tr("WRN_WARNING"), + tr("DEFINE_EXTERNAL_BROWSER"), + tr("BUT_OK")); + } +} + /*!Sets enable or disable some actions on selection changed.*/ void LightApp_Application::onSelectionChanged() { diff --git a/src/LightApp/LightApp_Application.h b/src/LightApp/LightApp_Application.h index a85a2e7cf..3f57fd09e 100644 --- a/src/LightApp/LightApp_Application.h +++ b/src/LightApp/LightApp_Application.h @@ -136,6 +136,7 @@ signals: public slots: virtual void onHelpContentsModule(); + virtual void onHelpContextModule( const QString&, const QString& ); virtual void onNewDoc(); virtual void onOpenDoc(); virtual void onHelpAbout(); -- 2.39.2