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-19 01:51:23 (GMT)
commit080f092c8bbaf0f770cb4a177f1d0f2bd0ba37d5 (patch)
treea0b9536c175c52f7f540cd4e58b8e79a5adab25a /browser.py
parente4ddc6dbb1695911679d4cbcd21ee29f108c386b (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> Conflicts resolved: pdfviewer.py
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()