Skip to content
Permalink
Browse files

na-tray: Convert to GResource

  • Loading branch information...
raveit65 committed Apr 22, 2018
1 parent ff613c4 commit 9ee6deb9c12ebeb39337f228aa62abbb68ca5a38
@@ -14,7 +14,6 @@ AM_CPPFLAGS = \
-I$(top_builddir)/libmate-panel-applet \
-DMATELOCALEDIR=\""$(datadir)/locale"\" \
-DG_LOG_DOMAIN=\""notification-area-applet"\" \
-DNOTIFICATION_AREA_MENU_UI_DIR=\""$(uidir)"\" \
-DPROVIDE_WATCHER_SERVICE=1 \
$(DISABLE_DEPRECATED_CFLAGS)

@@ -33,7 +32,10 @@ libtray_la_LIBADD = \
status-notifier/libstatus-notifier.la \
system-tray/libsystem-tray.la

NOTIFICATION_AREA_SOURCES = main.c main.h
NOTIFICATION_AREA_SOURCES = \
main.c \
main.h \
$(BUILT_SOURCES)

NOTIFICATION_AREA_LDADD = \
../../libmate-panel-applet/libmate-panel-applet-4.la \
@@ -91,12 +93,23 @@ org.mate.panel.applet.NotificationAreaAppletFactory.service: $(service_in_files)
$< > $@
endif

uidir = $(datadir)/mate-panel/ui
ui_DATA = notification-area-menu.xml
ui_FILES = \
notification-area-menu.xml

na-resources.c: na.gresource.xml $(shell $(GLIB_COMPILE_RESOURCES) --sourcedir=$(srcdir) --generate-dependencies $(srcdir)/na.gresource.xml)
$(AM_V_GEN)$(GLIB_COMPILE_RESOURCES) --target=$@ --sourcedir=$(srcdir) --generate --c-name na $<

na-resources.h: na.gresource.xml $(shell $(GLIB_COMPILE_RESOURCES) --sourcedir=$(srcdir) --generate-dependencies $(srcdir)/na.gresource.xml)
$(AM_V_GEN)$(GLIB_COMPILE_RESOURCES) --target=$@ --sourcedir=$(srcdir) --generate --c-name na $<

BUILT_SOURCES = \
na-resources.c \
na-resources.h

EXTRA_DIST = \
org.mate.panel.NotificationAreaApplet.mate-panel-applet.in.in \
$(ui_DATA) \
$(ui_FILES) \
na.gresource.xml \
$(service_in_files)

CLEANFILES = \
@@ -196,13 +196,12 @@ na_tray_applet_realize (GtkWidget *widget)
parent_class_realize (widget);

GtkActionGroup* action_group;
gchar* ui_path;
action_group = gtk_action_group_new("NA Applet Menu Actions");
gtk_action_group_set_translation_domain(action_group, GETTEXT_PACKAGE);
gtk_action_group_add_actions(action_group, menu_actions, G_N_ELEMENTS(menu_actions), applet);
ui_path = g_build_filename(NOTIFICATION_AREA_MENU_UI_DIR, "notification-area-menu.xml", NULL);
mate_panel_applet_setup_menu_from_file(MATE_PANEL_APPLET(applet), ui_path, action_group);
g_free(ui_path);
mate_panel_applet_setup_menu_from_resource (MATE_PANEL_APPLET (applet),
NA_RESOURCE_PATH "notification-area-menu.xml",
action_group);
g_object_unref(action_group);
}

@@ -24,6 +24,8 @@

#include <mate-panel-applet.h>

#define NA_RESOURCE_PATH "/org/mate/panel/applet/na/"

G_BEGIN_DECLS

#define NA_TYPE_TRAY_APPLET (na_tray_applet_get_type ())
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<gresources>
<gresource prefix="/org/mate/panel/applet/na">
<file compressed="true">notification-area-menu.xml</file>
</gresource>
</gresources>

0 comments on commit 9ee6deb

Please sign in to comment.
You can’t perform that action at this time.