[zenity/jjardon/no_deprecated: 5/12] Do not use an icon for Cancel/OK buttons



commit 4a6f9ec03bc9e210145a2bcea33c72c67981c1dd
Author: Javier Jardón <jjardon gnome org>
Date:   Sun Mar 22 04:57:05 2015 +0000

    Do not use an icon for Cancel/OK buttons
    
    GTK+ documentation recommends to not use an icons, but use
    "_OK"/"_Cancel" labels instead

 src/calendar.c      |    4 ----
 src/color.c         |    4 ----
 src/entry.c         |    4 ----
 src/fileselection.c |    4 ++--
 src/forms.c         |    4 ----
 src/msg.c           |    6 ------
 src/password.c      |    4 ++--
 src/progress.c      |    4 ----
 src/scale.c         |    4 ----
 src/text.c          |    4 ----
 src/tree.c          |    4 ----
 11 files changed, 4 insertions(+), 42 deletions(-)
---
diff --git a/src/calendar.c b/src/calendar.c
index e896797..0166c50 100644
--- a/src/calendar.c
+++ b/src/calendar.c
@@ -95,15 +95,11 @@ zenity_calendar (ZenityData *data, ZenityCalendarData *cal_data)
   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);
diff --git a/src/color.c b/src/color.c
index e3b8a42..6820bbb 100644
--- a/src/color.c
+++ b/src/color.c
@@ -60,16 +60,12 @@ void zenity_colorselection (ZenityData *data, ZenityColorData *color_data)
   if (data->ok_label) {
     g_object_get (G_OBJECT (dialog), "ok-button", &button, NULL);
     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));
     g_object_unref (G_OBJECT (button));
   }
 
   if (data->cancel_label) {
     g_object_get (G_OBJECT (dialog), "cancel-button", &button, NULL);
     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 (G_OBJECT (button));
   }
 
