diff options
-rw-r--r-- | configure.ac | 1 | ||||
-rw-r--r-- | data/Makefile.am | 2 | ||||
-rw-r--r-- | data/pages/Makefile.am | 5 | ||||
-rw-r--r-- | embed/ephy-web-view.c | 20 | ||||
-rw-r--r-- | src/epiphany.gresource.xml | 1 | ||||
-rw-r--r-- | src/resources/error.css (renamed from data/pages/error.css) | 0 | ||||
-rw-r--r-- | src/resources/error.html | 3 |
7 files changed, 15 insertions, 17 deletions
diff --git a/configure.ac b/configure.ac index 53736d075..fd3acfe13 100644 --- a/configure.ac +++ b/configure.ac @@ -190,7 +190,6 @@ AC_CONFIG_FILES([ Makefile data/Makefile data/icons/Makefile -data/pages/Makefile gvdb/Makefile help/Makefile libgd/Makefile diff --git a/data/Makefile.am b/data/Makefile.am index ffe757628..cf99150ea 100644 --- a/data/Makefile.am +++ b/data/Makefile.am @@ -1,4 +1,4 @@ -SUBDIRS = icons pages +SUBDIRS = icons desktop_in_files = org.gnome.Epiphany.desktop.in desktopdir = $(datadir)/applications diff --git a/data/pages/Makefile.am b/data/pages/Makefile.am deleted file mode 100644 index 7cb72f8f9..000000000 --- a/data/pages/Makefile.am +++ /dev/null @@ -1,5 +0,0 @@ -stylepagesdir = $(pkgdatadir)/pages -dist_stylepages_DATA = \ - error.css - --include $(top_srcdir)/git.mk diff --git a/embed/ephy-web-view.c b/embed/ephy-web-view.c index d552e0498..93279faa5 100644 --- a/embed/ephy-web-view.c +++ b/embed/ephy-web-view.c @@ -65,6 +65,7 @@ #define MAX_HIDDEN_POPUPS 5 #define EPHY_PAGE_TEMPLATE_ERROR "/org/gnome/epiphany/page-templates/error.html" +#define EPHY_PAGE_TEMPLATE_ERROR_CSS "/org/gnome/epiphany/page-templates/error.css" struct _EphyWebView { WebKitWebView parent_instance; @@ -1670,15 +1671,12 @@ ephy_web_view_set_placeholder (EphyWebView *view, static char * get_style_sheet (void) { - const gchar *file; - GError *error = NULL; - char *sheet = NULL; + GBytes *bytes; + const char *sheet; - file = ephy_file ("error.css"); - if (file && !g_file_get_contents (file, &sheet, NULL, &error)) { - g_debug ("Unable to load error style sheet: %s", error->message); - g_error_free (error); - } + bytes = g_resources_lookup_data (EPHY_PAGE_TEMPLATE_ERROR_CSS, 0, NULL); + sheet = g_strdup (g_bytes_get_data (bytes, NULL)); + g_bytes_unref (bytes); return sheet; } @@ -1990,6 +1988,7 @@ ephy_web_view_load_error_page (EphyWebView *view, char *hidden_button_label = NULL; char *button_action = NULL; char *hidden_button_action = NULL; + char *style_sheet = NULL; const char *button_accesskey = NULL; const char *hidden_button_accesskey = NULL; const char *icon_name = NULL; @@ -2071,6 +2070,8 @@ ephy_web_view_load_error_page (EphyWebView *view, _ephy_web_view_update_icon (view); + style_sheet = get_style_sheet (); + #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wformat-nonliteral" /* The HTML file is trusted input. */ @@ -2079,7 +2080,7 @@ ephy_web_view_load_error_page (EphyWebView *view, lang, lang, ((gtk_widget_get_default_direction () == GTK_TEXT_DIR_RTL) ? "rtl" : "ltr"), page_title, - get_style_sheet (), + style_sheet, button_action, hidden_button_action, icon_name, page == EPHY_WEB_VIEW_ERROR_INVALID_TLS_CERTIFICATE ? "danger" : "default", @@ -2103,6 +2104,7 @@ ephy_web_view_load_error_page (EphyWebView *view, g_free (button_action); g_free (hidden_button_label); g_free (hidden_button_action); + g_free (style_sheet); /* Make our history backend ignore the next page load, since it will be an error page. */ ephy_web_view_freeze_history (view); diff --git a/src/epiphany.gresource.xml b/src/epiphany.gresource.xml index 5ce4f1ac8..c5861d6b5 100644 --- a/src/epiphany.gresource.xml +++ b/src/epiphany.gresource.xml @@ -10,6 +10,7 @@ <file compressed="true">prism.css</file> <file compressed="true">prism.js</file> <file alias="page-templates/about.css" compressed="true">about.css</file> + <file alias="page-templates/error.css" compressed="true">error.css</file> <file alias="page-templates/error.html" compressed="true">error.html</file> <file preprocess="xml-stripblanks" compressed="true">clear-data-dialog.ui</file> <file preprocess="xml-stripblanks" compressed="true">cookies-dialog.ui</file> diff --git a/data/pages/error.css b/src/resources/error.css index ffc508f87..ffc508f87 100644 --- a/data/pages/error.css +++ b/src/resources/error.css diff --git a/src/resources/error.html b/src/resources/error.html index 7dfc0a88d..f0ed9fb7f 100644 --- a/src/resources/error.html +++ b/src/resources/error.html @@ -18,11 +18,12 @@ You should have received a copy of the GNU General Public License along with Epiphany. If not, see <http://www.gnu.org/licenses/>. --> +<!-- Keep in mind that this file is a format template. Each raw % has to be %%. --> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="%s" lang="%s" dir="%s"> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <title>%s</title> - <style type="text/css">%s</style> + <style>%s</style> <script type="text/javascript"> function buttonAction() { %s |