Commit 0ba34208 authored by Felix Riemann's avatar Felix Riemann

postasa: Embed UI data files using GResource

parent ece06e8f
......@@ -13,7 +13,11 @@ INCLUDES = \
plugin_LTLIBRARIES = libpostasa.la
BUILT_SOURCES = \
eog-postasa-plugin-resources.c
libpostasa_la_SOURCES = \
${BUILT_SOURCES} \
eog-postasa-plugin.h \
eog-postasa-plugin.c
......@@ -24,22 +28,25 @@ libpostasa_la_LDFLAGS = \
libpostasa_la_LIBADD = $(EOG_LIBS) \
$(POSTASA_LIBS)
eog-postasa-plugin-resources.c: eog-postasa-plugin.gresource.xml $(shell $(GLIB_COMPILE_RESOURCES) --sourcedir=$(srcdir) --generate-dependencies $(srcdir)/eog-postasa-plugin.gresource.xml)
$(AM_V_GEN) $(GLIB_COMPILE_RESOURCES) --internal --target=$@ --sourcedir=$(srcdir) --generate-source $(srcdir)/eog-postasa-plugin.gresource.xml
UI_FILES = postasa-config.xml postasa-uploads.xml
# Plugin Info
plugin_in_files = postasa.plugin.desktop.in
UI_FILES = postasa-config.xml postasa-uploads.xml
ui_DATA = $(UI_FILES)
uidir = $(EOG_PLUGINS_DATA_DIR)/postasa
%.plugin: %.plugin.desktop.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*po) ; $(AM_V_GEN)$(INTLTOOL_MERGE) $(top_srcdir)/po $< $@ -d -u -c $(top_builddir)/po/.intltool-merge-cache
plugin_DATA = $(plugin_in_files:.plugin.desktop.in=.plugin)
EXTRA_DIST = $(plugin_in_files) $(UI_FILES)
EXTRA_DIST = \
$(plugin_in_files) \
$(UI_FILES) \
eog-postasa-plugin.gresource.xml
CLEANFILES = $(plugin_DATA)
DISTCLEANFILES = $(plugin_DATA)
CLEANFILES = $(plugin_DATA) $(BUILT_SOURCES)
DISTCLEANFILES = $(plugin_DATA) $(BUILT_SOURCES)
-include $(top_srcdir)/git.mk
......@@ -38,8 +38,9 @@
#include <gdata/gdata.h>
#define GTKBUILDER_CONFIG_FILE EOG_POSTASA_DATA_DIR"/postasa-config.xml"
#define GTKBUILDER_UPLOAD_FILE EOG_POSTASA_DATA_DIR"/postasa-uploads.xml"
#define EOG_POSTASA_RESOURCE_PREFIX "/org/gnome/eog/plugins/postasa"
#define GTKBUILDER_CONFIG_FILE EOG_POSTASA_RESOURCE_PREFIX"/postasa-config.xml"
#define GTKBUILDER_UPLOAD_FILE EOG_POSTASA_RESOURCE_PREFIX"/postasa-uploads.xml"
enum {
PROP_O,
......@@ -197,7 +198,8 @@ uploads_get_dialog (EogPostasaPlugin *plugin)
if (plugin->priv->uploads_window == NULL) {
builder = gtk_builder_new ();
gtk_builder_set_translation_domain (builder, GETTEXT_PACKAGE);
gtk_builder_add_from_file (builder, GTKBUILDER_UPLOAD_FILE, &error);
gtk_builder_add_from_resource (builder, GTKBUILDER_UPLOAD_FILE,
&error);
if (error != NULL) {
g_warning ("Couldn't load Postasa uploads UI file:%d:%s", error->code, error->message);
g_error_free (error);
......@@ -748,7 +750,8 @@ login_get_dialog (EogPostasaPlugin *plugin)
if (plugin->priv->login_dialog == NULL) {
builder = gtk_builder_new ();
gtk_builder_set_translation_domain (builder, GETTEXT_PACKAGE);
gtk_builder_add_from_file (builder, GTKBUILDER_CONFIG_FILE, &error);
gtk_builder_add_from_resource (builder, GTKBUILDER_CONFIG_FILE,
&error);
if (error != NULL) {
g_warning ("Couldn't load Postasa configuration UI file:%d:%s", error->code, error->message);
g_error_free (error);
......
<?xml version="1.0" encoding="UTF-8"?>
<gresources>
<gresource prefix="/org/gnome/eog/plugins/postasa">
<file compressed="true" preprocess="xml-stripblanks">postasa-config.xml</file>
<file compressed="true" preprocess="xml-stripblanks">postasa-uploads.xml</file>
</gresource>
</gresources>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment