From 6a42e0c96c3289df1cc9b8b5a272b23c31a383c7 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Tue, 14 Jun 2016 13:31:02 +0200 Subject: [PATCH] Make shutdown work --- qutebrowser/browser/tab.py | 4 ++++ qutebrowser/browser/webengine/webenginetab.py | 4 ++++ qutebrowser/browser/webkit/webkittab.py | 4 ++++ 3 files changed, 12 insertions(+) diff --git a/qutebrowser/browser/tab.py b/qutebrowser/browser/tab.py index dbcc1dbf1..6804f041c 100644 --- a/qutebrowser/browser/tab.py +++ b/qutebrowser/browser/tab.py @@ -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) diff --git a/qutebrowser/browser/webengine/webenginetab.py b/qutebrowser/browser/webengine/webenginetab.py index f7d08b9fb..f0a259260 100644 --- a/qutebrowser/browser/webengine/webenginetab.py +++ b/qutebrowser/browser/webengine/webenginetab.py @@ -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() diff --git a/qutebrowser/browser/webkit/webkittab.py b/qutebrowser/browser/webkit/webkittab.py index dcdc85032..06944a8b2 100644 --- a/qutebrowser/browser/webkit/webkittab.py +++ b/qutebrowser/browser/webkit/webkittab.py @@ -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