ADD_SUBDIRECTORY (src/HYDROData)
ADD_SUBDIRECTORY (src/HYDROGUI)
ADD_SUBDIRECTORY (src/HYDROPy)
-IF(SALOME_BUILD_DOC)
- #ADD_SUBDIRECTORY(doc)
-ENDIF()
+#IF(SALOME_BUILD_DOC)
+ ADD_SUBDIRECTORY(doc)
+#ENDIF()
# Header configuration
# ====================
--- /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
+#
+
+ADD_SUBDIRECTORY(salome)
--- /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
+#
+
+ADD_SUBDIRECTORY(gui)
--- /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
+#
+
+ADD_SUBDIRECTORY(HYDRO)
--- /dev/null
+# Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+#
+# 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
+#
+
+SET(docdir ${CMAKE_INSTALL_PREFIX}/share/doc/salome)
+FILE(GLOB files "${CMAKE_CURRENT_SOURCE_DIR}/*.py")
+INSTALL(FILES ${files} DESTINATION ${docdir}/gui/HYDRO)
+
--- /dev/null
+<!-- HTML header for doxygen 1.8.3.1-->
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<head></head>
+<body>
+
+<p>Create Polyline help page</p>
+
+</body>
+</html>
--- /dev/null
+<!-- HTML header for doxygen 1.8.3.1-->
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<head></head>
+<body>
+
+<p>Create Profile help page</p>
+
+</body>
+</html>
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>
#include <QLayout>
#include <QPushButton>
+#include <QDir>
HYDROGUI_InputPanel::HYDROGUI_InputPanel( HYDROGUI_Module* theModule, const QString& theTitle, bool doInitLayout )
: QDockWidget( theModule->application()->desktop() ),
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 );
}
void HYDROGUI_InputPanel::closeEvent ( QCloseEvent * event )
--- /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
</message>
</context>
+
+ <context>
+ <name>HYDROGUI_RunBrowser</name>
+ <message>
+ <source>EXTERNAL_BROWSER_CANNOT_SHOW_PAGE</source>
+ <translation>External browser "%1" can not show help page "%2". You could change it in preferences.</translation>
+ </message>
+ <message>
+ <source>WRN_DEFINE_EXTERNAL_BROWSER</source>
+ <translation>External browser is not found. Do you want to define it in preferences?</translation>
+ </message>
+ </context>
+
</TS>