[gnome-screenshot] build: add the save dialog UI file to the GResource



commit c61701497487f5795e19815365ef79ae775156e3
Author: Cosimo Cecchi <cosimoc gnome org>
Date:   Mon Jun 4 10:47:42 2012 -0400

    build: add the save dialog UI file to the GResource
    
    Now that we have one, use it for the UI file of the save dialog as well.

 po/POTFILES.in                                    |    2 +-
 src/Makefile.am                                   |   15 ++++++---------
 src/gnome-screenshot.gresource.xml                |    1 +
 src/screenshot-dialog.c                           |    3 +--
 src/{gnome-screenshot.ui => screenshot-dialog.ui} |    0
 5 files changed, 9 insertions(+), 12 deletions(-)
---
diff --git a/po/POTFILES.in b/po/POTFILES.in
index f4dd9a8..4253df6 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -2,8 +2,8 @@
 # Please keep this file sorted alphabetically.
 src/gnome-screenshot.c
 src/gnome-screenshot.desktop.in
-[type: gettext/glade]src/gnome-screenshot.ui
 [type: gettext/glade]src/screenshot-app-menu.ui
+[type: gettext/glade]src/screenshot-dialog.ui
 src/org.gnome.gnome-screenshot.gschema.xml.in
 src/screenshot-application.c
 src/screenshot-config.c
diff --git a/src/Makefile.am b/src/Makefile.am
index 6e04709..7e2aef1 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -11,14 +11,15 @@ bin_PROGRAMS = \
 	gnome-screenshot		\
 	$(NULL)
 
-UI_FILES = \
+ui_files = \
 	screenshot-app-menu.ui		\
+	screenshot-dialog.ui		\
 	$(NULL)
 
-screenshot-resources.c: gnome-screenshot.gresource.xml $(UI_FILES)
+screenshot-resources.c: gnome-screenshot.gresource.xml $(ui_files)
 	$(AM_V_GEN)glib-compile-resources --target=$@ --sourcedir=$(srcdir) --generate-source --c-name screenshot $(srcdir)/gnome-screenshot.gresource.xml
 
-screenshot-resources.h: gnome-screenshot.gresource.xml $(UI_FILES)
+screenshot-resources.h: gnome-screenshot.gresource.xml $(ui_files)
 	$(AM_V_GEN)glib-compile-resources --target=$@ --sourcedir=$(srcdir) --generate-header --c-name screenshot $(srcdir)/gnome-screenshot.gresource.xml
 
 BUILT_SOURCES = \
@@ -67,11 +68,6 @@ gnome_screenshot_DATA = $(gnome_screenshot_in_files:.desktop.in=.desktop)
 
 man_MANS = gnome-screenshot.1
 
-uidir = $(datadir)/gnome-screenshot
-ui_DATA =					\
-	gnome-screenshot.ui			\
-	$(NULL)
-
 gsettingsschema_in_files = org.gnome.gnome-screenshot.gschema.xml.in
 gsettings_SCHEMAS = $(gsettingsschema_in_files:.xml.in=.xml)
 .PRECIOUS: $(gsettings_SCHEMAS)
@@ -87,8 +83,9 @@ EXTRA_DIST =					\
 	$(gsettingsschema_in_files)		\
 	$(gnome_screenshot_in_files)		\
 	$(man_MANS)				\
-	$(ui_DATA)				\
 	$(convert_DATA)				\
+	$(ui_files)				\
+	gnome-screenshot.gresource.xml		\
 	$(NULL)
 
 CLEANFILES = \
diff --git a/src/gnome-screenshot.gresource.xml b/src/gnome-screenshot.gresource.xml
index e228b73..dbd88f8 100644
--- a/src/gnome-screenshot.gresource.xml
+++ b/src/gnome-screenshot.gresource.xml
@@ -2,5 +2,6 @@
 <gresources>
   <gresource prefix="/org/gnome/screenshot">
     <file preprocess="xml-stripblanks">screenshot-app-menu.ui</file>
+    <file preprocess="xml-stripblanks">screenshot-dialog.ui</file>
   </gresource>
 </gresources>
diff --git a/src/screenshot-dialog.c b/src/screenshot-dialog.c
index 62de843..5c9cdbd 100644
--- a/src/screenshot-dialog.c
+++ b/src/screenshot-dialog.c
@@ -156,8 +156,7 @@ screenshot_dialog_new (GdkPixbuf *screenshot,
   dialog->screenshot = screenshot;
 
   ui = gtk_builder_new ();
-  gtk_builder_set_translation_domain (ui, GETTEXT_PACKAGE);
-  res = gtk_builder_add_from_file (ui, UIDIR "/gnome-screenshot.ui", NULL);
+  res = gtk_builder_add_from_resource (ui, "/org/gnome/screenshot/screenshot-dialog.ui", NULL);
   g_assert (res != 0);
 
   width = gdk_pixbuf_get_width (screenshot);
diff --git a/src/gnome-screenshot.ui b/src/screenshot-dialog.ui
similarity index 100%
rename from src/gnome-screenshot.ui
rename to src/screenshot-dialog.ui



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