259 # this is something of a hack; hopefully it will work in the future |
259 # this is something of a hack; hopefully it will work in the future |
260 return False |
260 return False |
261 |
261 |
262 errorPage = sip.cast(output, QWebPage.ErrorPageExtensionReturn) |
262 errorPage = sip.cast(output, QWebPage.ErrorPageExtensionReturn) |
263 urlString = bytes(info.url.toEncoded()).decode() |
263 urlString = bytes(info.url.toEncoded()).decode() |
|
264 errorPage.baseUrl = info.url |
264 html = notFoundPage_html |
265 html = notFoundPage_html |
265 title = self.trUtf8("Error loading page: {0}").format(urlString) |
266 title = self.trUtf8("Error loading page: {0}").format(urlString) |
266 pixmap = qApp.style()\ |
267 pixmap = qApp.style()\ |
267 .standardIcon(QStyle.SP_MessageBoxWarning, None, self.parent())\ |
268 .standardIcon(QStyle.SP_MessageBoxWarning, None, self.parent())\ |
268 .pixmap(32, 32) |
269 .pixmap(32, 32) |
282 "connection."), |
283 "connection."), |
283 self.trUtf8("If your computer or network is protected by a firewall " |
284 self.trUtf8("If your computer or network is protected by a firewall " |
284 "or proxy, make sure that the browser is permitted to " |
285 "or proxy, make sure that the browser is permitted to " |
285 "access the network."), |
286 "access the network."), |
286 self.trUtf8("If your cache policy is set to offline browsing," |
287 self.trUtf8("If your cache policy is set to offline browsing," |
287 "only pages in the local cache are available.") |
288 "only pages in the local cache are available."), |
|
289 self.trUtf8("Try Again") |
288 ).encode("utf8")) |
290 ).encode("utf8")) |
289 return True |
291 return True |
290 except AttributeError: |
292 except AttributeError: |
291 pass |
293 pass |
292 |
294 |
1563 "connection."), |
1565 "connection."), |
1564 self.trUtf8("If your computer or network is protected by a firewall or " |
1566 self.trUtf8("If your computer or network is protected by a firewall or " |
1565 "proxy, make sure that the browser is permitted to access " |
1567 "proxy, make sure that the browser is permitted to access " |
1566 "the network."), |
1568 "the network."), |
1567 self.trUtf8("If your cache policy is set to offline browsing," |
1569 self.trUtf8("If your cache policy is set to offline browsing," |
1568 "only pages in the local cache are available.") |
1570 "only pages in the local cache are available."), |
|
1571 self.trUtf8("Try Again") |
1569 ) |
1572 ) |
1570 notFoundFrame.setHtml(html, replyUrl) |
1573 notFoundFrame.setHtml(html, replyUrl) |
1571 self.mw.historyManager().removeHistoryEntry(replyUrl, self.title()) |
1574 self.mw.historyManager().removeHistoryEntry(replyUrl, self.title()) |
1572 self.loadFinished.emit(False) |
1575 self.loadFinished.emit(False) |
1573 |
1576 |