Add status bar messages that don't even work yet

This commit is contained in:
Fierelier 2021-03-19 19:12:28 +01:00
parent 8b72f60c93
commit ad811cc9fc

View File

@ -99,6 +99,7 @@ class browserWindow(QMainWindow):
self.cDoc = browserDoc(self)
self.cStatusBar = QStatusBar(self)
self.cStatusBar.showMessage("Please wait...")
self.cResizeElements()
self.show()
@ -117,7 +118,6 @@ class browserWindow(QMainWindow):
self.cStatusBar.move(0,self.cHeight - mb)
self.cStatusBar.resize(self.cWidth,mb)
self.cStatusBar.showMessage("Status")
def resizeEvent(self,event):
self.cWidth = self.width()
@ -127,6 +127,8 @@ class browserWindow(QMainWindow):
def cNavigate(self,event = None):
try:
#print(prettyJson(parseUrl(self.cUrlBar.text())))
self.cStatusBar.showMessage("Downloading...")
self.update()
start = time.time()
response = downloadPage(self.cUrlBar.text(),{"User-Agent": self.cUserAgent})
end = time.time()
@ -135,10 +137,14 @@ class browserWindow(QMainWindow):
infoFetcher(response)
self.cDocumentInfo = response
self.cStatusBar.showMessage("Rendering...")
self.update()
start = time.time()
self.cDoc.cRenderHtml(response["body"].decode("utf-8",errors="ignore"))
end = time.time()
print("Rendering page: " +str(end - start))
self.cStatusBar.showMessage("Ready")
self.update()
#print(prettyJson(response["headers"]))
except Exception as e:
self.cDoc.cRenderHtml(str(e))