summaryrefslogtreecommitdiff
path: root/applets/clock/clock.c
diff options
context:
space:
mode:
authorVincent Untz <[email protected]>2012-02-02 14:04:27 +0100
committerraveit65 <[email protected]>2018-04-26 13:04:47 +0200
commitdcb6025f4f4a0aadda5fea831d0cb520d2201b15 (patch)
tree4f91b5a0316630cd99ae0b2e224c2179b1d2aa80 /applets/clock/clock.c
parent0e8b631161bc33e75bf0663ce4f5849bb60355ec (diff)
downloadmate-panel-dcb6025f4f4a0aadda5fea831d0cb520d2201b15.tar.bz2
mate-panel-dcb6025f4f4a0aadda5fea831d0cb520d2201b15.tar.xz
clock: Convert to GResource
origin commits: https://git.gnome.org/browse/gnome-panel/commit/?h=gnome-3-4&id=aa2895d https://git.gnome.org/browse/gnome-panel/commit/?h=gnome-3-4&id=695d30c https://git.gnome.org/browse/gnome-panel/commit/?h=gnome-3-4&id=00f9870 https://git.gnome.org/browse/gnome-panel/commit/?h=gnome-3-4&id=9ade365
Diffstat (limited to 'applets/clock/clock.c')
-rw-r--r--applets/clock/clock.c22
1 files changed, 4 insertions, 18 deletions
diff --git a/applets/clock/clock.c b/applets/clock/clock.c
index a17d642e..ad659fe5 100644
--- a/applets/clock/clock.c
+++ b/applets/clock/clock.c
@@ -2377,9 +2377,6 @@ fill_clock_applet (MatePanelApplet *applet)
ClockData *cd;
GtkActionGroup *action_group;
GtkAction *action;
- gchar *ui_path;
- char *filename;
- GError *error;
mate_panel_applet_set_flags (applet, MATE_PANEL_APPLET_EXPAND_MINOR);
@@ -2394,17 +2391,7 @@ fill_clock_applet (MatePanelApplet *applet)
cd->builder = gtk_builder_new ();
gtk_builder_set_translation_domain (cd->builder, GETTEXT_PACKAGE);
- filename = g_build_filename (BUILDERDIR, "clock.ui", NULL);
-
- error = NULL;
- gtk_builder_add_from_file (cd->builder, filename, &error);
- if (error) {
- g_warning ("Error loading \"%s\": %s",
- filename, error->message);
- g_error_free (error);
- }
-
- g_free (filename);
+ gtk_builder_add_from_resource (cd->builder, CLOCK_RESOURCE_PATH "clock.ui", NULL);
create_clock_widget (cd);
@@ -2436,10 +2423,9 @@ fill_clock_applet (MatePanelApplet *applet)
clock_menu_actions,
G_N_ELEMENTS (clock_menu_actions),
cd);
- ui_path = g_build_filename (CLOCK_MENU_UI_DIR, "clock-menu.xml", NULL);
- mate_panel_applet_setup_menu_from_file (MATE_PANEL_APPLET (cd->applet),
- ui_path, action_group);
- g_free (ui_path);
+ mate_panel_applet_setup_menu_from_resource (MATE_PANEL_APPLET (cd->applet),
+ CLOCK_RESOURCE_PATH "clock-menu.xml",
+ action_group);
if (mate_panel_applet_get_locked_down (MATE_PANEL_APPLET (cd->applet))) {
action = gtk_action_group_get_action (action_group, "ClockPreferences");