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 /browser.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 'browser.py')
-rw-r--r-- | browser.py | 9 |
1 files changed, 7 insertions, 2 deletions
@@ -361,7 +361,8 @@ class TabLabel(Gtk.HBox): browser.connect('notify::title', self.__title_changed_cb) browser.connect('notify::load-status', self.__load_status_changed_cb) - self._label = Gtk.Label(label=_('Untitled')) + self._title = _('Untitled') + self._label = Gtk.Label(label=self._title) self._label.set_ellipsize(Pango.EllipsizeMode.END) self._label.set_alignment(0, 0.5) self.pack_start(self._label, True, True, 0) @@ -397,15 +398,19 @@ class TabLabel(Gtk.HBox): def __title_changed_cb(self, widget, param): if widget.props.title: self._label.set_text(widget.props.title) + self._title = widget.props.title def __load_status_changed_cb(self, widget, param): status = widget.get_load_status() - if WebKit.LoadStatus.PROVISIONAL <= status \ + if status == WebKit.LoadStatus.FAILED: + self._label.set_text(self._title) + elif WebKit.LoadStatus.PROVISIONAL <= status \ < WebKit.LoadStatus.FINISHED: self._label.set_text(_('Loading...')) elif status == WebKit.LoadStatus.FINISHED: if widget.props.title == None: self._label.set_text(_('Untitled')) + self._title = _('Untitled') class Browser(WebKit.WebView): |