Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/browser.py
diff options
context:
space:
mode:
authorManuel 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)
commit6afcd5307419ed996a08057d7f8eb53035d143bd (patch)
tree5d75f322882df44fa4a8dfa18b0f1b79f11a57b6 /browser.py
parentf40101a4800f3799fe6b8844826a80bf0d45dcb2 (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.py5
1 files changed, 5 insertions, 0 deletions
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()