aboutsummaryrefslogtreecommitdiffstats
path: root/src/ephy-session.c
diff options
context:
space:
mode:
authorDiego Escalante Urrelo <descalante@igalia.com>2009-09-01 13:05:36 +0800
committerDiego Escalante Urrelo <descalante@igalia.com>2010-12-11 00:53:50 +0800
commite435a10d44dfed0705a5703b406c854a1208821e (patch)
treec379fa7e3b59974f72813868a5cb504b378e1ff1 /src/ephy-session.c
parent3a1e97fbd04ca466535da01e8fdd0bca95560aa4 (diff)
downloadgsoc2013-epiphany-e435a10d44dfed0705a5703b406c854a1208821e.tar.gz
gsoc2013-epiphany-e435a10d44dfed0705a5703b406c854a1208821e.tar.zst
gsoc2013-epiphany-e435a10d44dfed0705a5703b406c854a1208821e.zip
ephy-web-view: use custom error pages
Show nice error pages instead of WebKitGTK+'s defaults. Bug #592667
Diffstat (limited to 'src/ephy-session.c')
-rw-r--r--src/ephy-session.c81
1 files changed, 7 insertions, 74 deletions
diff --git a/src/ephy-session.c b/src/ephy-session.c
index 3688afc44..cee9e490e 100644
--- a/src/ephy-session.c
+++ b/src/ephy-session.c
@@ -1352,86 +1352,19 @@ out:
return ret >= 0 ? TRUE : FALSE;
}
-
-static void
+static void
confirm_before_recover (EphyWindow* window, char* url, char* title)
{
-
- GtkWidget *embed;
- GString *html = g_string_new ("");
- char *message = g_markup_printf_escaped
- /* Translators: %s refers to the LSB distributor ID, for instance MandrivaLinux */
- (_("This page was loading when the web browser closed unexpectedly. "
- "This might happen again if you reload the page. If it does, please report "
- "the problem to the %s developers."),
- LSB_DISTRIBUTOR);
-
- const char *format =
- "<?xml version=\"1.0\" encoding=\"utf-8\"?>"
- "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">"
- "<html xmlns=\"http://www.w3.org/1999/xhtml\" lang=\"%s\" xml:lang=\"%s\">" /* language (twice) */
- "<head>"
- "<title>"
- "%s" /* web title */
- "</title>"
- "<style type=\"text/css\">"
- "div#body {"
- "top: 12px;"
- "right: 12px;"
- "bottom: 12px;"
- "left: 12px;"
- "overflow: auto;"
- "background-color:#dcdad5;"
- "font: message-box;"
- "border: 1px solid;"
- "background-repeat: no-repeat;"
- "background-position: center left;"
- "padding: 12px 12px 12px 72px;"
- "text-align:left;"
-
- "h1 {"
-
- "margin: 0;"
- "font-size: 1.2em;"
-
- "}"
- "</style>"
-
- "</head>"
-
- "<body dir=\"%s\">" /* rtl or ltr */
- "<div id=\"body\">"
-
- "<h1>"
- "%s" /* head of the message */
- "</h1>"
-
- "<p> %s </p>" /* message */
-
- "</div>"
- "</body>"
- "</html>";
-
- char *language = g_strdup (pango_language_to_string (gtk_get_default_language ()));
- g_strdelimit (language, "_-@", '\0');
-
- g_string_printf (html, format, language, language, title,
- gtk_widget_get_default_direction () == GTK_TEXT_DIR_RTL ? "rtl" : "ltr",
- _("Blank page"), message);
+ EphyEmbed *embed;
- embed = (GtkWidget*) ephy_shell_new_tab (ephy_shell, window, NULL, NULL,
- EPHY_NEW_TAB_IN_EXISTING_WINDOW | EPHY_NEW_TAB_APPEND_LAST);
+ embed = ephy_shell_new_tab (ephy_shell, window, NULL, NULL,
+ EPHY_NEW_TAB_IN_EXISTING_WINDOW |
+ EPHY_NEW_TAB_APPEND_LAST);
- /* show generated html and put the original URL in the navigation bar */
- webkit_web_view_load_html_string (EPHY_GET_WEBKIT_WEB_VIEW_FROM_EMBED (EPHY_EMBED (embed)),
- html->str,
- url);
- g_string_free (html, TRUE);
- g_free (message);
- g_free (language);
+ ephy_web_view_load_error_page (ephy_embed_get_web_view (embed), url,
+ EPHY_WEB_VIEW_ERROR_PAGE_CRASH, NULL);
}
-
static void
parse_embed (xmlNodePtr child,
EphyWindow *window,