ADD_SUBDIRECTORY (src/HYDROData)
ADD_SUBDIRECTORY (src/HYDROGUI)
ADD_SUBDIRECTORY (src/HYDROPy)
-#IF(SALOME_BUILD_DOC)
+IF(SALOME_BUILD_DOC)
ADD_SUBDIRECTORY(doc)
-#ENDIF()
+ENDIF()
# Header configuration
# ====================
HYDROGUI_PrsZoneDriver.h
HYDROGUI_Region.h
HYDROGUI_RemoveImageRefsOp.h
- HYDROGUI_RunBrowser.h
HYDROGUI_Shape.h
HYDROGUI_ShowHideOp.h
HYDROGUI_StreamDlg.h
HYDROGUI_PrsZoneDriver.cxx
HYDROGUI_Region.cxx
HYDROGUI_RemoveImageRefsOp.cxx
- HYDROGUI_RunBrowser.cxx
HYDROGUI_Shape.cxx
HYDROGUI_ShowHideOp.cxx
HYDROGUI_StreamDlg.cxx
#include "HYDROGUI_InputPanel.h"
#include "HYDROGUI_Module.h"
-#include "HYDROGUI_RunBrowser.h"
#include <CAM_Application.h>
#include <SUIT_Desktop.h>
void HYDROGUI_InputPanel::onHelp()
{
- QString aModuleName = myModule->moduleName();
-
- QString aPagePath = HYDROGUI_RunBrowser::getPagePath( aModuleName );
-
- QString aPageName = "";
- QString aWindowTitle = windowTitle();
- if ( !aWindowTitle.isEmpty() )
- {
- aPageName = QStringList( aWindowTitle.split( " " ) ).join( "_" ).append( ".html" );
- aPageName.toLower();
- }
-
- QString aPage = aPagePath + QDir::separator() + aPageName;
- HYDROGUI_RunBrowser::showPage( myModule->getApp(), aPage );
+ emit panelHelp();
}
void HYDROGUI_InputPanel::closeEvent ( QCloseEvent * event )
signals:
void panelApply();
void panelCancel();
+ void panelHelp();
protected slots:
void onApply();
myModule( theModule ),
myPanel( 0 )
{
+ connect( this, SIGNAL( helpContextModule( const QString&, const QString&,
+ const QString& ) ),
+ theModule->application(), SLOT( onHelpContextModule( const QString&,
+ const QString&, const QString& ) ) );
}
HYDROGUI_Operation::~HYDROGUI_Operation()
( ( HYDROGUI_Operation* )this )->myPanel = createInputPanel();
connect( myPanel, SIGNAL( panelApply() ), this, SLOT( onApply() ) );
connect( myPanel, SIGNAL( panelCancel() ), this, SLOT( onCancel() ) );
+ connect( myPanel, SIGNAL( panelHelp() ), this, SLOT( onHelp() ) );
}
return myPanel;
}
processCancel();
abort();
}
+
+void HYDROGUI_Operation::onHelp()
+{
+ emit helpContextModule( getHelpComponent(), getHelpFile(), getHelpContext() );
+}
+
+QString HYDROGUI_Operation::getHelpComponent() const
+{
+ return module()->moduleName();
+}
+
+QString HYDROGUI_Operation::getHelpFile() const
+{
+ QString aFileName = ((myName.isEmpty())? operationName() : myName);
+ return aFileName.replace(QRegExp("\\s"), "_").append(".html");
+}
+
+QString HYDROGUI_Operation::getHelpContext() const
+{
+ return QString();
+}
+
+
SUIT_SelectionMgr* selectionMgr() const;
HYDROGUI_Module* module() const;
+signals:
+ void helpContextModule( const QString&, const QString&, const QString& );
protected:
virtual void startOperation();
virtual void abortOperation();
protected slots:
virtual void onApply();
virtual void onCancel();
+ virtual void onHelp();
+
+protected:
+ QString getHelpComponent() const;
+ QString getHelpFile() const;
+ QString getHelpContext() const;
private:
HYDROGUI_Module* myModule;
+++ /dev/null
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-
-#include <HYDROGUI_RunBrowser.h>
-
-#include <QFileInfo>
-#include <QProcess>
-#include <QApplication>
-#include <QDir>
-
-#include <LightApp_Application.h>
-
-#include <QtxWebBrowser.h>
-#include <SUIT_MessageBox.h>
-#include <SUIT_ResourceMgr.h>
-#include <SUIT_Desktop.h>
-
-#include <SALOME_Event.h>
-
-HYDROGUI_RunBrowser::HYDROGUI_RunBrowser( LightApp_Application* app,
- const QString& theApp,
- const QString& theParams,
- const QString& theHelpFile,
- const QString& theContext )
-: myApp( theApp ),
- myParams( theParams ),
- myContext( theContext ),
- myStatus(0),
- myLApp( app )
-{
- //For the external browser always specify 'file://' protocol,
- //because some WEB browsers (for example Mozilla Firefox) can't open local file without protocol.
- myHelpFile = QString("file://%1").arg( QFileInfo( theHelpFile ).canonicalFilePath() );
-}
-
-void HYDROGUI_RunBrowser::run()
-{
- if ( !myApp.isEmpty() && !myHelpFile.isEmpty()) {
- QString aCommand = QString( "%1 %2 \"%3%4\"" ).arg( myApp, myParams, myHelpFile, myContext.isEmpty() ? QString("") : QString( "#%1" ).arg( myContext ) );
-
- QProcess* proc = new QProcess();
-
- //proc->start( aCommand );
- if ( true || !proc->waitForStarted() ) {
- SALOME_CustomEvent* ce2000 = new SALOME_CustomEvent( 2000 );
- QString* msg = new QString( QObject::tr( "EXTERNAL_BROWSER_CANNOT_SHOW_PAGE" ).arg( myApp, myHelpFile ) );
- ce2000->setData( msg );
- QApplication::postEvent( myLApp, ce2000 );
- }
- }
-}
-
-void HYDROGUI_RunBrowser::showPage( LightApp_Application* theApp,
- const QString& thePage )
-{
- SUIT_ResourceMgr* resMgr = theApp->resourceMgr();
- QString platform;
-#ifdef WIN32
- platform = "winapplication";
-#else
- platform = "application";
-#endif
- QString anApp = resMgr->stringValue( "ExternalBrowser", platform );
-#ifdef WIN32
- QString quote( "\"" );
- anApp.prepend( quote );
- anApp.append( quote );
-#endif
- QString aParams = resMgr->stringValue( "ExternalBrowser", "parameters" );
- bool useExtBrowser = resMgr->booleanValue( "ExternalBrowser", "use_external_browser", false );
-
- if( useExtBrowser ) {
- if ( !anApp.isEmpty() ) {
- HYDROGUI_RunBrowser* rs = new HYDROGUI_RunBrowser( theApp, anApp, aParams, thePage );
- rs->start();
- }
- else
- SUIT_MessageBox::warning(theApp->desktop(), tr( "WRN_WARNING" ), tr( "WRN_DEFINE_EXTERNAL_BROWSER" ));
- }
- else {
-#ifdef WIN32
- // On Win32 platform QWebKit of the Qt 4.6.3 hang up in case 'file://' protocol
- // is defined. On Linux platform QWebKit doesn't work correctly without 'file://' protocol.
- QtxWebBrowser::loadUrl( thePage );
-#else
- QtxWebBrowser::loadUrl( QString( "file://%1" ).arg( helpFile ) );
-#endif
- }
-}
-
-QString HYDROGUI_RunBrowser::getPagePath( const QString& theModuleName )
-{
- QString aPagePath;
-
- QString rootDir = QString( "%1_ROOT_DIR" ).arg( theModuleName ); // module root dir variable
- QString modDir = getenv( rootDir.toLatin1().constData() ); // module root dir
- if ( !modDir.isEmpty() ) {
- QStringList idxLst = QStringList() << modDir << "share" << "doc" << "salome"
- << "gui" << theModuleName;
- QString indexFile = idxLst.join( QDir::separator() ); // index file
- if ( QFile::exists( indexFile ) )
- aPagePath = indexFile;
- }
- return aPagePath;
-}
+++ /dev/null
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-
-#ifndef HYDROGUI_HYDROGUI_RunBrowser_H
-#define HYDROGUI_HYDROGUI_RunBrowser_H
-
-#include <QThread>
-
-class LightApp_Application;
-
-/*!
- \class HYDROGUI_RunBrowser
- Runs system command in separate thread
-*/
-class HYDROGUI_RunBrowser : public QThread
-{
-public:
- HYDROGUI_RunBrowser( LightApp_Application* app,
- const QString& theApp,
- const QString& theParams,
- const QString& theHelpFile,
- const QString& theContext = QString() );
- ~HYDROGUI_RunBrowser() {}
-
- virtual void run();
-
- static void showPage( LightApp_Application* theApp,
- const QString& thePage );
-
- static QString getPagePath( const QString& theModuleName );
-
-private:
- QString myApp;
- QString myParams;
- QString myHelpFile;
- QString myContext;
- int myStatus;
- LightApp_Application* myLApp;
-};
-
-#endif