summaryrefslogtreecommitdiff
path: root/src/forms.c
diff options
context:
space:
mode:
authorArx Cruz <arxcruz@gnome.org>2011-07-26 14:00:28 -0300
committerArx Cruz <arxcruz@gnome.org>2011-07-26 14:02:45 -0300
commit6768a40e997697d05008aecdb41815e1dbae61c6 (patch)
tree787c080cb8b3a81af70d2bb7d9c3847529e9a5f1 /src/forms.c
parentBug #592195. This fix made the --list mode return as soon as receive an ok or... (diff)
downloadzenity-6768a40e997697d05008aecdb41815e1dbae61c6.tar.gz
zenity-6768a40e997697d05008aecdb41815e1dbae61c6.tar.bz2
zenity-6768a40e997697d05008aecdb41815e1dbae61c6.zip
Fix for bug #611297 Now Zenity have --ok-label and --cancel-label in all dialogs. This patch doesn't break old zenity scripts.
Diffstat (limited to 'src/forms.c')
-rw-r--r--src/forms.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/src/forms.c b/src/forms.c
index d59a5afb..c2b9f851 100644
--- a/src/forms.c
+++ b/src/forms.c
@@ -36,6 +36,7 @@ void zenity_forms_dialog (ZenityData *data, ZenityFormsData *forms_data)
GtkWidget *dialog;
GtkWidget *table;
GtkWidget *text;
+ GtkWidget *button;
GSList *tmp;
@@ -62,7 +63,21 @@ void zenity_forms_dialog (ZenityData *data, ZenityFormsData *forms_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_forms_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_forms_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_WIDGET (gtk_builder_get_object (builder, "zenity_forms_text"));
if (forms_data->dialog_text)
bgstack15