aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--embed/ephy-web-view.c36
1 files changed, 36 insertions, 0 deletions
diff --git a/embed/ephy-web-view.c b/embed/ephy-web-view.c
index b10e38a41..669ffd6e6 100644
--- a/embed/ephy-web-view.c
+++ b/embed/ephy-web-view.c
@@ -2095,6 +2095,16 @@ load_status_cb (WebKitWebView *web_view,
_ephy_web_view_hook_into_links (view);
break;
+ case WEBKIT_LOAD_FAILED:
+ ephy_web_view_set_link_message (view, NULL);
+ ephy_web_view_set_loading_title (view, NULL, FALSE);
+
+ g_free (priv->status_message);
+ priv->status_message = NULL;
+ g_object_notify (object, "status-message");
+
+ update_navigation_flags (view);
+ break;
default:
break;
}
@@ -2102,6 +2112,28 @@ load_status_cb (WebKitWebView *web_view,
g_object_thaw_notify (object);
}
+ static gboolean
+load_error_cb (WebKitWebView *web_view,
+ WebKitWebFrame *frame,
+ gchar *uri,
+ GError *error,
+ gpointer user_data)
+{
+ if (error->code != WEBKIT_NETWORK_ERROR_CANCELLED) {
+ EphyWebView *view = EPHY_WEB_VIEW (web_view);
+ gchar *message;
+
+ message = g_strdup_printf (_("A problem occurred while loading %s"),
+ uri);
+ ephy_web_view_set_title (view, message);
+ g_free (message);
+
+ _ephy_web_view_set_icon_address (view, NULL);
+ }
+
+ return FALSE;
+}
+
static gboolean
close_web_view_cb (WebKitWebView *web_view,
gpointer user_data)
@@ -2162,6 +2194,10 @@ ephy_web_view_init (EphyWebView *web_view)
G_CALLBACK (close_web_view_cb),
NULL);
+ g_signal_connect (web_view, "load-error",
+ G_CALLBACK (load_error_cb),
+ NULL);
+
g_signal_connect_object (web_view, "icon-loaded",
G_CALLBACK (favicon_cb),
web_view, (GConnectFlags)0);