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



commit 619a72fd01fadce28ab156f8965ce29359297bce
Author: Jasper St. Pierre <jstpierre mecheye net>
Date:   Thu Jan 24 23:51:00 2013 -0500

    welcome: Port to standalone resources

 .gitignore                                         |    2 ++
 gnome-initial-setup/pages/welcome/Makefile.am      |   14 ++++++++++++--
 .../pages/welcome/gis-welcome-page.c               |    2 ++
 .../pages/welcome/welcome.gresource.xml            |    7 +++++++
 gnome-initial-setup/setup.gresource.xml            |    2 --
 5 files changed, 23 insertions(+), 4 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index a042751..34fe66a 100644
--- a/.gitignore
+++ b/.gitignore
@@ -55,6 +55,8 @@ 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/welcome/welcome-resources.c
+gnome-initial-setup/pages/welcome/welcome-resources.h
 
 gnome-initial-setup.desktop
 gnome-initial-setup-copy-worker.desktop
diff --git a/gnome-initial-setup/pages/welcome/Makefile.am b/gnome-initial-setup/pages/welcome/Makefile.am
index 06e54aa..10a2740 100644
--- a/gnome-initial-setup/pages/welcome/Makefile.am
+++ b/gnome-initial-setup/pages/welcome/Makefile.am
@@ -1,8 +1,18 @@
 
 noinst_LTLIBRARIES = libgiswelcome.la
 
-libgiswelcome_la_SOURCES =	\
-	gis-welcome-page.c gis-welcome-page.h
+BUILT_SOURCES =
+
+resource_files = $(shell glib-compile-resources --sourcedir=$(srcdir) --generate-dependencies $(srcdir)/welcome.gresource.xml)
+welcome-resources.c: welcome.gresource.xml $(resource_files)
+	$(AM_V_GEN) $(GLIB_COMPILE_RESOURCES) --target=$@ --sourcedir=$(srcdir) --generate-source $<
+welcome-resources.h: welcome.gresource.xml $(resource_files)
+	$(AM_V_GEN) $(GLIB_COMPILE_RESOURCES) --target=$@ --sourcedir=$(srcdir) --generate-header $<
+BUILT_SOURCES += welcome-resources.c welcome-resources.h
+
+libgiswelcome_la_SOURCES =			\
+	gis-welcome-page.c gis-welcome-page.h	\
+	$(BUILT_SOURCES)
 
 libgiswelcome_la_CFLAGS = $(INITIAL_SETUP_CFLAGS) -I "$(srcdir)/../.."
 libgiswelcome_la_LIBADD = $(INITIAL_SETUP_LIBS)
diff --git a/gnome-initial-setup/pages/welcome/gis-welcome-page.c b/gnome-initial-setup/pages/welcome/gis-welcome-page.c
index 14cfd56..93353fa 100644
--- a/gnome-initial-setup/pages/welcome/gis-welcome-page.c
+++ b/gnome-initial-setup/pages/welcome/gis-welcome-page.c
@@ -27,6 +27,7 @@
 
 #include "config.h"
 #include "gis-welcome-page.h"
+#include "welcome-resources.h"
 
 #include <glib/gi18n.h>
 #include <gio/gio.h>
@@ -64,6 +65,7 @@ gis_welcome_page_class_init (GisWelcomePageClass *klass)
 static void
 gis_welcome_page_init (GisWelcomePage *page)
 {
+  g_resources_register (welcome_get_resource ());
 }
 
 void
diff --git a/gnome-initial-setup/pages/welcome/welcome.gresource.xml b/gnome-initial-setup/pages/welcome/welcome.gresource.xml
new file mode 100644
index 0000000..bb3fc83
--- /dev/null
+++ b/gnome-initial-setup/pages/welcome/welcome.gresource.xml
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<gresources>
+  <gresource prefix="/org/gnome/initial-setup">
+    <file preprocess="xml-stripblanks" alias="gis-welcome-page.ui">gis-welcome-page.ui</file>
+    <file alias="welcome-image.png">welcome-image.png</file>
+  </gresource>
+</gresources>
diff --git a/gnome-initial-setup/setup.gresource.xml b/gnome-initial-setup/setup.gresource.xml
index 614ca35..be3949f 100644
--- a/gnome-initial-setup/setup.gresource.xml
+++ b/gnome-initial-setup/setup.gresource.xml
@@ -1,8 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <gresources>
   <gresource prefix="/org/gnome/initial-setup">
-    <file preprocess="xml-stripblanks" alias="gis-welcome-page.ui">pages/welcome/gis-welcome-page.ui</file>
-    <file alias="welcome-image.png">pages/welcome/welcome-image.png</file>
     <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>



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