diff options
author | Peter Hofmann <scm@uninformativ.de> | 2014-06-14 16:21:22 +0200 |
---|---|---|
committer | Peter Hofmann <scm@uninformativ.de> | 2014-06-14 16:22:15 +0200 |
commit | 204beb9adcf6d899381af25c9b56197819bbc274 (patch) | |
tree | ed5f1009dd8d445a13446cddab057da2eff8a83c | |
parent | f132a4c29e2619e473f275ad1ccc26d6e5ccaa23 (diff) | |
download | lariza-204beb9adcf6d899381af25c9b56197819bbc274.tar.gz |
Monitor load-status
-rw-r--r-- | zea.c | 25 |
1 files changed, 25 insertions, 0 deletions
@@ -15,6 +15,8 @@ static gboolean zea_do_download(WebKitWebView *, WebKitDownload *, gpointer); static gboolean zea_download_request(WebKitWebView *, WebKitWebFrame *, WebKitNetworkRequest *, gchar *, WebKitWebPolicyDecision *, gpointer); +static void zea_load_status_changed(GObject *obj, GParamSpec *pspec, + gpointer data); static gboolean zea_location_key(GtkWidget *, GdkEvent *, gpointer); static void zea_new_client(const gchar *uri); static gboolean zea_new_client_request(WebKitWebView *, WebKitWebFrame *, @@ -177,6 +179,8 @@ zea_new_client(const gchar *uri) G_CALLBACK(zea_title_changed), c); g_signal_connect(G_OBJECT(c->web_view), "notify::uri", G_CALLBACK(zea_uri_changed), c); + g_signal_connect(G_OBJECT(c->web_view), "notify::load-status", + G_CALLBACK(zea_load_status_changed), c); g_signal_connect(G_OBJECT(c->web_view), "new-window-policy-decision-requested", G_CALLBACK(zea_new_client_request), NULL); @@ -276,6 +280,27 @@ zea_uri_changed(GObject *obj, GParamSpec *pspec, gpointer data) } void +zea_load_status_changed(GObject *obj, GParamSpec *pspec, gpointer data) +{ + struct Client *c = (struct Client *)data; + + (void)obj; + (void)pspec; + + if (webkit_web_view_get_load_status(WEBKIT_WEB_VIEW(c->web_view)) + == WEBKIT_LOAD_FINISHED) + { + gtk_statusbar_pop(GTK_STATUSBAR(c->status), 1); + gtk_statusbar_push(GTK_STATUSBAR(c->status), 1, "Finished."); + } + else + { + gtk_statusbar_pop(GTK_STATUSBAR(c->status), 1); + gtk_statusbar_push(GTK_STATUSBAR(c->status), 1, "Loading..."); + } +} + +void zea_web_view_hover(WebKitWebView *web_view, gchar *title, gchar *uri, gpointer data) { |