From 6afcd5307419ed996a08057d7f8eb53035d143bd Mon Sep 17 00:00:00 2001 From: Manuel Kaufmann Date: Wed, 13 Feb 2013 15:22:29 +0000 Subject: 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 Acked-by: Manuel QuiƱones --- (limited to 'browser.py') diff --git a/browser.py b/browser.py index 7419d2d..b786b6b 100644 --- a/browser.py +++ b/browser.py @@ -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() -- cgit v0.9.1