diff options
author | Manuel Quiñones <manuq@laptop.org> | 2012-05-22 15:20:26 (GMT) |
---|---|---|
committer | Manuel Quiñones <manuq@laptop.org> | 2012-05-30 11:50:33 (GMT) |
commit | d6c56f8184de2b3980aca34fb644d2a8f0f4b64f (patch) | |
tree | fa669e9922874c7625407300c71feba951a5901b /webtoolbar.py | |
parent | 4c7e12ef0f1f1ad452379f609e6cd2f299f950d4 (diff) |
Unset "loading..." message when the loading fails SL #3620
Browse has to restore the previous title in the tab and in the URL
entry when the loading finishes with WEBKIT_LOAD_FAILED status.
This fixes bug #3620 in Sugarlabs trac. The WEBKIT_LOAD_FAILED
status is reached in the current webview when the loading is
manually handled in the mime-type-policy-decision-requested callback.
Signed-off-by: Manuel Quiñones <manuq@laptop.org>
Tested-by: Manuel Kaufmann <humitos@gmail.com>
Acked-by: Simon Schampijer <simon@laptop.org>
Diffstat (limited to 'webtoolbar.py')
-rw-r--r-- | webtoolbar.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/webtoolbar.py b/webtoolbar.py index 6241eb1..99c5fd6 100644 --- a/webtoolbar.py +++ b/webtoolbar.py @@ -241,6 +241,7 @@ class PrimaryToolbar(ToolbarBase): self._tabbed_view = tabbed_view self._loading = False + self._title = _('Untitled') toolbar = self.toolbar activity_button = ActivityToolbarButton(self._activity) @@ -353,12 +354,15 @@ class PrimaryToolbar(ToolbarBase): def __loading_changed_cb(self, widget, param): status = widget.get_load_status() - if WebKit.LoadStatus.PROVISIONAL <= status \ + if status == WebKit.LoadStatus.FAILED: + self.entry._set_title(self._title) + elif WebKit.LoadStatus.PROVISIONAL <= status \ < WebKit.LoadStatus.FINISHED: self.entry._set_title(_('Loading...')) elif status == WebKit.LoadStatus.FINISHED: if widget.props.title == None: self.entry._set_title(_('Untitled')) + self._title = _('Untitled') self._set_status(widget.get_load_status()) def __progress_changed_cb(self, widget, param): @@ -381,6 +385,7 @@ class PrimaryToolbar(ToolbarBase): def _set_title(self, title): self.entry.props.title = title + self._title = title def _show_stop_icon(self): self.entry.set_icon_from_name(iconentry.ICON_ENTRY_SECONDARY, |