diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 7f2aecdf..7b58f4f4 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -98,6 +98,8 @@ build-users-doc:
artifacts:
paths:
- doc/users/documentation.pdf
+ - doc/users/documentation.html
+ - doc/users/images/
build-developers-doc:
stage: build
@@ -121,6 +123,7 @@ build-developers-doc:
- doc/dev/documentation.pdf
- doc/dev/documentation.html
- doc/dev/html.tar
+ - doc/dev/images/
build-linux:
stage: build
diff --git a/doc/users/images/.gitkeep b/doc/users/images/.gitkeep
new file mode 100644
index 00000000..e69de29b
diff --git a/src/View/Doc/Window.py b/src/View/Doc/Window.py
new file mode 100644
index 00000000..73416322
--- /dev/null
+++ b/src/View/Doc/Window.py
@@ -0,0 +1,70 @@
+# Window.py -- Pamhyr
+# Copyright (C) 2023 INRAE
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program 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 General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see .
+
+# -*- coding: utf-8 -*-
+
+import os
+import logging
+
+from View.Tools.PamhyrWindow import PamhyrWindow
+
+from PyQt5.QtCore import QCoreApplication
+
+_translate = QCoreApplication.translate
+logger = logging.getLogger()
+
+
+from PyQt5.QtWidgets import QApplication, QWidget
+from PyQt5.QtCore import QUrl
+from PyQt5.QtWebKitWidgets import QWebView
+from PyQt5.QtWebKit import QWebSettings
+
+class DocWindow(PamhyrWindow):
+ _pamhyr_ui = "WebView"
+ _pamhyr_name = "Doc"
+
+ def _path_file(self, filename):
+ return os.path.abspath(
+ os.path.join(
+ os.path.dirname(__file__),
+ "..", "..", "..", "doc", filename
+ )
+ )
+
+ def __init__(self, filename=None,
+ study=None, config=None,
+ parent=None):
+ super(DocWindow, self).__init__(
+ title = self._pamhyr_name,
+ study = study,
+ config = config,
+ options = [],
+ parent = parent
+
+ )
+
+ self.setup_setting()
+ self.setup_url(filename)
+
+ def setup_url(self, filename):
+ webView = self.find(QWebView, "webView")
+ webView.setUrl(QUrl(f"file://{self._path_file(filename)}"))
+
+ def setup_setting(self):
+ webView = self.find(QWebView, "webView")
+ settings = webView.settings()
+ settings.setAttribute(QWebSettings.PluginsEnabled, True)
+ settings.setAttribute(QWebSettings.JavascriptEnabled, False)
diff --git a/src/View/MainWindow.py b/src/View/MainWindow.py
index 23c26b51..f304c144 100644
--- a/src/View/MainWindow.py
+++ b/src/View/MainWindow.py
@@ -56,6 +56,7 @@ from View.SolverParameters.Window import SolverParametersWindow
from View.RunSolver.Window import SelectSolverWindow, SolverLogWindow
from View.CheckList.Window import CheckListWindow
from View.Results.Window import ResultsWindow
+from View.Doc.Window import DocWindow
from View.Debug.Window import ReplWindow
from Model.Study import Study
@@ -183,6 +184,8 @@ class ApplicationWindow(QMainWindow, ListedSubWindow, WindowToolKit):
"action_menu_sediment_layers": self.open_sediment_layers,
"action_menu_edit_reach_sediment_layers": self.open_reach_sediment_layers,
"action_menu_results_last": self.open_last_results,
+ "action_menu_Pamhyr": self.open_doc_user,
+ "action_menu_Pamhyr_dev": self.open_doc_dev,
## Help
"action_menu_about": self.open_about,
# ToolBar action
@@ -715,6 +718,20 @@ class ApplicationWindow(QMainWindow, ListedSubWindow, WindowToolKit):
self.open_solver_results(self._last_solver, self._last_results)
+ def open_doc(self, filename):
+ doc = DocWindow(
+ filename = filename,
+ parent = self
+ )
+ doc.show()
+
+
+ def open_doc_user(self):
+ self.open_doc("Pamhyr2-users.html")
+
+ def open_doc_dev(self):
+ self.open_doc("Pamhyr2-dev.html")
+
#########
# DEBUG #
#########
diff --git a/src/View/ui/MainWindow.ui b/src/View/ui/MainWindow.ui
index 7578d600..9fd3b229 100644
--- a/src/View/ui/MainWindow.ui
+++ b/src/View/ui/MainWindow.ui
@@ -160,8 +160,15 @@
&Help
-
-
+
+
diff --git a/src/View/ui/WebView.ui b/src/View/ui/WebView.ui
new file mode 100644
index 00000000..d29a0c89
--- /dev/null
+++ b/src/View/ui/WebView.ui
@@ -0,0 +1,50 @@
+
+
+ MainWindow
+
+
+
+ 0
+ 0
+ 640
+ 480
+
+
+
+ MainWindow
+
+
+
+ -
+
+
+
+ about:blank
+
+
+
+
+
+
+
+
+
+
+
+ QWebView
+ QWidget
+
+
+
+
+
+