summaryrefslogtreecommitdiff
path: root/netspeed/src
diff options
context:
space:
mode:
authorrbuj <[email protected]>2020-07-29 12:57:44 +0200
committerraveit65 <[email protected]>2020-08-11 12:40:09 +0200
commite095fd2471fb9b41c264e502473fea19a445b938 (patch)
tree07343422ab85257fa60ee80895027f2bccd9a43b /netspeed/src
parent61621285351bcab5e21de1586f319b330cf69c40 (diff)
downloadmate-applets-e095fd2471fb9b41c264e502473fea19a445b938.tar.bz2
mate-applets-e095fd2471fb9b41c264e502473fea19a445b938.tar.xz
netspeed: Load netspeed-menu.xml from resources
Diffstat (limited to 'netspeed/src')
-rw-r--r--netspeed/src/Makefile.am2
-rw-r--r--netspeed/src/netspeed.c15
2 files changed, 9 insertions, 8 deletions
diff --git a/netspeed/src/Makefile.am b/netspeed/src/Makefile.am
index dae9df37..404076ee 100644
--- a/netspeed/src/Makefile.am
+++ b/netspeed/src/Makefile.am
@@ -6,7 +6,7 @@ AM_CPPFLAGS = \
$(GIO_CFLAGS) \
$(GTOP_APPLETS_CFLAGS) \
$(MATE_APPLETS4_CFLAGS) \
- -DNETSPEED_MENU_UI_DIR=\""$(datadir)/mate/ui"\" \
+ -DNETSPEED_RESOURCE_PATH=\""/org/mate/mate-applets/netspeed/"\" \
${WARN_CFLAGS}
if HAVE_NL
diff --git a/netspeed/src/netspeed.c b/netspeed/src/netspeed.c
index adb218cd..0fdcc3c0 100644
--- a/netspeed/src/netspeed.c
+++ b/netspeed/src/netspeed.c
@@ -1158,7 +1158,7 @@ settings_cb (GtkAction *action,
return;
}
- builder = gtk_builder_new_from_resource ("/org/mate/mate-applets/netspeed/netspeed-preferences.ui");
+ builder = gtk_builder_new_from_resource (NETSPEED_RESOURCE_PATH "netspeed-preferences.ui");
applet->settings = GET_DIALOG ("preferences_dialog");
applet->network_device_combo = GET_WIDGET ("network_device_combo");
@@ -1297,7 +1297,7 @@ showinfo_cb (GtkAction *action,
return;
}
- builder = gtk_builder_new_from_resource ("/org/mate/mate-applets/netspeed/netspeed-details.ui");
+ builder = gtk_builder_new_from_resource (NETSPEED_RESOURCE_PATH "netspeed-details.ui");
applet->details = GET_DIALOG ("dialog");
applet->drawingarea = GET_DRAWING_AREA ("drawingarea");
@@ -1550,6 +1550,7 @@ mate_netspeed_applet_factory(MatePanelApplet *applet_widget, const gchar *iid, g
MateNetspeedApplet *applet;
int i;
GtkWidget *spacer, *spacer_box;
+ GtkActionGroup *action_group;
/* Have our background automatically painted. */
mate_panel_applet_set_background_widget(MATE_PANEL_APPLET(applet_widget),
@@ -1718,17 +1719,17 @@ mate_netspeed_applet_factory(MatePanelApplet *applet_widget, const gchar *iid, g
G_CALLBACK(mate_netspeed_enter_cb),
(gpointer)applet);
- GtkActionGroup *action_group;
- gchar *ui_path;
action_group = gtk_action_group_new ("Netspeed Applet Actions");
gtk_action_group_set_translation_domain (action_group, GETTEXT_PACKAGE);
gtk_action_group_add_actions (action_group,
mate_netspeed_applet_menu_actions,
G_N_ELEMENTS (mate_netspeed_applet_menu_actions),
applet);
- ui_path = g_build_filename (NETSPEED_MENU_UI_DIR, "netspeed-menu.xml", NULL);
- mate_panel_applet_setup_menu_from_file (MATE_PANEL_APPLET (applet->applet), ui_path, action_group);
- g_free (ui_path);
+
+ mate_panel_applet_setup_menu_from_resource (MATE_PANEL_APPLET (applet->applet),
+ NETSPEED_RESOURCE_PATH "netspeed-menu.xml",
+ action_group);
+
g_object_unref (action_group);
return TRUE;