[epiphany/kiosk-mode] Merge the different error pages



commit 85af42a34de8b84283de53d13870693561d880dc
Author: Lorenzo Tilve Álvaro <ltilve igalia com>
Date:   Wed Jul 17 11:02:43 2013 +0200

    Merge the different error pages
    
    The different epiphany HTML error pages have been refactored into
    a single one, that depending on the type of the conditions include
    some different styles to keep the original appearances.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=705180

 data/pages/Makefile.am        |    2 -
 data/pages/error.html         |   12 +++++-
 data/pages/process_crash.html |   74 ----------------------------------
 data/pages/recovery.html      |   87 -----------------------------------------
 embed/ephy-web-view.c         |   20 +++------
 5 files changed, 18 insertions(+), 177 deletions(-)
---
diff --git a/data/pages/Makefile.am b/data/pages/Makefile.am
index 4b00a41..9f9afe9 100644
--- a/data/pages/Makefile.am
+++ b/data/pages/Makefile.am
@@ -1,7 +1,5 @@
 errorpagesdir = $(pkgdatadir)/pages
 errorpages_DATA = \
-       recovery.html \
-       process_crash.html \
        error.html
 
 stylepagesdir = $(pkgdatadir)/pages
diff --git a/data/pages/error.html b/data/pages/error.html
index 9aa39f6..71660b0 100644
--- a/data/pages/error.html
+++ b/data/pages/error.html
@@ -59,6 +59,16 @@
     html[dir="rtl"] #content .buttonbox {
       text-align: left;
     }
+
+    body.process-crash {
+      background-color: #2e3436;
+      color: #d0d1cf;
+    }
+
+    body.process-crash img {
+      width: 150px;
+      height: 150px;
+    }
   </style>
   <script type="text/javascript">
     function load_anyway()
@@ -67,7 +77,7 @@
     }
   </script>
 </head>
-<body>
+<body class="%s">
   <div id="container">
       <div id="main_icon">
         <img src="%s" />
diff --git a/embed/ephy-web-view.c b/embed/ephy-web-view.c
index 042697a..f68685b 100644
--- a/embed/ephy-web-view.c
+++ b/embed/ephy-web-view.c
@@ -2434,6 +2434,7 @@ ephy_web_view_load_error_page (EphyWebView *view,
   char *msg_title;
   char *msg;
   char *button_label;
+  const char *custom_class;
   const char *html_file;
   const char *stock_icon;
 
@@ -2452,6 +2453,10 @@ ephy_web_view_load_error_page (EphyWebView *view,
   lang = g_strdup (pango_language_to_string (gtk_get_default_language ()));
   g_strdelimit (lang, "_-@", '\0');
 
+  html_file = ephy_file ("error.html");
+  button_label = g_strdup (_("Try again"));
+  custom_class = "error";
+
   switch (page) {
     case EPHY_WEB_VIEW_ERROR_PAGE_NETWORK_ERROR:
       page_title = g_strdup_printf (_("Oops! Error loading %s"), hostname);
@@ -2466,9 +2471,6 @@ ephy_web_view_load_error_page (EphyWebView *view,
                                "internet connection is working correctly.</p>"),
                              uri, reason);
 
-      button_label = g_strdup (_("Try again"));
-
-      html_file = ephy_file ("error.html");
       stock_icon = "dialog-error";
       break;
     case EPHY_WEB_VIEW_ERROR_PAGE_HTTP_ERROR:
@@ -2478,10 +2480,6 @@ ephy_web_view_load_error_page (EphyWebView *view,
       msg = g_strdup_printf (_("<p>The website at <strong>%s</strong> has returned "
                                "the following HTTP error status code: <em>%s</em>.</p>"),
                              uri, reason);
-
-      button_label = g_strdup (_("Try again"));
-
-      html_file = ephy_file ("error.html");
       stock_icon = "dialog-error";
       break;
     case EPHY_WEB_VIEW_ERROR_PAGE_CRASH:
@@ -2496,19 +2494,14 @@ ephy_web_view_load_error_page (EphyWebView *view,
                                "please report the problem to the "
                                "<strong>%s</strong> developers.</p>"),
                              LSB_DISTRIBUTOR);
-
-      button_label = g_strdup (_("Load again anyway"));
-
-      html_file = ephy_file ("recovery.html");
       stock_icon = "dialog-information";
       break;
     case EPHY_WEB_VIEW_ERROR_PROCESS_CRASH:
       page_title = g_strdup_printf (_("Oops! Something went wrong displaying %s"), hostname);
       msg_title = g_strdup (_("Oops!"));
       msg = g_strdup (_("Something went wrong while displaying this page. Please reload or visit a different 
page to continue."));
-      button_label = NULL;
 
-      html_file = ephy_file ("process_crash.html");
+      custom_class = "process-crash";
       stock_icon = "computer-fail-symbolic";
 
       break;
@@ -2536,6 +2529,7 @@ ephy_web_view_load_error_page (EphyWebView *view,
                    ((gtk_widget_get_default_direction () == GTK_TEXT_DIR_RTL) ? "rtl" : "ltr"),
                    page_title,
                    uri,
+                   custom_class,
                    image_data ? image_data : "",
                    msg_title, msg, button_label);
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]