216 @return flag indicating a successful call of the extension (boolean) |
216 @return flag indicating a successful call of the extension (boolean) |
217 """ |
217 """ |
218 try: |
218 try: |
219 if extension == QWebPage.ErrorPageExtension: |
219 if extension == QWebPage.ErrorPageExtension: |
220 info = sip.cast(option, QWebPage.ErrorPageExtensionOption) |
220 info = sip.cast(option, QWebPage.ErrorPageExtensionOption) |
|
221 if info.error == 102: |
|
222 # this is something of a hack; hopefully it will work in the future |
|
223 return False |
|
224 |
221 errorPage = sip.cast(output, QWebPage.ErrorPageExtensionReturn) |
225 errorPage = sip.cast(output, QWebPage.ErrorPageExtensionReturn) |
222 urlString = bytes(info.url.toEncoded()).decode() |
226 urlString = bytes(info.url.toEncoded()).decode() |
223 html = notFoundPage_html |
227 html = notFoundPage_html |
224 title = self.trUtf8("Error loading page: {0}").format(urlString) |
228 title = self.trUtf8("Error loading page: {0}").format(urlString) |
225 pixmap = qApp.style()\ |
229 pixmap = qApp.style()\ |
1043 """ |
1047 """ |
1044 Private method to handle the loadStarted signal. |
1048 Private method to handle the loadStarted signal. |
1045 """ |
1049 """ |
1046 self.__isLoading = True |
1050 self.__isLoading = True |
1047 self.__progress = 0 |
1051 self.__progress = 0 |
1048 self.mw.progressBar().show() |
|
1049 |
1052 |
1050 def __loadProgress(self, progress): |
1053 def __loadProgress(self, progress): |
1051 """ |
1054 """ |
1052 Private method to handle the loadProgress signal. |
1055 Private method to handle the loadProgress signal. |
1053 |
1056 |
1054 @param progress progress value (integer) |
1057 @param progress progress value (integer) |
1055 """ |
1058 """ |
1056 self.__progress = progress |
1059 self.__progress = progress |
1057 self.mw.progressBar().setValue(progress) |
|
1058 |
1060 |
1059 def __loadFinished(self, ok): |
1061 def __loadFinished(self, ok): |
1060 """ |
1062 """ |
1061 Private method to handle the loadFinished signal. |
1063 Private method to handle the loadFinished signal. |
1062 |
1064 |
1063 @param ok flag indicating the result (boolean) |
1065 @param ok flag indicating the result (boolean) |
1064 """ |
1066 """ |
1065 self.__isLoading = False |
1067 self.__isLoading = False |
1066 self.__progress = 0 |
1068 self.__progress = 0 |
1067 self.mw.progressBar().hide() |
|
1068 |
1069 |
1069 if ok: |
1070 if ok: |
1070 self.mw.adblockManager().page().applyRulesToPage(self.page()) |
1071 self.mw.adblockManager().page().applyRulesToPage(self.page()) |
1071 self.mw.passwordManager().fill(self.page()) |
1072 self.mw.passwordManager().fill(self.page()) |
1072 |
1073 |
1126 dlg = DownloadDialog(reply, requestFilename, self.page(), download) |
1127 dlg = DownloadDialog(reply, requestFilename, self.page(), download) |
1127 if dlg.initialize(): |
1128 if dlg.initialize(): |
1128 dlg.done[()].connect(self.__downloadDone) |
1129 dlg.done[()].connect(self.__downloadDone) |
1129 self.__downloadWindows.append(dlg) |
1130 self.__downloadWindows.append(dlg) |
1130 dlg.show() |
1131 dlg.show() |
1131 self.setUrl(self.url()) |
1132 ## self.setUrl(self.url()) |
1132 else: |
1133 else: |
1133 replyUrl = reply.url() |
1134 replyUrl = reply.url() |
1134 if replyUrl.isEmpty(): |
1135 if replyUrl.isEmpty(): |
1135 return |
1136 return |
1136 |
1137 |