diff options
-rw-r--r-- | calendar/ChangeLog | 9 | ||||
-rw-r--r-- | calendar/gui/alarm-notify/alarm-notify-dialog.c | 20 |
2 files changed, 29 insertions, 0 deletions
diff --git a/calendar/ChangeLog b/calendar/ChangeLog index 4bd16537b3..bcd936c525 100644 --- a/calendar/ChangeLog +++ b/calendar/ChangeLog @@ -1,3 +1,12 @@ +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 + 2004-12-13 Harish Krishnaswamy <kharish@novell.com> * gui/dialogs/calendar-setup.c : Correct some white space 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)) |