[gnome-clocks] Reorganize resources



commit 300839414b3f6d5825cc6cedaa3076615ac767b3
Author: Paolo Borelli <pborelli gnome org>
Date:   Sun Mar 17 12:14:45 2013 +0100

    Reorganize resources
    
    Move ui files in the data dir and use resources also for css

 Makefile.am                     |   28 +++++++++-------------------
 data/gnome-clocks.gresource.xml |   16 ++++++++++++++++
 {src => data/ui}/alarm.ui       |    0
 {src => data/ui}/menu.ui        |    0
 {src => data/ui}/stopwatch.ui   |    0
 {src => data/ui}/timer.ui       |    0
 {src => data/ui}/window.ui      |    0
 {src => data/ui}/world.ui       |    0
 po/POTFILES.in                  |   12 ++++++------
 src/gnome-clocks.gresource.xml  |   11 -----------
 src/utils.vala                  |    4 ++--
 11 files changed, 33 insertions(+), 38 deletions(-)
---
diff --git a/Makefile.am b/Makefile.am
index 3b63ab6..024993d 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -73,15 +73,6 @@ images_DATA = \
        data/images/day.png \
        data/images/night.png
 
-# css
-cssdir = $(datadir)/gnome-clocks/css
-css_DATA = \
-       data/css/gnome-clocks.css \
-       data/css/button-border-go-active.svg \
-       data/css/button-border-go.svg \
-       data/css/button-border-stop-active.svg \
-       data/css/button-border-stop.svg
-
 AM_CPPFLAGS = \
        -I$(top_srcdir)/egg-list-box \
        -I$(top_srcdir)/libgd \
@@ -105,8 +96,8 @@ bin_PROGRAMS = gnome-clocks
 BUILT_SOURCES = \
        src/resources.c
 
-src/resources.c: $(top_srcdir)/src/gnome-clocks.gresource.xml $(shell $(GLIB_COMPILE_RESOURCES) 
--generate-dependencies --sourcedir=$(top_srcdir)/src $(top_srcdir)/src/gnome-clocks.gresource.xml)
-       $(AM_V_GEN) $(GLIB_COMPILE_RESOURCES) --target=$@ --sourcedir=$(top_srcdir)/src --generate-source $<
+src/resources.c: $(top_srcdir)/data/gnome-clocks.gresource.xml $(shell $(GLIB_COMPILE_RESOURCES) 
--generate-dependencies --sourcedir=$(top_srcdir)/data $(top_srcdir)/data/gnome-clocks.gresource.xml)
+       $(AM_V_GEN) $(GLIB_COMPILE_RESOURCES) --target=$@ --sourcedir=$(top_srcdir)/data --generate-source $<
 
 VALA_SOURCES = \
        src/application.vala \
@@ -144,15 +135,14 @@ EXTRA_DIST = \
        $(icon_files) \
        $(hcicon_files) \
        $(images_DATA) \
-       $(css_DATA) \
        data/org.gnome.clocks.gschema.xml.in \
-       src/gnome-clocks.gresource.xml \
-       src/alarm.ui \
-       src/menu.ui \
-       src/stopwatch.ui \
-       src/timer.ui \
-       src/window.ui \
-       src/world.ui
+       data/gnome-clocks.gresource.xml \
+       data/ui/alarm.ui \
+       data/ui/menu.ui \
+       data/ui/stopwatch.ui \
+       data/ui/timer.ui \
+       data/ui/window.ui \
+       data/ui/world.ui
 
 CLEANFILES = \
        $(applications_DATA)
diff --git a/data/gnome-clocks.gresource.xml b/data/gnome-clocks.gresource.xml
new file mode 100644
index 0000000..680fede
--- /dev/null
+++ b/data/gnome-clocks.gresource.xml
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<gresources>
+  <gresource prefix="/org/gnome/clocks">
+    <file>css/gnome-clocks.css</file>
+    <file preprocess="xml-stripblanks">css/button-border-go.svg</file>
+    <file preprocess="xml-stripblanks">css/button-border-go-active.svg</file>
+    <file preprocess="xml-stripblanks">css/button-border-stop.svg</file>
+    <file preprocess="xml-stripblanks">css/button-border-stop-active.svg</file>
+    <file preprocess="xml-stripblanks">ui/menu.ui</file>
+    <file preprocess="xml-stripblanks">ui/window.ui</file>
+    <file preprocess="xml-stripblanks">ui/world.ui</file>
+    <file preprocess="xml-stripblanks">ui/alarm.ui</file>
+    <file preprocess="xml-stripblanks">ui/stopwatch.ui</file>
+    <file preprocess="xml-stripblanks">ui/timer.ui</file>
+  </gresource>
+</gresources>
diff --git a/src/alarm.ui b/data/ui/alarm.ui
similarity index 100%
rename from src/alarm.ui
rename to data/ui/alarm.ui
diff --git a/src/menu.ui b/data/ui/menu.ui
similarity index 100%
rename from src/menu.ui
rename to data/ui/menu.ui
diff --git a/src/stopwatch.ui b/data/ui/stopwatch.ui
similarity index 100%
rename from src/stopwatch.ui
rename to data/ui/stopwatch.ui
diff --git a/src/timer.ui b/data/ui/timer.ui
similarity index 100%
rename from src/timer.ui
rename to data/ui/timer.ui
diff --git a/src/window.ui b/data/ui/window.ui
similarity index 100%
rename from src/window.ui
rename to data/ui/window.ui
diff --git a/src/world.ui b/data/ui/world.ui
similarity index 100%
rename from src/world.ui
rename to data/ui/world.ui
diff --git a/po/POTFILES.in b/po/POTFILES.in
index 47781df..76e2ada 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -9,9 +9,9 @@ src/utils.vala
 src/widgets.vala
 src/window.vala
 src/world.vala
-[type: gettext/glade]src/alarm.ui
-[type: gettext/glade]src/menu.ui
-[type: gettext/glade]src/stopwatch.ui
-[type: gettext/glade]src/timer.ui
-[type: gettext/glade]src/window.ui
-[type: gettext/glade]src/world.ui
+[type: gettext/glade]data/ui/alarm.ui
+[type: gettext/glade]data/ui/menu.ui
+[type: gettext/glade]data/ui/stopwatch.ui
+[type: gettext/glade]data/ui/timer.ui
+[type: gettext/glade]data/ui/window.ui
+[type: gettext/glade]data/ui/world.ui
diff --git a/src/utils.vala b/src/utils.vala
index 50cb7ed..e43b1d3 100644
--- a/src/utils.vala
+++ b/src/utils.vala
@@ -24,8 +24,8 @@ namespace Utils {
 public Gtk.CssProvider load_css (string css) {
     var provider = new Gtk.CssProvider ();
     try {
-        var path = Path.build_filename (Config.DATADIR, "gnome-clocks", "css", css);
-        provider.load_from_path (path);
+        var file = File.new_for_uri("resource:///org/gnome/clocks/css/" + css);
+        provider.load_from_file (file);
     } catch (Error e) {
         warning ("loading css: %s", e.message);
     }


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