Set statusbar to 0% on loadStarted
This commit is contained in:
parent
9ac3f51db2
commit
5df27e36a0
@ -11,6 +11,7 @@ class TabbedBrowser(TabWidget):
|
|||||||
"""A TabWidget with QWebViews inside"""
|
"""A TabWidget with QWebViews inside"""
|
||||||
|
|
||||||
cur_progress = pyqtSignal(int) # Progress of the current tab changed
|
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_load_finished = pyqtSignal(bool) # Current tab finished loading
|
||||||
# Current tab changed scroll position
|
# Current tab changed scroll position
|
||||||
cur_scroll_perc_changed = pyqtSignal(int, int)
|
cur_scroll_perc_changed = pyqtSignal(int, int)
|
||||||
@ -34,6 +35,8 @@ class TabbedBrowser(TabWidget):
|
|||||||
lambda *args: self._filter_signals(self.cur_progress, *args))
|
lambda *args: self._filter_signals(self.cur_progress, *args))
|
||||||
tab.loadFinished.connect(
|
tab.loadFinished.connect(
|
||||||
lambda *args: self._filter_signals(self.cur_load_finished, *args))
|
lambda *args: self._filter_signals(self.cur_load_finished, *args))
|
||||||
|
tab.loadStarted.connect(
|
||||||
|
lambda *args: self._filter_signals(self.cur_load_started, *args))
|
||||||
tab.scroll_pos_changed.connect(self._scroll_pos_changed_handler)
|
tab.scroll_pos_changed.connect(self._scroll_pos_changed_handler)
|
||||||
# FIXME should we really bind this to loadStarted? Sometimes the URL
|
# FIXME should we really bind this to loadStarted? Sometimes the URL
|
||||||
# isn't set correctly at this point, e.g. when doing
|
# isn't set correctly at this point, e.g. when doing
|
||||||
|
@ -34,6 +34,7 @@ class MainWindow(QMainWindow):
|
|||||||
self.status.resized.connect(self.completion.resize_to_bar)
|
self.status.resized.connect(self.completion.resize_to_bar)
|
||||||
self.tabs.cur_progress.connect(self.status.prog.set_progress)
|
self.tabs.cur_progress.connect(self.status.prog.set_progress)
|
||||||
self.tabs.cur_load_finished.connect(self.status.prog.load_finished)
|
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_scroll_perc_changed.connect(self.status.txt.set_perc)
|
||||||
self.status.cmd.esc_pressed.connect(self.tabs.setFocus)
|
self.status.cmd.esc_pressed.connect(self.tabs.setFocus)
|
||||||
self.status.cmd.hide_completion.connect(self.completion.hide)
|
self.status.cmd.hide_completion.connect(self.completion.hide)
|
||||||
|
Loading…
Reference in New Issue
Block a user