diff --git a/src/View/Doc/Window.py b/src/View/Doc/Window.py
index 4be981b8..e197e566 100644
--- a/src/View/Doc/Window.py
+++ b/src/View/Doc/Window.py
@@ -20,18 +20,16 @@ import os, sys
import logging
import subprocess
+from PyQt5.QtCore import QUrl
+from PyQt5.QtGui import QDesktopServices
+from PyQt5.QtWidgets import QApplication, QWidget, QVBoxLayout, QAction
+from PyQt5.QtWebEngineWidgets import QWebEngineView, QWebEngineSettings
+
from View.Tools.PamhyrWindow import PamhyrWindow
-from PyQt5.QtCore import QCoreApplication
-
-_translate = QCoreApplication.translate
logger = logging.getLogger()
-from PyQt5.QtWidgets import QApplication, QWidget, QVBoxLayout, QAction
-from PyQt5.QtCore import QUrl
-from PyQt5.QtWebEngineWidgets import QWebEngineView, QWebEngineSettings
-
class DocWindow(PamhyrWindow):
_pamhyr_ui = "WebView"
_pamhyr_name = "Doc"
@@ -62,7 +60,6 @@ class DocWindow(PamhyrWindow):
config = config,
options = [],
parent = parent
-
)
self._path = self._path_file(filename)
@@ -75,7 +72,7 @@ class DocWindow(PamhyrWindow):
self.findChild(QAction, "action_back").triggered.connect(self.back)
self.findChild(QAction, "action_forward").triggered.connect(self.forward)
- self.findChild(QAction, "action_firefox").triggered.connect(self.open_in_firefox)
+ self.findChild(QAction, "action_open").triggered.connect(self.open)
def setup_web_engine(self):
@@ -99,8 +96,6 @@ class DocWindow(PamhyrWindow):
def forward(self):
self._web_view.forward()
- def open_in_firefox(self):
- _ = subprocess.Popen(
- f"firefox {self._path}",
- shell = True
- )
+ def open(self):
+ url = QUrl(f"file://{self._path}")
+ QDesktopServices.openUrl(url)
diff --git a/src/View/ui/WebView.ui b/src/View/ui/WebView.ui
index 7d0a41bf..225c5948 100644
--- a/src/View/ui/WebView.ui
+++ b/src/View/ui/WebView.ui
@@ -13,6 +13,9 @@
MainWindow
+
+
+
-
@@ -43,11 +46,11 @@
-
+
-
+
- Firefox
+ Open
Open document in Firefox