Commit 5975b177 authored by Cosimo Cecchi's avatar Cosimo Cecchi Committed by Bastien Nocera
Browse files

notifications: use a GResource for GtkBuilder UI definition

https://bugzilla.gnome.org/show_bug.cgi?id=691132
parent 57de0ab0
......@@ -3,14 +3,17 @@ cappletname = notifications
INCLUDES = \
$(PANEL_CFLAGS) \
$(NOTIFICATIONS_PANEL_CFLAGS) \
-DGNOMECC_UI_DIR="\"$(uidir)\"" \
-DGNOMELOCALEDIR="\"$(datadir)/locale\"" \
-DGNOMECC_DATA_DIR="\"$(pkgdatadir)\"" \
$(NULL)
noinst_LTLIBRARIES = libnotifications.la
BUILT_SOURCES = \
cc-notifications-resources.c \
cc-notifications-resources.h
libnotifications_la_SOURCES = \
$(BUILT_SOURCES) \
cc-edit-dialog.c \
cc-edit-dialog.h \
cc-notifications-panel.c \
......@@ -18,8 +21,11 @@ libnotifications_la_SOURCES = \
libnotifications_la_LIBADD = $(NOTIFICATIONS_PANEL_LIBS) $(PANEL_LIBS)
uidir = $(pkgdatadir)/ui
dist_ui_DATA = notifications.ui
resource_files = $(shell glib-compile-resources --generate-dependencies $(srcdir)/notifications.gresource.xml)
cc-notifications-resources.c: notifications.gresource.xml $(resource_files)
$(AM_V_GEN) glib-compile-resources --target=$@ --sourcedir=$(srcdir) --generate-source --c-name cc_notifications $<
cc-notifications-resources.h: notifications.gresource.xml $(resource_files)
$(AM_V_GEN) glib-compile-resources --target=$@ --sourcedir=$(srcdir) --generate-header --c-name cc_notifications $<
@INTLTOOL_DESKTOP_RULE@
......@@ -27,6 +33,7 @@ desktopdir = $(datadir)/applications
desktop_in_files = gnome-notifications-panel.desktop.in
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) notifications.gresource.xml
-include $(top_srcdir)/git.mk
......@@ -29,6 +29,7 @@
#include <egg-list-box/egg-list-box.h>
#include "cc-notifications-panel.h"
#include "cc-notifications-resources.h"
#include "cc-edit-dialog.h"
#define MASTER_SCHEMA "org.gnome.desktop.notifications"
......@@ -114,13 +115,14 @@ cc_notifications_panel_init (CcNotificationsPanel *panel)
GtkWidget *w;
GError *error = NULL;
g_resources_register (cc_notifications_get_resource ());
panel->known_applications = g_hash_table_new_full (g_str_hash, g_str_equal,
NULL, g_free);
panel->builder = gtk_builder_new ();
if (gtk_builder_add_from_file (panel->builder,
GNOMECC_UI_DIR "/notifications.ui",
&error) == 0)
if (gtk_builder_add_from_resource (panel->builder,
"/org/gnome/control-center/notifications/notifications.ui",
&error) == 0)
{
g_error ("Error loading UI file: %s", error->message);
g_error_free (error);
......
<?xml version="1.0" encoding="UTF-8"?>
<gresources>
<gresource prefix="/org/gnome/control-center/notifications">
<file preprocess="xml-stripblanks">notifications.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