Ignore empty js statusbar messages.

This commit is contained in:
Florian Bruhin 2014-04-22 09:05:53 +02:00
parent 7e2b590da1
commit 1740d4c60f
2 changed files with 13 additions and 1 deletions

View File

@ -84,7 +84,8 @@ class MainWindow(QWidget):
self.tabs.cur_load_started.connect(self.status.prog.on_load_started)
self.tabs.cur_scroll_perc_changed.connect(
self.status.percentage.set_perc)
self.tabs.cur_statusbar_message.connect(self.status.txt.set_normaltext)
self.tabs.cur_statusbar_message.connect(
self.status.txt.on_statusbar_message)
self.tabs.cur_temp_message.connect(self.status.txt.set_temptext)
self.tabs.cur_url_changed.connect(self.status.url.set_url)
self.tabs.cur_link_hovered.connect(self.status.url.set_hover_url)

View File

@ -543,6 +543,17 @@ class _Text(TextBase):
"""Setter for normaltext, to be used as Qt slot."""
self.normaltext = val
@pyqtSlot(str)
def on_statusbar_message(self, val):
"""Called when javascript tries to set a statusbar message.
For some reason, this is emitted a lot with an empty string during page
load, so we currently ignore these and thus don't support clearing the
message, which is a bit unfortunate...
"""
if val:
self.temptext = val
@pyqtSlot(str)
def set_temptext(self, val):
"""Setter for temptext, to be used as Qt slot."""