status: Hide progress bar when finished loading
This commit is contained in:
parent
0100dcf119
commit
ee3eedbfb5
@ -6,6 +6,7 @@ import logging
|
|||||||
|
|
||||||
class TabbedBrowser(TabWidget):
|
class TabbedBrowser(TabWidget):
|
||||||
cur_progress = pyqtSignal(int)
|
cur_progress = pyqtSignal(int)
|
||||||
|
cur_load_finished = pyqtSignal(bool)
|
||||||
url_stack = []
|
url_stack = []
|
||||||
|
|
||||||
def __init__(self, parent):
|
def __init__(self, parent):
|
||||||
@ -21,6 +22,7 @@ class TabbedBrowser(TabWidget):
|
|||||||
self.setCurrentWidget(tab)
|
self.setCurrentWidget(tab)
|
||||||
self.progress_changed(tab.progress)
|
self.progress_changed(tab.progress)
|
||||||
tab.loadProgress.connect(self.progress_changed)
|
tab.loadProgress.connect(self.progress_changed)
|
||||||
|
tab.loadFinished.connect(self.load_finished)
|
||||||
tab.titleChanged.connect(self.update_title)
|
tab.titleChanged.connect(self.update_title)
|
||||||
|
|
||||||
@pyqtSlot(str)
|
@pyqtSlot(str)
|
||||||
@ -103,6 +105,10 @@ class TabbedBrowser(TabWidget):
|
|||||||
def progress_changed(self, prog):
|
def progress_changed(self, prog):
|
||||||
self.filter_signals(self.cur_progress, prog)
|
self.filter_signals(self.cur_progress, prog)
|
||||||
|
|
||||||
|
@pyqtSlot(bool)
|
||||||
|
def load_finished(self, ok):
|
||||||
|
self.filter_signals(self.cur_load_finished, ok)
|
||||||
|
|
||||||
@pyqtSlot(str)
|
@pyqtSlot(str)
|
||||||
def update_title(self, text):
|
def update_title(self, text):
|
||||||
if text:
|
if text:
|
||||||
|
@ -24,6 +24,7 @@ class MainWindow(QMainWindow):
|
|||||||
self.vbox.addWidget(self.status)
|
self.vbox.addWidget(self.status)
|
||||||
|
|
||||||
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.retranslateUi(MainWindow)
|
#self.retranslateUi(MainWindow)
|
||||||
#self.tabWidget.setCurrentIndex(0)
|
#self.tabWidget.setCurrentIndex(0)
|
||||||
|
@ -67,6 +67,9 @@ class StatusProgress(QProgressBar):
|
|||||||
self.show()
|
self.show()
|
||||||
self.setValue(prog)
|
self.setValue(prog)
|
||||||
|
|
||||||
|
def load_finished(self, ok):
|
||||||
|
self.hide()
|
||||||
|
|
||||||
class StatusText(QLabel):
|
class StatusText(QLabel):
|
||||||
def __init__(self, parent):
|
def __init__(self, parent):
|
||||||
super().__init__(parent)
|
super().__init__(parent)
|
||||||
|
Loading…
Reference in New Issue
Block a user