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/progress.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'src/progress.c') diff --git a/src/progress.c b/src/progress.c index 6dc93f87..b16e400d 100644 --- a/src/progress.c +++ b/src/progress.c @@ -227,6 +227,7 @@ void zenity_progress (ZenityData *data, ZenityProgressData *progress_data) { GtkWidget *dialog; + GtkWidget *button; GObject *text; GObject *progress_bar; GObject *cancel_button,*ok_button; @@ -255,6 +256,20 @@ zenity_progress (ZenityData *data, ZenityProgressData *progress_data) if (data->width > -1 || data->height > -1) gtk_window_set_default_size (GTK_WINDOW (dialog), data->width, data->height); + if (data->ok_label) { + button = GTK_WIDGET (gtk_builder_get_object (builder, "zenity_progress_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_progress_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)); + } + text = gtk_builder_get_object (builder, "zenity_progress_text"); if (progress_data->dialog_text) -- cgit