Commit 6f48e0f4 authored by Cosimo Cecchi's avatar Cosimo Cecchi Committed by Bastien Nocera
Browse files

privacy: use a GResource for GtkBuilder UI definition

https://bugzilla.gnome.org/show_bug.cgi?id=691132
parent 30644257
...@@ -3,24 +3,28 @@ cappletname = privacy ...@@ -3,24 +3,28 @@ cappletname = privacy
INCLUDES = \ INCLUDES = \
$(PANEL_CFLAGS) \ $(PANEL_CFLAGS) \
$(PRIVACY_PANEL_CFLAGS) \ $(PRIVACY_PANEL_CFLAGS) \
-DGNOMECC_UI_DIR="\"$(uidir)\"" \
-DGNOMELOCALEDIR="\"$(datadir)/locale\"" \ -DGNOMELOCALEDIR="\"$(datadir)/locale\"" \
-DGNOMECC_DATA_DIR="\"$(pkgdatadir)\"" \
-DDATADIR="\"$(datadir)\"" \
-I$(top_srcdir)/panels/common/ \ -I$(top_srcdir)/panels/common/ \
$(NULL) $(NULL)
noinst_LTLIBRARIES = libprivacy.la noinst_LTLIBRARIES = libprivacy.la
BUILT_SOURCES = \
cc-privacy-resources.c \
cc-privacy-resources.h
libprivacy_la_SOURCES = \ libprivacy_la_SOURCES = \
$(BUILT_SOURCES) \
cc-privacy-panel.c \ cc-privacy-panel.c \
cc-privacy-panel.h cc-privacy-panel.h
libprivacy_la_LIBADD = $(PANEL_LIBS) $(PRIVACY_PANEL_LIBS) libprivacy_la_LIBADD = $(PANEL_LIBS) $(PRIVACY_PANEL_LIBS)
uidir = $(pkgdatadir)/ui resource_files = $(shell glib-compile-resources --generate-dependencies $(srcdir)/privacy.gresource.xml)
dist_ui_DATA = \ cc-privacy-resources.c: privacy.gresource.xml $(resource_files)
privacy.ui $(AM_V_GEN) glib-compile-resources --target=$@ --sourcedir=$(srcdir) --generate-source --c-name cc_privacy $<
cc-privacy-resources.h: privacy.gresource.xml $(resource_files)
$(AM_V_GEN) glib-compile-resources --target=$@ --sourcedir=$(srcdir) --generate-header --c-name cc_privacy $<
@INTLTOOL_DESKTOP_RULE@ @INTLTOOL_DESKTOP_RULE@
...@@ -28,6 +32,7 @@ desktopdir = $(datadir)/applications ...@@ -28,6 +32,7 @@ desktopdir = $(datadir)/applications
desktop_in_files = gnome-privacy-panel.desktop.in desktop_in_files = gnome-privacy-panel.desktop.in
desktop_DATA = $(desktop_in_files:.desktop.in=.desktop) desktop_DATA = $(desktop_in_files:.desktop.in=.desktop)
CLEANFILES = $(desktop_in_files) $(desktop_DATA) CLEANFILES = $(desktop_in_files) $(desktop_DATA) $(BUILT_SOURCES)
EXTRA_DIST = $(resource_files) privacy.gresource.xml
-include $(top_srcdir)/git.mk -include $(top_srcdir)/git.mk
...@@ -20,6 +20,7 @@ ...@@ -20,6 +20,7 @@
*/ */
#include "cc-privacy-panel.h" #include "cc-privacy-panel.h"
#include "cc-privacy-resources.h"
#include <egg-list-box/egg-list-box.h> #include <egg-list-box/egg-list-box.h>
#include <gio/gdesktopappinfo.h> #include <gio/gdesktopappinfo.h>
...@@ -666,13 +667,14 @@ cc_privacy_panel_init (CcPrivacyPanel *self) ...@@ -666,13 +667,14 @@ cc_privacy_panel_init (CcPrivacyPanel *self)
guint res; guint res;
self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, CC_TYPE_PRIVACY_PANEL, CcPrivacyPanelPrivate); self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, CC_TYPE_PRIVACY_PANEL, CcPrivacyPanelPrivate);
g_resources_register (cc_privacy_get_resource ());
self->priv->builder = gtk_builder_new (); self->priv->builder = gtk_builder_new ();
error = NULL; error = NULL;
res = gtk_builder_add_from_file (self->priv->builder, res = gtk_builder_add_from_resource (self->priv->builder,
GNOMECC_UI_DIR "/privacy.ui", "/org/gnome/control-center/privacy/privacy.ui",
&error); &error);
if (res == 0) if (res == 0)
{ {
......
<?xml version="1.0" encoding="UTF-8"?>
<gresources>
<gresource prefix="/org/gnome/control-center/privacy">
<file preprocess="xml-stripblanks">privacy.ui</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