From 6768a40e997697d05008aecdb41815e1dbae61c6 Mon Sep 17 00:00:00 2001 From: Arx Cruz Date: Tue, 26 Jul 2011 14:00:28 -0300 Subject: Fix for bug #611297 Now Zenity have --ok-label and --cancel-label in all dialogs. This patch doesn't break old zenity scripts. --- src/calendar.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'src/calendar.c') diff --git a/src/calendar.c b/src/calendar.c index 32825da9..c62c1818 100644 --- a/src/calendar.c +++ b/src/calendar.c @@ -39,6 +39,7 @@ zenity_calendar (ZenityData *data, ZenityCalendarData *cal_data) { GtkBuilder *builder; GtkWidget *dialog; + GtkWidget *button; GObject *text; zen_cal_data = cal_data; @@ -84,10 +85,24 @@ zenity_calendar (ZenityData *data, ZenityCalendarData *cal_data) gtk_label_set_mnemonic_widget (GTK_LABEL (text), calendar); zenity_util_show_dialog (dialog); - if(data->timeout_delay > 0) { + if (data->timeout_delay > 0) { g_timeout_add_seconds (data->timeout_delay, (GSourceFunc) zenity_util_timeout_handle, dialog); } + if (data->ok_label) { + button = GTK_WIDGET (gtk_builder_get_object (builder, "zenity_calendar_ok_button")); + gtk_button_set_label (GTK_BUTTON (button), data->ok_label); + gtk_button_set_image (GTK_BUTTON (button), + gtk_image_new_from_stock (GTK_STOCK_OK, GTK_ICON_SIZE_BUTTON)); + } + + if (data->cancel_label) { + button = GTK_WIDGET (gtk_builder_get_object (builder, "zenity_calendar_cancel_button")); + gtk_button_set_label (GTK_BUTTON (button), data->cancel_label); + gtk_button_set_image (GTK_BUTTON (button), + gtk_image_new_from_stock (GTK_STOCK_CANCEL, GTK_ICON_SIZE_BUTTON)); + } + g_object_unref (builder); gtk_main (); -- cgit