[gnome-initial-setup] language: Port to standalone resources



commit 5e8dfe13422569c2cdc1dad9bd1093610ece78df
Author: Jasper St. Pierre <jstpierre mecheye net>
Date:   Thu Jan 24 23:54:47 2013 -0500

    language: Port to standalone resources

 .gitignore                                         |    3 ++-
 gnome-initial-setup/pages/language/Makefile.am     |   16 +++++++++++++---
 .../pages/language/gis-language-page.c             |    4 ++--
 .../pages/language/language.gresource.xml          |    6 ++++++
 gnome-initial-setup/setup.gresource.xml            |    1 -
 5 files changed, 23 insertions(+), 7 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index 34fe66a..20685b6 100644
--- a/.gitignore
+++ b/.gitignore
@@ -54,7 +54,8 @@ gnome-initial-setup/pages/location/timedated.c
 gnome-initial-setup/pages/location/timedated.h
 gnome-initial-setup/pages/location/cc-datetime-resources.c
 gnome-initial-setup/pages/location/cc-datetime-resources.h
-gnome-initial-setup/pages/language/languages/list-languages
+gnome-initial-setup/pages/language/language-resources.c
+gnome-initial-setup/pages/language/language-resources.h
 gnome-initial-setup/pages/welcome/welcome-resources.c
 gnome-initial-setup/pages/welcome/welcome-resources.h
 
diff --git a/gnome-initial-setup/pages/language/Makefile.am b/gnome-initial-setup/pages/language/Makefile.am
index 117fbd1..ae519fd 100644
--- a/gnome-initial-setup/pages/language/Makefile.am
+++ b/gnome-initial-setup/pages/language/Makefile.am
@@ -8,9 +8,19 @@ AM_CPPFLAGS = \
 	-DDATADIR=\""$(datadir)"\" \
 	-DGNOMELOCALEDIR=\""$(datadir)/locale"\"
 
-libgislanguage_la_SOURCES =	\
-	cc-common-language.c cc-common-language.h \
-	gis-language-page.c gis-language-page.h
+BUILT_SOURCES =
+
+resource_files = $(shell glib-compile-resources --sourcedir=$(srcdir) --generate-dependencies $(srcdir)/language.gresource.xml)
+language-resources.c: language.gresource.xml $(resource_files)
+	$(AM_V_GEN) $(GLIB_COMPILE_RESOURCES) --target=$@ --sourcedir=$(srcdir) --generate-source $<
+language-resources.h: language.gresource.xml $(resource_files)
+	$(AM_V_GEN) $(GLIB_COMPILE_RESOURCES) --target=$@ --sourcedir=$(srcdir) --generate-header $<
+BUILT_SOURCES += language-resources.c language-resources.h
+
+libgislanguage_la_SOURCES =				\
+	cc-common-language.c cc-common-language.h 	\
+	gis-language-page.c gis-language-page.h		\
+	$(BUILT_SOURCES)
 
 libgislanguage_la_CFLAGS = $(INITIAL_SETUP_CFLAGS)
 libgislanguage_la_LIBADD = $(INITIAL_SETUP_LIBS)
diff --git a/gnome-initial-setup/pages/language/gis-language-page.c b/gnome-initial-setup/pages/language/gis-language-page.c
index adfc15a..0bf3eac 100644
--- a/gnome-initial-setup/pages/language/gis-language-page.c
+++ b/gnome-initial-setup/pages/language/gis-language-page.c
@@ -26,6 +26,7 @@
 #define PAGE_ID "language"
 
 #include "config.h"
+#include "language-resources.h"
 #include "gis-language-page.h"
 
 #include <locale.h>
@@ -41,8 +42,6 @@
 
 #include <egg-list-box.h>
 
-#include "gis-language-page.h"
-
 G_DEFINE_TYPE (GisLanguagePage, gis_language_page, GIS_TYPE_PAGE);
 
 #define GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GIS_TYPE_LANGUAGE_PAGE, GisLanguagePagePrivate))
@@ -385,6 +384,7 @@ gis_language_page_class_init (GisLanguagePageClass *klass)
 static void
 gis_language_page_init (GisLanguagePage *page)
 {
+  g_resources_register (language_get_resource ());
   page->priv = GET_PRIVATE (page);
 }
 
diff --git a/gnome-initial-setup/pages/language/language.gresource.xml b/gnome-initial-setup/pages/language/language.gresource.xml
new file mode 100644
index 0000000..06a124f
--- /dev/null
+++ b/gnome-initial-setup/pages/language/language.gresource.xml
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<gresources>
+  <gresource prefix="/org/gnome/initial-setup">
+    <file preprocess="xml-stripblanks" alias="gis-language-page.ui">gis-language-page.ui</file>
+  </gresource>
+</gresources>
diff --git a/gnome-initial-setup/setup.gresource.xml b/gnome-initial-setup/setup.gresource.xml
index be3949f..d758710 100644
--- a/gnome-initial-setup/setup.gresource.xml
+++ b/gnome-initial-setup/setup.gresource.xml
@@ -1,7 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <gresources>
   <gresource prefix="/org/gnome/initial-setup">
-    <file preprocess="xml-stripblanks" alias="gis-language-page.ui">pages/language/gis-language-page.ui</file>
     <file preprocess="xml-stripblanks" alias="gis-keyboard-page.ui">pages/keyboard/gis-keyboard-page.ui</file>
     <file preprocess="xml-stripblanks" alias="gnome-region-panel-input-chooser.ui">pages/keyboard/gnome-region-panel-input-chooser.ui</file>
     <file preprocess="xml-stripblanks" alias="gis-eula-page.ui">pages/eulas/gis-eula-page.ui</file>



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