Make shutdown work

This commit is contained in:
Florian Bruhin 2016-06-14 13:31:02 +02:00
parent 55753171f1
commit 6a42e0c96c
3 changed files with 12 additions and 0 deletions

View File

@ -116,6 +116,7 @@ class AbstractTab(QWidget):
url_text_changed = pyqtSignal(str)
title_changed = pyqtSignal(str)
load_status_changed = pyqtSignal(str)
shutting_down = pyqtSignal()
def __init__(self, parent=None):
self.tab_id = next(tab_id_gen)
@ -158,6 +159,9 @@ class AbstractTab(QWidget):
"""
raise NotImplementedError
def shutdown(self):
raise NotImplementedError
def __repr__(self):
url = utils.elide(self.cur_url.toDisplayString(QUrl.EncodeUnicode),
100)

View File

@ -89,6 +89,10 @@ class WebEngineViewTab(tab.AbstractTab):
else:
self._widget.page().toHtml(callback)
def shutdown(self):
# TODO
pass
def _connect_signals(self):
view = self._widget
page = view.page()

View File

@ -96,6 +96,9 @@ class WebViewTab(tab.AbstractTab):
else:
callback(frame.toHtml())
def shutdown(self):
self._widget.shutdown()
def _connect_signals(self):
view = self._widget
page = view.page()
@ -108,6 +111,7 @@ class WebViewTab(tab.AbstractTab):
view.titleChanged.connect(self.title_changed)
view.url_text_changed.connect(self.url_text_changed)
view.load_status_changed.connect(self.load_status_changed)
view.shutting_down.connect(self.shutting_down)
# Make sure we emit an appropriate status when loading finished.
# While Qt has a bool "ok" attribute for loadFinished, it always is True