diff --git a/src/entry.c b/src/entry.c
index ca5e375..efb2234 100644
--- a/src/entry.c
+++ b/src/entry.c
@@ -87,15 +87,11 @@ zenity_entry (ZenityData *data, ZenityEntryData *entry_data)
   if (data->ok_label) {
     button = GTK_WIDGET (gtk_builder_get_object (builder, "zenity_entry_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_entry_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_entry_text");
diff --git a/src/fileselection.c b/src/fileselection.c
index 9edbb6a..3049555 100644
--- a/src/fileselection.c
+++ b/src/fileselection.c
@@ -52,8 +52,8 @@ void zenity_fileselection (ZenityData *data, ZenityFileData *file_data)
 
   dialog = gtk_file_chooser_dialog_new (NULL, NULL,
                                        action,
-                                       GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
-                                       GTK_STOCK_OK, GTK_RESPONSE_OK,
+                                       _("_Cancel"), GTK_RESPONSE_CANCEL,
+                                       _("_OK"), GTK_RESPONSE_OK,
                                        NULL);
 
   gtk_file_chooser_set_do_overwrite_confirmation (GTK_FILE_CHOOSER (dialog), 
diff --git a/src/forms.c b/src/forms.c
index 59c6461..072908e 100644
--- a/src/forms.c
+++ b/src/forms.c
@@ -209,15 +209,11 @@ void zenity_forms_dialog (ZenityData *data, ZenityFormsData *forms_data)
   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"));
diff --git a/src/msg.c b/src/msg.c
index dabd174..8d617f1 100644
--- a/src/msg.c
+++ b/src/msg.c
@@ -40,14 +40,10 @@ zenity_msg_construct_question_dialog (GtkWidget *dialog, ZenityMsgData *msg_data
 
   if (data->cancel_label) {
     gtk_button_set_label (GTK_BUTTON (cancel_button), data->cancel_label);
-    gtk_button_set_image (GTK_BUTTON (cancel_button), 
-                          gtk_image_new_from_stock (GTK_STOCK_CANCEL, GTK_ICON_SIZE_BUTTON));
   }
 
   if (data->ok_label) {
     gtk_button_set_label (GTK_BUTTON (ok_button), data->ok_label);
-    gtk_button_set_image (GTK_BUTTON (ok_button), 
-                          gtk_image_new_from_stock (GTK_STOCK_OK, GTK_ICON_SIZE_BUTTON));
   }
 }
 
@@ -119,8 +115,6 @@ zenity_msg (ZenityData *data, ZenityMsgData *msg_data)
   if (ok_button) {
     if (data->ok_label) {
       gtk_button_set_label (GTK_BUTTON (ok_button), data->ok_label);
-      gtk_button_set_image (GTK_BUTTON (ok_button),
-                            gtk_image_new_from_stock (GTK_STOCK_OK, GTK_ICON_SIZE_BUTTON));
     }
   }
 
diff --git a/src/password.c b/src/password.c
index ff254fd..6d85390 100644
--- a/src/password.c
+++ b/src/password.c
@@ -45,10 +45,10 @@ void zenity_password_dialog (ZenityData *data, ZenityPasswordData *password_data
   dialog = gtk_dialog_new ();
 
   gtk_dialog_add_button(GTK_DIALOG(dialog), 
-                        data->cancel_label != NULL ? data->cancel_label : GTK_STOCK_CANCEL, 
+                        data->cancel_label != NULL ? data->cancel_label : _("_Cancel"),
                         GTK_RESPONSE_CANCEL);
   gtk_dialog_add_button(GTK_DIALOG(dialog), 
-                        data->ok_label != NULL ? data->ok_label : GTK_STOCK_OK, 
+                        data->ok_label != NULL ? data->ok_label : _("_OK"),
                         GTK_RESPONSE_OK);
   
   image = gtk_image_new_from_stock(GTK_STOCK_DIALOG_AUTHENTICATION,
diff --git a/src/progress.c b/src/progress.c
index 3fd2c2e..dfbdd8a 100644
--- a/src/progress.c
+++ b/src/progress.c
@@ -319,15 +319,11 @@ zenity_progress (ZenityData *data, ZenityProgressData *progress_data)
   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));
   }
 
   if (progress_data->dialog_text)
diff --git a/src/scale.c b/src/scale.c
index adcf67b..ea56dd2 100644
--- a/src/scale.c
+++ b/src/scale.c
@@ -82,15 +82,11 @@ zenity_scale (ZenityData *data, ZenityScaleData *scale_data)
   if (data->ok_label) {
     button = GTK_WIDGET (gtk_builder_get_object (builder, "zenity_scale_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_scale_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));
   }
 
   if (scale_data->dialog_text) 
diff --git a/src/text.c b/src/text.c
index 8f383b9..83aff9b 100644
--- a/src/text.c
+++ b/src/text.c
@@ -278,14 +278,10 @@ zenity_text (ZenityData *data, ZenityTextData *text_data)
 
   if (data->ok_label) { 
     gtk_button_set_label (GTK_BUTTON (ok_button), data->ok_label);
-    gtk_button_set_image (GTK_BUTTON (ok_button),
-                          gtk_image_new_from_stock (GTK_STOCK_OK, GTK_ICON_SIZE_BUTTON));
   }
 
   if (data->cancel_label) {
     gtk_button_set_label (GTK_BUTTON (cancel_button), data->cancel_label);
-    gtk_button_set_image (GTK_BUTTON (cancel_button), 
-                          gtk_image_new_from_stock (GTK_STOCK_CANCEL, GTK_ICON_SIZE_BUTTON));
   }
 
   if (text_data->checkbox) {
diff --git a/src/tree.c b/src/tree.c
index 819f9a8..ac61cd8 100644
--- a/src/tree.c
+++ b/src/tree.c
@@ -399,15 +399,11 @@ zenity_tree (ZenityData *data, ZenityTreeData *tree_data)
   if (data->ok_label) {
     button = GTK_WIDGET (gtk_builder_get_object (builder, "zenity_tree_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_tree_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_tree_text");


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]