diff options
author | Manuel Kaufmann <humitos@gmail.com> | 2012-09-10 20:52:45 (GMT) |
---|---|---|
committer | Manuel QuiƱones <manuq@laptop.org> | 2012-09-25 14:41:06 (GMT) |
commit | a07d27a0356f312602c15bbb55cfad553a614118 (patch) | |
tree | b68e99167d7d2878aabe3391b63b86eacad6c05d /webactivity.py | |
parent | 41968d61a320632cabc0dd7ad2805c9f6fedb54c (diff) |
Busy indication SL #851
Show WATCH Cursor when the page is loading and LEFT_PTR when the load
finishes.
This changes take in consideration the tab that the user is watching,
so the cursor refers to the state of the current browser / tab.
Signed-off-by: Manuel Kaufmann <humitos@gmail.com>
Acked-by: Manuel QuiƱones <manuq@laptop.org>
Diffstat (limited to 'webactivity.py')
-rw-r--r-- | webactivity.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/webactivity.py b/webactivity.py index cdd556f..75b857b 100644 --- a/webactivity.py +++ b/webactivity.py @@ -169,6 +169,7 @@ class WebActivity(activity.Activity): self._force_close = False self._tabbed_view = TabbedView() self._tabbed_view.connect('focus-url-entry', self._on_focus_url_entry) + self._tabbed_view.connect('switch-page', self.__switch_page_cb) self._tray = HTray() self.set_tray(self._tray, Gtk.PositionType.BOTTOM) @@ -626,6 +627,18 @@ class WebActivity(activity.Activity): downloadmanager.remove_all_downloads() self.close() + def __switch_page_cb(self, tabbed_view, page, page_num): + browser = page._browser + status = browser.get_load_status() + + if status in (WebKit.LoadStatus.COMMITTED, + WebKit.LoadStatus.FIRST_VISUALLY_NON_EMPTY_LAYOUT): + self.get_window().set_cursor(Gdk.Cursor(Gdk.CursorType.WATCH)) + elif status in (WebKit.LoadStatus.PROVISIONAL, + WebKit.LoadStatus.FAILED, + WebKit.LoadStatus.FINISHED): + self.get_window().set_cursor(Gdk.Cursor(Gdk.CursorType.LEFT_PTR)) + def get_document_path(self, async_cb, async_err_cb): browser = self._tabbed_view.props.current_browser browser.get_source(async_cb, async_err_cb) |