10 from PyQt6.QtCore import pyqtSignal, QBuffer, QIODevice, QUrlQuery, QMutex |
10 from PyQt6.QtCore import pyqtSignal, QBuffer, QIODevice, QUrlQuery, QMutex |
11 from PyQt6.QtWebEngineCore import QWebEngineUrlSchemeHandler |
11 from PyQt6.QtWebEngineCore import QWebEngineUrlSchemeHandler |
12 |
12 |
13 from E5Gui.E5Application import e5App |
13 from E5Gui.E5Application import e5App |
14 |
14 |
15 from E5Utilities.E5MutexLocker import E5MutexLocker |
15 from EricUtilities.EricMutexLocker import EricMutexLocker |
16 |
16 |
17 from ..Tools.WebBrowserTools import ( |
17 from ..Tools.WebBrowserTools import ( |
18 getHtmlPage, getJavascript, pixmapFileToDataUrl |
18 getHtmlPage, getJavascript, pixmapFileToDataUrl |
19 ) |
19 ) |
20 |
20 |
99 Private method to load the requested page. |
99 Private method to load the requested page. |
100 """ |
100 """ |
101 if self.__loaded: |
101 if self.__loaded: |
102 return |
102 return |
103 |
103 |
104 with E5MutexLocker(self.__mutex): |
104 with EricMutexLocker(self.__mutex): |
105 if self.__pageName == "adblock": |
105 if self.__pageName == "adblock": |
106 contents = self.__adBlockPage() |
106 contents = self.__adBlockPage() |
107 elif self.__pageName in ["home", "start", "startpage"]: |
107 elif self.__pageName in ["home", "start", "startpage"]: |
108 contents = self.__startPage() |
108 contents = self.__startPage() |
109 elif self.__pageName == "speeddial": |
109 elif self.__pageName == "speeddial": |
124 Public method to get the number of available bytes. |
124 Public method to get the number of available bytes. |
125 |
125 |
126 @return number of available bytes |
126 @return number of available bytes |
127 @rtype int |
127 @rtype int |
128 """ |
128 """ |
129 with E5MutexLocker(self.__mutex): |
129 with EricMutexLocker(self.__mutex): |
130 return self.__buffer.bytesAvailable() |
130 return self.__buffer.bytesAvailable() |
131 |
131 |
132 def readData(self, maxlen): |
132 def readData(self, maxlen): |
133 """ |
133 """ |
134 Public method to retrieve data from the reply object. |
134 Public method to retrieve data from the reply object. |
135 |
135 |
136 @param maxlen maximum number of bytes to read (integer) |
136 @param maxlen maximum number of bytes to read (integer) |
137 @return string containing the data (bytes) |
137 @return string containing the data (bytes) |
138 """ |
138 """ |
139 with E5MutexLocker(self.__mutex): |
139 with EricMutexLocker(self.__mutex): |
140 return self.__buffer.read(maxlen) |
140 return self.__buffer.read(maxlen) |
141 |
141 |
142 def close(self): |
142 def close(self): |
143 """ |
143 """ |
144 Public method used to cloase the reply. |
144 Public method used to cloase the reply. |