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:01:37 +0200
commitcfe060300ff10557f8805eee176604095c48cc2d (patch)
treec52c7f5d23819a981635089f021a9de032461c14 /applets/clock/clock.c
parentc61d3711954a959ebc7c957ac4f39c8ca3b783e9 (diff)
downloadmate-panel-cfe060300ff10557f8805eee176604095c48cc2d.tar.bz2
mate-panel-cfe060300ff10557f8805eee176604095c48cc2d.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");