diff options
author | Carlos Garcia Campos <cgarcia@igalia.com> | 2013-03-29 00:06:47 +0800 |
---|---|---|
committer | Carlos Garcia Campos <carlosgc@gnome.org> | 2013-04-05 21:47:37 +0800 |
commit | a2181b928e5a0f6d27487859fe86a276c1eed25c (patch) | |
tree | 9a4915e37cb5f7f75ff686c8936bc34b47ea481c /src | |
parent | efccc1eac4ac4e15fd4f5695d27a85c7d25c3cc6 (diff) | |
download | gsoc2013-epiphany-a2181b928e5a0f6d27487859fe86a276c1eed25c.tar gsoc2013-epiphany-a2181b928e5a0f6d27487859fe86a276c1eed25c.tar.gz gsoc2013-epiphany-a2181b928e5a0f6d27487859fe86a276c1eed25c.tar.bz2 gsoc2013-epiphany-a2181b928e5a0f6d27487859fe86a276c1eed25c.tar.lz gsoc2013-epiphany-a2181b928e5a0f6d27487859fe86a276c1eed25c.tar.xz gsoc2013-epiphany-a2181b928e5a0f6d27487859fe86a276c1eed25c.tar.zst gsoc2013-epiphany-a2181b928e5a0f6d27487859fe86a276c1eed25c.zip |
Compile template pages as GResources
So that they are loaded from memory instead of disk every time they are
needed.
We also get rid of ephy_file searching for the files in the file system.
https://bugzilla.gnome.org/show_bug.cgi?id=696792
Diffstat (limited to 'src')
-rw-r--r-- | src/Makefile.am | 11 | ||||
-rw-r--r-- | src/epiphany.gresource.xml | 3 | ||||
-rw-r--r-- | src/resources/error.html | 87 | ||||
-rw-r--r-- | src/resources/process-crash.html | 74 | ||||
-rw-r--r-- | src/resources/recovery.html | 87 |
5 files changed, 258 insertions, 4 deletions
diff --git a/src/Makefile.am b/src/Makefile.am index 290ca0fb0..b7e6448ad 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -8,7 +8,7 @@ bin_PROGRAMS = epiphany EXTRA_DIST = \ epiphany.gresource.xml \ - $(UI_FILES) \ + $(RESOURCE_FILES) \ $(NULL) NOINST_H_FILES = \ @@ -98,7 +98,7 @@ libephymain_la_CFLAGS = \ $(CODE_COVERAGE_CFLAGS) \ $(AM_CFLAGS) -UI_FILES = \ +RESOURCE_FILES = \ resources/epiphany-bookmark-editor-ui.xml \ resources/epiphany-history-window-ui.xml \ resources/epiphany-ui.xml \ @@ -106,12 +106,15 @@ UI_FILES = \ resources/epiphany-application-menu.ui \ resources/prefs-dialog.ui \ resources/epiphany.css \ + resources/error.html \ + resources/process-crash.html \ + resources/recovery.html \ $(NULL) -epiphany-resources.c: epiphany.gresource.xml $(UI_FILES) +epiphany-resources.c: epiphany.gresource.xml $(RESOURCE_FILES) $(AM_V_GEN)glib-compile-resources --target=$@ --sourcedir=$(srcdir)/resources --generate-source --c-name epiphany $(srcdir)/epiphany.gresource.xml -epiphany-resources.h: epiphany.gresource.xml $(UI_FILES) +epiphany-resources.h: epiphany.gresource.xml $(RESOURCE_FILES) $(AM_V_GEN)glib-compile-resources --target=$@ --sourcedir=$(srcdir)/resources --generate-header --c-name epiphany $(srcdir)/epiphany.gresource.xml EPIPHANY_RESOURCES = \ diff --git a/src/epiphany.gresource.xml b/src/epiphany.gresource.xml index b75646667..8e4d719a4 100644 --- a/src/epiphany.gresource.xml +++ b/src/epiphany.gresource.xml @@ -8,5 +8,8 @@ <file preprocess="xml-stripblanks">epiphany-bookmark-editor-ui.xml</file> <file preprocess="xml-stripblanks">epiphany-history-window-ui.xml</file> <file>epiphany.css</file> + <file alias="page-templates/error.html" compressed="true">error.html</file> + <file alias="page-templates/process-crash.html" compressed="true">process-crash.html</file> + <file alias="page-templates/recovery.html" compressed="true">recovery.html</file> </gresource> </gresources> diff --git a/src/resources/error.html b/src/resources/error.html new file mode 100644 index 000000000..9aa39f605 --- /dev/null +++ b/src/resources/error.html @@ -0,0 +1,87 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<!-- + Copyright © 2010, 2011 Vinicius Depizzol + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +--> +<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"> + body { + margin: 0 auto; + font: message-box; + } + + #container { + padding: 10% 12% 5%; + margin: 0 auto; + max-width: 650px; + } + + #main_icon { + float: left; + padding-right: 20px; + } + + html[dir="rtl"] #main_icon { + padding-left: 20px; + padding-right: 0; + float: right; + } + + #content { + display: table-cell; + vertical-align: top; + } + + #content h1 { + margin-top: 0; + } + + #content .buttonbox { + text-align: right; + } + + html[dir="rtl"] #content .buttonbox { + text-align: left; + } + </style> + <script type="text/javascript"> + function load_anyway() + { + window.location = '%s'; + } + </script> +</head> +<body> + <div id="container"> + <div id="main_icon"> + <img src="%s" /> + </div> + <div id="content"> + <h1>%s</h1> + <div class="explanation"> + %s + </div> + + <div class="buttonbox"> + <button onclick="javascript:load_anyway()">%s</button> + </div> + </div> + </div> +</body> +</html> diff --git a/src/resources/process-crash.html b/src/resources/process-crash.html new file mode 100644 index 000000000..7cf7ab93c --- /dev/null +++ b/src/resources/process-crash.html @@ -0,0 +1,74 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<!-- + Copyright © 2013 Igalia S.L. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +--> +<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"> + body { + margin: 0 auto; + font: message-box; + background-color: #2e3436; + color: #d0d1cf; + } + + #container { + padding: 10% 12% 5%; + margin: 0 auto; + max-width: 650px; + } + + #main_icon { + float: left; + padding-right: 20px; + } + + html[dir="rtl"] #main_icon { + padding-left: 20px; + padding-right: 0; + float: right; + } + + #content { + display: table-cell; + vertical-align: top; + } + + #content h1 { + margin-top: 0; + font-size: 200%; + } + </style> + +</head> +<body> + <div id="container"> + <div id="main_icon"> + <!-- We do nothing with the URI for now: %s --> + <img width="150px" height="150px" src="%s" alt="Sad face icon"/> + </div> + <div id="content"> + <h1>%s</h1> + <div class="explanation"> + %s + </div> + </div> + </div> +</body> +</html> diff --git a/src/resources/recovery.html b/src/resources/recovery.html new file mode 100644 index 000000000..9aa39f605 --- /dev/null +++ b/src/resources/recovery.html @@ -0,0 +1,87 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<!-- + Copyright © 2010, 2011 Vinicius Depizzol + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +--> +<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"> + body { + margin: 0 auto; + font: message-box; + } + + #container { + padding: 10% 12% 5%; + margin: 0 auto; + max-width: 650px; + } + + #main_icon { + float: left; + padding-right: 20px; + } + + html[dir="rtl"] #main_icon { + padding-left: 20px; + padding-right: 0; + float: right; + } + + #content { + display: table-cell; + vertical-align: top; + } + + #content h1 { + margin-top: 0; + } + + #content .buttonbox { + text-align: right; + } + + html[dir="rtl"] #content .buttonbox { + text-align: left; + } + </style> + <script type="text/javascript"> + function load_anyway() + { + window.location = '%s'; + } + </script> +</head> +<body> + <div id="container"> + <div id="main_icon"> + <img src="%s" /> + </div> + <div id="content"> + <h1>%s</h1> + <div class="explanation"> + %s + </div> + + <div class="buttonbox"> + <button onclick="javascript:load_anyway()">%s</button> + </div> + </div> + </div> +</body> +</html> |