summaryrefslogtreecommitdiff
path: root/src/browser
diff options
context:
space:
mode:
Diffstat (limited to 'src/browser')
-rw-r--r--src/browser/UserManual.py22
-rw-r--r--src/browser/Welcome.py17
2 files changed, 22 insertions, 17 deletions
diff --git a/src/browser/UserManual.py b/src/browser/UserManual.py
index f31af29d..e723680a 100644
--- a/src/browser/UserManual.py
+++ b/src/browser/UserManual.py
@@ -1,28 +1,28 @@
-from PyQt4 import QtGui
+from PyQt5 import QtWidgets
import subprocess
-import platform
import os
-class UserManual(QtGui.QWidget):
+class UserManual(QtWidgets.QWidget):
"""
This class opens User-Manual page in new tab of web browser
when help button is clicked.
"""
def __init__(self):
- QtGui.QWidget.__init__(self)
+ QtWidgets.QWidget.__init__(self)
- self.vlayout = QtGui.QVBoxLayout()
+ self.vlayout = QtWidgets.QVBoxLayout()
- file = os.path.realpath(
- 'library/browser/User-Manual/eSim_Manual_2019_Dec_31.pdf'
- )
+ manual = 'library/browser/User-Manual/eSim_Manual_2.1.pdf'
- if 'Win' in platform.system():
- os.startfile(file)
+ if os.name == 'nt':
+ os.startfile(os.path.realpath(manual))
else:
- subprocess.Popen(['xpdf.real', file], shell=False)
+ manual_path = '../../' + manual
+ subprocess.Popen(
+ ['xdg-open', os.path.realpath(manual_path)], shell=False
+ )
self.setLayout(self.vlayout)
self.show()
diff --git a/src/browser/Welcome.py b/src/browser/Welcome.py
index 69584f10..f864a21f 100644
--- a/src/browser/Welcome.py
+++ b/src/browser/Welcome.py
@@ -1,19 +1,24 @@
-from PyQt4 import QtGui, QtCore
+from PyQt5 import QtCore, QtWidgets
+import os
-class Welcome(QtGui.QWidget):
+class Welcome(QtWidgets.QWidget):
"""
This class contains content of dock area part of initial esim Window.
It creates Welcome page of eSim.
"""
def __init__(self):
- QtGui.QWidget.__init__(self)
- self.vlayout = QtGui.QVBoxLayout()
+ QtWidgets.QWidget.__init__(self)
+ self.vlayout = QtWidgets.QVBoxLayout()
+ self.browser = QtWidgets.QTextBrowser()
+
+ init_path = '../../'
+ if os.name == 'nt':
+ init_path = ''
- self.browser = QtGui.QTextBrowser()
self.browser.setSource(QtCore.QUrl(
- "library/browser/welcome.html")
+ init_path + "library/browser/welcome.html")
)
self.browser.setOpenExternalLinks(True)
self.browser.setVerticalScrollBarPolicy(QtCore.Qt.ScrollBarAlwaysOff)