summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrbuj <[email protected]>2020-12-02 11:09:10 +0100
committerraveit65 <[email protected]>2020-12-13 15:40:05 +0100
commit3cf85cb5229c3e87fed2f926004fed724e94e8cb (patch)
tree3f5e8cebdc969d7ebd687c4ed508fde54cd2a4d6
parentc4499405e511d94005c58cf64489199cbb9e5a86 (diff)
downloadmate-applets-3cf85cb5229c3e87fed2f926004fed724e94e8cb.tar.bz2
mate-applets-3cf85cb5229c3e87fed2f926004fed724e94e8cb.tar.xz
stickynotes: Add stickynotes-applet-menu.xml into resource bundle
-rw-r--r--stickynotes/Makefile.am28
-rw-r--r--stickynotes/sticky-notes-resources.gresource.xml1
-rw-r--r--stickynotes/stickynotes_applet.c7
3 files changed, 13 insertions, 23 deletions
diff --git a/stickynotes/Makefile.am b/stickynotes/Makefile.am
index 6cc2c530..514c92eb 100644
--- a/stickynotes/Makefile.am
+++ b/stickynotes/Makefile.am
@@ -1,14 +1,5 @@
SUBDIRS = pixmaps docs
-ui_files = stickynotes-applet-menu.xml
-builder_files = \
- sticky-notes-delete.ui \
- sticky-notes-delete-all.ui \
- sticky-notes-note.ui \
- sticky-notes-preferences.ui \
- sticky-notes-properties.ui \
- $(NULL)
-
applet_in_files = org.mate.applets.StickyNotesApplet.mate-panel-applet.desktop.in
service_in_files = org.mate.panel.applet.StickyNotesAppletFactory.service.in
schemas_in_files = stickynotes.schemas.in
@@ -21,7 +12,6 @@ AM_CPPFLAGS = \
$(MATE_APPLETS4_CFLAGS) \
$(LIBWNCK_CFLAGS) \
$(XML2_CFLAGS) \
- -DSTICKYNOTES_MENU_UI_DIR=\""$(uidir)"\" \
-DGRESOURCE=\""/org/mate/mate-applets/sticky-notes/\"" \
${WARN_CFLAGS} \
$(NULL)
@@ -51,9 +41,6 @@ stickynotes_applet_LDADD = \
-lX11 \
$(NULL)
-uidir = $(datadir)/mate/ui
-ui_DATA = $(ui_files)
-
stickynotes_gschema_in_files = org.mate.stickynotes.gschema.xml.in
gsettings_SCHEMAS = $(stickynotes_gschema_in_files:.xml.in=.xml)
@GSETTINGS_RULES@
@@ -67,7 +54,7 @@ sticky-notes-resources.h: sticky-notes-resources.gresource.xml $(shell $(GLIB_CO
appletdir = $(datadir)/mate-panel/applets
applet_DATA = $(applet_in_files:.mate-panel-applet.desktop.in=.mate-panel-applet)
-$(applet_in_files): $(applet_in_files).in Makefile
+$(applet_in_files): $(applet_in_files:=.in) Makefile
$(AM_V_GEN)sed \
-e "s|\@LIBEXECDIR\@|$(libexecdir)|" \
-e "s|\@VERSION\@|$(PACKAGE_VERSION)|" \
@@ -97,13 +84,16 @@ CLEANFILES = \
endif
EXTRA_DIST = \
- $(builder_files) \
- $(ui_files) \
$(stickynotes_gschema_in_files) \
$(service_in_files) \
- $(applet_in_files).in \
- sticky-notes-resources.gresource.xml \
+ $(applet_in_files:=.in) \
+ sticky-notes-delete.ui \
+ sticky-notes-delete-all.ui \
+ sticky-notes-note.ui \
+ sticky-notes-preferences.ui \
+ sticky-notes-properties.ui \
+ sticky-notes-resources.gresource.xml \
+ stickynotes-applet-menu.xml \
$(NULL)
-
-include $(top_srcdir)/git.mk
diff --git a/stickynotes/sticky-notes-resources.gresource.xml b/stickynotes/sticky-notes-resources.gresource.xml
index 8157b9a4..1146428a 100644
--- a/stickynotes/sticky-notes-resources.gresource.xml
+++ b/stickynotes/sticky-notes-resources.gresource.xml
@@ -6,5 +6,6 @@
<file compressed="true">sticky-notes-note.ui</file>
<file compressed="true">sticky-notes-preferences.ui</file>
<file compressed="true">sticky-notes-properties.ui</file>
+ <file compressed="true" alias="menu.xml">stickynotes-applet-menu.xml</file>
</gresource>
</gresources>
diff --git a/stickynotes/stickynotes_applet.c b/stickynotes/stickynotes_applet.c
index c8453c88..9cc5ebdf 100644
--- a/stickynotes/stickynotes_applet.c
+++ b/stickynotes/stickynotes_applet.c
@@ -340,7 +340,6 @@ StickyNotesApplet *
stickynotes_applet_new(MatePanelApplet *mate_panel_applet)
{
AtkObject *atk_obj;
- gchar *ui_path;
/* Create Sticky Notes Applet */
StickyNotesApplet *applet = g_new(StickyNotesApplet, 1);
@@ -373,9 +372,9 @@ stickynotes_applet_new(MatePanelApplet *mate_panel_applet)
stickynotes_applet_menu_toggle_actions,
G_N_ELEMENTS (stickynotes_applet_menu_toggle_actions),
applet);
- ui_path = g_build_filename (STICKYNOTES_MENU_UI_DIR, "stickynotes-applet-menu.xml", NULL);
- mate_panel_applet_setup_menu_from_file(mate_panel_applet, ui_path, applet->action_group);
- g_free (ui_path);
+ mate_panel_applet_setup_menu_from_resource (mate_panel_applet,
+ GRESOURCE "menu.xml",
+ applet->action_group);
if (mate_panel_applet_get_locked_down (mate_panel_applet)) {
GtkAction *action;