diff options
author | Rodney Dawes <dobey@novell.com> | 2004-12-18 02:03:22 +0800 |
---|---|---|
committer | Rodney Dawes <dobey@src.gnome.org> | 2004-12-18 02:03:22 +0800 |
commit | 0fe65f8c1ac38f909d17cee1d61dad092ac164a0 (patch) | |
tree | 6ce2cfe8e5ea1ff5c7fac0abde307554e3636937 /calendar/gui | |
parent | 603f99314a9d14b4e8d7212f1d2d4189a4fe733a (diff) | |
download | gsoc2013-evolution-0fe65f8c1ac38f909d17cee1d61dad092ac164a0.tar.gz gsoc2013-evolution-0fe65f8c1ac38f909d17cee1d61dad092ac164a0.tar.zst gsoc2013-evolution-0fe65f8c1ac38f909d17cee1d61dad092ac164a0.zip |
Add callback function for doing ngettext on the "minutes" label
2004-12-17 Rodney Dawes <dobey@novell.com>
* gui/alarm-notify/alarm-notify-dialog.c (an_minutes_update_label):
Add callback function for doing ngettext on the "minutes" label
(alarm_notify_dialog): Get the "minutes" label from the glade file
and set the callback for its "value_changed" signal
Fixes #47535
svn path=/trunk/; revision=28146
Diffstat (limited to 'calendar/gui')
-rw-r--r-- | calendar/gui/alarm-notify/alarm-notify-dialog.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/calendar/gui/alarm-notify/alarm-notify-dialog.c b/calendar/gui/alarm-notify/alarm-notify-dialog.c index 77c83520d9..8d60fb7c70 100644 --- a/calendar/gui/alarm-notify/alarm-notify-dialog.c +++ b/calendar/gui/alarm-notify/alarm-notify-dialog.c @@ -49,6 +49,7 @@ typedef struct { GtkWidget *dialog; GtkWidget *title; GtkWidget *snooze_time; + GtkWidget *minutes_label; GtkWidget *description; GtkWidget *location; GtkWidget *start; @@ -65,6 +66,21 @@ enum { +static void +an_update_minutes_label (GtkSpinButton *sb, gpointer data) +{ + AlarmNotify *an; + char *new_label; + int snooze_timeout; + + an = (AlarmNotify *) data; + + snooze_timeout = gtk_spin_button_get_value_as_int (sb); + new_label = g_strdup (ngettext ("minute", "minutes", snooze_timeout)); + gtk_label_set_text (GTK_LABEL (an->minutes_label), new_label); + g_free (new_label); +} + /** * alarm_notify_dialog: * @trigger: Trigger time for the alarm. @@ -122,6 +138,7 @@ alarm_notify_dialog (time_t trigger, time_t occur_start, time_t occur_end, an->dialog = glade_xml_get_widget (an->xml, "alarm-notify"); an->title = glade_xml_get_widget (an->xml, "title-label"); an->snooze_time = glade_xml_get_widget (an->xml, "snooze-time"); + an->minutes_label = glade_xml_get_widget (an->xml, "minutes-label"); an->description = glade_xml_get_widget (an->xml, "description-label"); an->location = glade_xml_get_widget (an->xml, "location-label"); an->start = glade_xml_get_widget (an->xml, "start-label"); @@ -167,6 +184,9 @@ alarm_notify_dialog (time_t trigger, time_t occur_start, time_t occur_end, end = timet_to_str_with_zone (occur_end, current_zone); gtk_label_set_text (GTK_LABEL (an->end), end); + /* Set callback for updating the snooze "minutes" label */ + g_signal_connect (G_OBJECT (an->snooze_time), "value_changed", + G_CALLBACK (an_update_minutes_label), an); /* Run! */ if (!GTK_WIDGET_REALIZED (an->dialog)) |