Helpviewer/Network/EricAccessHandler.py

Thu, 10 Jan 2019 14:18:48 +0100

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Thu, 10 Jan 2019 14:18:48 +0100
changeset 6645
ad476851d7e0
parent 6048
82ad8ec9548c
permissions
-rw-r--r--

Updated copyright for 2019.

0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1 # -*- coding: utf-8 -*-
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2
6645
ad476851d7e0 Updated copyright for 2019.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6048
diff changeset
3 # Copyright (c) 2009 - 2019 Detlev Offenbach <detlev@die-offenbachs.de>
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
4 #
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
5
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
6 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
7 Module implementing a scheme access handler for Python resources.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
8 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
9
3145
a9de05d4a22f # __IGNORE_WARNING__ added/ removed.
T.Rzepka <Tobias.Rzepka@gmail.com>
parents: 3057
diff changeset
10 from __future__ import unicode_literals
2525
8b507a9a2d40 Script changes: Future import added, super calls modified and unicode behavior for str.
T.Rzepka <Tobias.Rzepka@gmail.com>
parents: 2403
diff changeset
11
3656
441956d8fce5 Started porting eric5 to PyQt5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3591
diff changeset
12 from PyQt5.QtCore import QFile, QByteArray
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
13
3793
bdaf1b220a36 Fixed an issue in the web browser speed dial displaying 'funny' characters when not using English language.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3656
diff changeset
14 import Utilities
bdaf1b220a36 Fixed an issue in the web browser speed dial displaying 'funny' characters when not using English language.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3656
diff changeset
15
12
1d8dd9706f46 First commit after changing to Python 3.1.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 0
diff changeset
16 from .SchemeAccessHandler import SchemeAccessHandler
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
17
945
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 791
diff changeset
18
1674
7eb92d0bc124 Renamed PyrcAccessHandler to EricAccessHandler.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1670
diff changeset
19 class EricAccessHandler(SchemeAccessHandler):
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
20 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
21 Class implementing a scheme access handler for Python resources.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
22 """
1670
6fd889391d2c Added a Speed Dial to the web browser including the capability to select the first ten pages by pressing Meta+1 to Meta+0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1665
diff changeset
23 _homePage = None
6fd889391d2c Added a Speed Dial to the web browser including the capability to select the first ten pages by pressing Meta+1 to Meta+0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1665
diff changeset
24 _speedDialPage = None
6fd889391d2c Added a Speed Dial to the web browser including the capability to select the first ten pages by pressing Meta+1 to Meta+0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1665
diff changeset
25
945
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 791
diff changeset
26 def createRequest(self, op, request, outgoingData=None):
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
27 """
3591
2f2a4a76dd22 Corrected a bunch of source docu issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3484
diff changeset
28 Public method to create a request.
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
29
3002
6ffc581f00f1 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2403
diff changeset
30 @param op the operation to be performed
6ffc581f00f1 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2403
diff changeset
31 (QNetworkAccessManager.Operation)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
32 @param request reference to the request object (QNetworkRequest)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
33 @param outgoingData reference to an IODevice containing data to be sent
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
34 (QIODevice)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
35 @return reference to the created reply object (QNetworkReply)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
36 """
2403
e3d7a861547c Continued implementing the delayed import.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2302
diff changeset
37 from .NetworkReply import NetworkReply
3002
6ffc581f00f1 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2403
diff changeset
38 from .NetworkProtocolUnknownErrorReply import \
6ffc581f00f1 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2403
diff changeset
39 NetworkProtocolUnknownErrorReply
2403
e3d7a861547c Continued implementing the delayed import.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2302
diff changeset
40
1665
b248526d3a1b Reworked some stuff in the web browser to use Qt resources.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1664
diff changeset
41 if request.url().toString() == "eric:home":
1670
6fd889391d2c Added a Speed Dial to the web browser including the capability to select the first ten pages by pressing Meta+1 to Meta+0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1665
diff changeset
42 return NetworkReply(request, self.__createHomePage(),
6fd889391d2c Added a Speed Dial to the web browser including the capability to select the first ten pages by pressing Meta+1 to Meta+0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1665
diff changeset
43 "text/html", self.parent())
6fd889391d2c Added a Speed Dial to the web browser including the capability to select the first ten pages by pressing Meta+1 to Meta+0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1665
diff changeset
44 elif request.url().toString() == "eric:speeddial":
6fd889391d2c Added a Speed Dial to the web browser including the capability to select the first ten pages by pressing Meta+1 to Meta+0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1665
diff changeset
45 return NetworkReply(request, self.__createSpeedDialPage(),
6fd889391d2c Added a Speed Dial to the web browser including the capability to select the first ten pages by pressing Meta+1 to Meta+0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1665
diff changeset
46 "text/html", self.parent())
6fd889391d2c Added a Speed Dial to the web browser including the capability to select the first ten pages by pressing Meta+1 to Meta+0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1665
diff changeset
47
6fd889391d2c Added a Speed Dial to the web browser including the capability to select the first ten pages by pressing Meta+1 to Meta+0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1665
diff changeset
48 return NetworkProtocolUnknownErrorReply("eric", self.parent())
6fd889391d2c Added a Speed Dial to the web browser including the capability to select the first ten pages by pressing Meta+1 to Meta+0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1665
diff changeset
49
6fd889391d2c Added a Speed Dial to the web browser including the capability to select the first ten pages by pressing Meta+1 to Meta+0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1665
diff changeset
50 def __createHomePage(self):
6fd889391d2c Added a Speed Dial to the web browser including the capability to select the first ten pages by pressing Meta+1 to Meta+0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1665
diff changeset
51 """
6fd889391d2c Added a Speed Dial to the web browser including the capability to select the first ten pages by pressing Meta+1 to Meta+0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1665
diff changeset
52 Private method to create the Home page.
6fd889391d2c Added a Speed Dial to the web browser including the capability to select the first ten pages by pressing Meta+1 to Meta+0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1665
diff changeset
53
6fd889391d2c Added a Speed Dial to the web browser including the capability to select the first ten pages by pressing Meta+1 to Meta+0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1665
diff changeset
54 @return prepared home page (QByteArray)
6fd889391d2c Added a Speed Dial to the web browser including the capability to select the first ten pages by pressing Meta+1 to Meta+0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1665
diff changeset
55 """
6fd889391d2c Added a Speed Dial to the web browser including the capability to select the first ten pages by pressing Meta+1 to Meta+0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1665
diff changeset
56 if self._homePage is None:
1665
b248526d3a1b Reworked some stuff in the web browser to use Qt resources.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1664
diff changeset
57 htmlFile = QFile(":/html/startPage.html")
b248526d3a1b Reworked some stuff in the web browser to use Qt resources.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1664
diff changeset
58 htmlFile.open(QFile.ReadOnly)
b248526d3a1b Reworked some stuff in the web browser to use Qt resources.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1664
diff changeset
59 html = htmlFile.readAll()
1670
6fd889391d2c Added a Speed Dial to the web browser including the capability to select the first ten pages by pressing Meta+1 to Meta+0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1665
diff changeset
60
4326
e52318f11812 Change code to make eric compatible to PyQt 5.5 (QByteArry issue).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4021
diff changeset
61 html.replace("@IMAGE@", b"qrc:icons/ericWeb32.png")
e52318f11812 Change code to make eric compatible to PyQt 5.5 (QByteArry issue).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4021
diff changeset
62 html.replace("@FAVICON@", b"qrc:icons/ericWeb16.png")
1670
6fd889391d2c Added a Speed Dial to the web browser including the capability to select the first ten pages by pressing Meta+1 to Meta+0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1665
diff changeset
63
6fd889391d2c Added a Speed Dial to the web browser including the capability to select the first ten pages by pressing Meta+1 to Meta+0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1665
diff changeset
64 self._homePage = html
6fd889391d2c Added a Speed Dial to the web browser including the capability to select the first ten pages by pressing Meta+1 to Meta+0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1665
diff changeset
65
6fd889391d2c Added a Speed Dial to the web browser including the capability to select the first ten pages by pressing Meta+1 to Meta+0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1665
diff changeset
66 return QByteArray(self._homePage)
6fd889391d2c Added a Speed Dial to the web browser including the capability to select the first ten pages by pressing Meta+1 to Meta+0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1665
diff changeset
67
6fd889391d2c Added a Speed Dial to the web browser including the capability to select the first ten pages by pressing Meta+1 to Meta+0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1665
diff changeset
68 def __createSpeedDialPage(self):
6fd889391d2c Added a Speed Dial to the web browser including the capability to select the first ten pages by pressing Meta+1 to Meta+0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1665
diff changeset
69 """
6fd889391d2c Added a Speed Dial to the web browser including the capability to select the first ten pages by pressing Meta+1 to Meta+0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1665
diff changeset
70 Private method to create the Speeddial page.
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
71
1670
6fd889391d2c Added a Speed Dial to the web browser including the capability to select the first ten pages by pressing Meta+1 to Meta+0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1665
diff changeset
72 @return prepared speeddial page (QByteArray)
6fd889391d2c Added a Speed Dial to the web browser including the capability to select the first ten pages by pressing Meta+1 to Meta+0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1665
diff changeset
73 """
6fd889391d2c Added a Speed Dial to the web browser including the capability to select the first ten pages by pressing Meta+1 to Meta+0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1665
diff changeset
74 if self._speedDialPage is None:
6fd889391d2c Added a Speed Dial to the web browser including the capability to select the first ten pages by pressing Meta+1 to Meta+0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1665
diff changeset
75 htmlFile = QFile(":/html/speeddialPage.html")
6fd889391d2c Added a Speed Dial to the web browser including the capability to select the first ten pages by pressing Meta+1 to Meta+0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1665
diff changeset
76 htmlFile.open(QFile.ReadOnly)
3793
bdaf1b220a36 Fixed an issue in the web browser speed dial displaying 'funny' characters when not using English language.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3656
diff changeset
77 html = bytes(htmlFile.readAll()).decode()
1670
6fd889391d2c Added a Speed Dial to the web browser including the capability to select the first ten pages by pressing Meta+1 to Meta+0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1665
diff changeset
78
5664
9b318fcb1ee2 Removed some code complexity issues detected by the new complexity checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5389
diff changeset
79 html = html.replace("@FAVICON@", "qrc:icons/ericWeb16.png")
9b318fcb1ee2 Removed some code complexity issues detected by the new complexity checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5389
diff changeset
80 html = html.replace("@IMG_PLUS@", "qrc:icons/plus.png")
9b318fcb1ee2 Removed some code complexity issues detected by the new complexity checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5389
diff changeset
81 html = html.replace("@IMG_CLOSE@", "qrc:icons/close.png")
9b318fcb1ee2 Removed some code complexity issues detected by the new complexity checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5389
diff changeset
82 html = html.replace("@IMG_EDIT@", "qrc:icons/edit.png")
9b318fcb1ee2 Removed some code complexity issues detected by the new complexity checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5389
diff changeset
83 html = html.replace("@IMG_RELOAD@", "qrc:icons/reload.png")
9b318fcb1ee2 Removed some code complexity issues detected by the new complexity checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5389
diff changeset
84 html = html.replace("@IMG_SETTINGS@", "qrc:icons/setting.png")
9b318fcb1ee2 Removed some code complexity issues detected by the new complexity checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5389
diff changeset
85 html = html.replace("@LOADING-IMG@", "qrc:icons/loading.gif")
9b318fcb1ee2 Removed some code complexity issues detected by the new complexity checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5389
diff changeset
86 html = html.replace("@BOX-BORDER@",
9b318fcb1ee2 Removed some code complexity issues detected by the new complexity checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5389
diff changeset
87 "qrc:icons/box-border-small.png")
9b318fcb1ee2 Removed some code complexity issues detected by the new complexity checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5389
diff changeset
88
9b318fcb1ee2 Removed some code complexity issues detected by the new complexity checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5389
diff changeset
89 html = html.replace("@JQUERY@", "qrc:javascript/jquery.js")
9b318fcb1ee2 Removed some code complexity issues detected by the new complexity checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5389
diff changeset
90 html = html.replace("@JQUERY-UI@", "qrc:javascript/jquery-ui.js")
9b318fcb1ee2 Removed some code complexity issues detected by the new complexity checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5389
diff changeset
91
9b318fcb1ee2 Removed some code complexity issues detected by the new complexity checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5389
diff changeset
92 html = html.replace("@SITE-TITLE@", self.tr("Speed Dial"))
9b318fcb1ee2 Removed some code complexity issues detected by the new complexity checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5389
diff changeset
93 html = html.replace("@URL@", self.tr("URL"))
9b318fcb1ee2 Removed some code complexity issues detected by the new complexity checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5389
diff changeset
94 html = html.replace("@TITLE@", self.tr("Title"))
9b318fcb1ee2 Removed some code complexity issues detected by the new complexity checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5389
diff changeset
95 html = html.replace("@APPLY@", self.tr("Apply"))
9b318fcb1ee2 Removed some code complexity issues detected by the new complexity checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5389
diff changeset
96 html = html.replace("@CLOSE@", self.tr("Close"))
9b318fcb1ee2 Removed some code complexity issues detected by the new complexity checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5389
diff changeset
97 html = html.replace("@NEW-PAGE@", self.tr("New Page"))
9b318fcb1ee2 Removed some code complexity issues detected by the new complexity checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5389
diff changeset
98 html = html.replace("@TITLE-EDIT@", self.tr("Edit"))
9b318fcb1ee2 Removed some code complexity issues detected by the new complexity checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5389
diff changeset
99 html = html.replace("@TITLE-REMOVE@", self.tr("Remove"))
9b318fcb1ee2 Removed some code complexity issues detected by the new complexity checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5389
diff changeset
100 html = html.replace("@TITLE-RELOAD@", self.tr("Reload"))
9b318fcb1ee2 Removed some code complexity issues detected by the new complexity checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5389
diff changeset
101 html = html.replace("@TITLE-WARN@",
9b318fcb1ee2 Removed some code complexity issues detected by the new complexity checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5389
diff changeset
102 self.tr("Are you sure to remove this"
9b318fcb1ee2 Removed some code complexity issues detected by the new complexity checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5389
diff changeset
103 " speed dial?"))
9b318fcb1ee2 Removed some code complexity issues detected by the new complexity checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5389
diff changeset
104 html = html.replace("@TITLE-WARN-REL@",
9b318fcb1ee2 Removed some code complexity issues detected by the new complexity checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5389
diff changeset
105 self.tr("Are you sure you want to reload"
9b318fcb1ee2 Removed some code complexity issues detected by the new complexity checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5389
diff changeset
106 " all speed dials?"))
9b318fcb1ee2 Removed some code complexity issues detected by the new complexity checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5389
diff changeset
107 html = html.replace("@TITLE-FETCHTITLE@",
9b318fcb1ee2 Removed some code complexity issues detected by the new complexity checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5389
diff changeset
108 self.tr("Load title from page"))
9b318fcb1ee2 Removed some code complexity issues detected by the new complexity checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5389
diff changeset
109 html = html.replace("@SETTINGS-TITLE@",
9b318fcb1ee2 Removed some code complexity issues detected by the new complexity checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5389
diff changeset
110 self.tr("Speed Dial Settings"))
9b318fcb1ee2 Removed some code complexity issues detected by the new complexity checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5389
diff changeset
111 html = html.replace("@ADD-TITLE@", self.tr("Add New Page"))
9b318fcb1ee2 Removed some code complexity issues detected by the new complexity checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5389
diff changeset
112 html = html.replace("@TXT_NRROWS@",
9b318fcb1ee2 Removed some code complexity issues detected by the new complexity checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5389
diff changeset
113 self.tr("Maximum pages in a row:"))
9b318fcb1ee2 Removed some code complexity issues detected by the new complexity checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5389
diff changeset
114 html = html.replace("@TXT_SDSIZE@",
9b318fcb1ee2 Removed some code complexity issues detected by the new complexity checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5389
diff changeset
115 self.tr("Change size of pages:"))
1670
6fd889391d2c Added a Speed Dial to the web browser including the capability to select the first ten pages by pressing Meta+1 to Meta+0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1665
diff changeset
116
3793
bdaf1b220a36 Fixed an issue in the web browser speed dial displaying 'funny' characters when not using English language.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3656
diff changeset
117 self._speedDialPage = Utilities.html_uencode(html)
1670
6fd889391d2c Added a Speed Dial to the web browser including the capability to select the first ten pages by pressing Meta+1 to Meta+0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1665
diff changeset
118
2403
e3d7a861547c Continued implementing the delayed import.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2302
diff changeset
119 import Helpviewer.HelpWindow
4331
711e7c35a49b Changed code to make eric compatible to PyQt 5.5 (QByteArry issue).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4326
diff changeset
120 html = QByteArray(self._speedDialPage.encode("utf-8"))
1670
6fd889391d2c Added a Speed Dial to the web browser including the capability to select the first ten pages by pressing Meta+1 to Meta+0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1665
diff changeset
121 dial = Helpviewer.HelpWindow.HelpWindow.speedDial()
6fd889391d2c Added a Speed Dial to the web browser including the capability to select the first ten pages by pressing Meta+1 to Meta+0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1665
diff changeset
122
4331
711e7c35a49b Changed code to make eric compatible to PyQt 5.5 (QByteArry issue).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4326
diff changeset
123 html.replace("@INITIAL-SCRIPT@", dial.initialScript().encode("utf-8"))
711e7c35a49b Changed code to make eric compatible to PyQt 5.5 (QByteArry issue).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4326
diff changeset
124 html.replace("@ROW-PAGES@", str(dial.pagesInRow()).encode("utf-8"))
711e7c35a49b Changed code to make eric compatible to PyQt 5.5 (QByteArry issue).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4326
diff changeset
125 html.replace("@SD-SIZE@", str(dial.sdSize()).encode("utf-8"))
1670
6fd889391d2c Added a Speed Dial to the web browser including the capability to select the first ten pages by pressing Meta+1 to Meta+0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1665
diff changeset
126
6fd889391d2c Added a Speed Dial to the web browser including the capability to select the first ten pages by pressing Meta+1 to Meta+0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1665
diff changeset
127 return html

eric ide

mercurial