diff options
author | Manuel Kaufmann <humitos@gmail.com> | 2013-02-13 15:22:29 (GMT) |
---|---|---|
committer | Manuel QuiƱones <manuq@laptop.org> | 2013-02-13 17:17:49 (GMT) |
commit | 6afcd5307419ed996a08057d7f8eb53035d143bd (patch) | |
tree | 5d75f322882df44fa4a8dfa18b0f1b79f11a57b6 /browser.py | |
parent | f40101a4800f3799fe6b8844826a80bf0d45dcb2 (diff) |
Cancel PDF download when 'X' from TabLabel is clicked SL #4390
When the 'X' button is clicked from the TabLabel we emit 'tab-close'
signal and cancel the download on its callback if the tab closed is a
PDFTabPage.
Signed-off-by: Manuel Kaufmann <humitos@gmail.com>
Acked-by: Manuel QuiƱones <manuq@laptop.org>
Diffstat (limited to 'browser.py')
-rw-r--r-- | browser.py | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -301,6 +301,11 @@ class TabbedView(BrowserNotebook): nth_page = self.get_nth_page(page_to_focus) nth_page.props.browser.grab_focus() + if isinstance(tab_page, PDFTabPage): + if tab_page.props.browser.props.load_status < \ + WebKit.LoadStatus.FINISHED: + tab_page.cancel_download() + self.remove_page(self.page_num(tab_page)) tab_page.destroy() |