From 9b88d7a36fb3556bc99268358357c62237cd0e23 Mon Sep 17 00:00:00 2001
From: Manuel Kaufmann <humitos@gmail.com>
Date: Wed, 21 Nov 2012 13:23:27 -0300
Subject: [PATCH Browse] Avoid close the PDFTab when Esc is pressed SL #4246
Do not call "stop_loading" if the WebKit is not in 'loading' state
when 'Esc' is pressed.
Signed-off-by: Manuel Kaufmann <humitos@gmail.com>
---
webactivity.py | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/webactivity.py b/webactivity.py
index 780b87f..0e3b61b 100644
a
|
b
|
class WebActivity(activity.Activity): |
526 | 526 | return True |
527 | 527 | |
528 | 528 | elif key_name == 'Escape': |
529 | | _logger.debug('keyboard: Stop loading') |
530 | | browser.stop_loading() |
| 529 | status = browser.get_load_status() |
| 530 | loading = WebKit.LoadStatus.PROVISIONAL <= status \ |
| 531 | < WebKit.LoadStatus.FINISHED |
| 532 | if loading: |
| 533 | _logger.debug('keyboard: Stop loading') |
| 534 | browser.stop_loading() |
531 | 535 | |
532 | 536 | return False |
533 | 537 | |