Handle statusBarMessage from WebView
This commit is contained in:
parent
5df27e36a0
commit
b351fdf477
@ -13,6 +13,8 @@ class TabbedBrowser(TabWidget):
|
||||
cur_progress = pyqtSignal(int) # Progress of the current tab changed
|
||||
cur_load_started = pyqtSignal() # Current tab started loading
|
||||
cur_load_finished = pyqtSignal(bool) # Current tab finished loading
|
||||
cur_statusbar_message = pyqtSignal(str) # Status bar message
|
||||
# FIXME we need to store this in our browser object
|
||||
# Current tab changed scroll position
|
||||
cur_scroll_perc_changed = pyqtSignal(int, int)
|
||||
keypress = pyqtSignal('QKeyEvent')
|
||||
@ -37,6 +39,8 @@ class TabbedBrowser(TabWidget):
|
||||
lambda *args: self._filter_signals(self.cur_load_finished, *args))
|
||||
tab.loadStarted.connect(
|
||||
lambda *args: self._filter_signals(self.cur_load_started, *args))
|
||||
tab.statusBarMessage.connect(
|
||||
lambda *args: self._filter_signals(self.cur_statusbar_message, *args))
|
||||
tab.scroll_pos_changed.connect(self._scroll_pos_changed_handler)
|
||||
# FIXME should we really bind this to loadStarted? Sometimes the URL
|
||||
# isn't set correctly at this point, e.g. when doing
|
||||
|
@ -36,6 +36,7 @@ class MainWindow(QMainWindow):
|
||||
self.tabs.cur_load_finished.connect(self.status.prog.load_finished)
|
||||
self.tabs.cur_load_started.connect(lambda: self.status.prog.set_progress(0))
|
||||
self.tabs.cur_scroll_perc_changed.connect(self.status.txt.set_perc)
|
||||
self.tabs.cur_statusbar_message.connect(self.status.txt.set_text)
|
||||
self.status.cmd.esc_pressed.connect(self.tabs.setFocus)
|
||||
self.status.cmd.hide_completion.connect(self.completion.hide)
|
||||
self.status.cmd.textChanged.connect(self.completion.cmd_text_changed)
|
||||
|
@ -1,3 +1,4 @@
|
||||
import logging
|
||||
from PyQt5.QtWidgets import QLabel
|
||||
|
||||
class Text(QLabel):
|
||||
@ -28,6 +29,10 @@ class Text(QLabel):
|
||||
else:
|
||||
self.scrollperc = '[{}%]'.format(y)
|
||||
|
||||
def set_text(self, text):
|
||||
logging.debug('Setting text to "{}"'.format(text))
|
||||
self.text = text
|
||||
|
||||
def update(self):
|
||||
"""Update the text displayed"""
|
||||
self.setText(' '.join([self.keystring, self.error, self.text,
|
||||
|
Loading…
Reference in New Issue
Block a user