summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJavier Jardón <jjardon@gnome.org>2015-03-22 04:57:05 +0000
committerJavier Jardón <jjardon@gnome.org>2015-03-22 09:16:16 +0000
commit6fcbb80fd1b5268fbedcdb985ffa873a2e475840 (patch)
treef524152264d2e8ff1d16f1622ddaf160f014ec1c /src
parentsrc/zenity.ui: Do not use deprecated stock images (diff)
downloadzenity-6fcbb80fd1b5268fbedcdb985ffa873a2e475840.tar.gz
zenity-6fcbb80fd1b5268fbedcdb985ffa873a2e475840.tar.bz2
zenity-6fcbb80fd1b5268fbedcdb985ffa873a2e475840.zip
Do not use an icon for Cancel/OK buttons
GTK+ documentation recommends to not use an icons, but use "_OK"/"_Cancel" labels instead
Diffstat (limited to 'src')
-rw-r--r--src/calendar.c4
-rw-r--r--src/color.c4
-rw-r--r--src/entry.c4
-rw-r--r--src/fileselection.c4
-rw-r--r--src/forms.c4
-rw-r--r--src/msg.c6
-rw-r--r--src/password.c4
-rw-r--r--src/progress.c4
-rw-r--r--src/scale.c4
-rw-r--r--src/text.c4
-rw-r--r--src/tree.c4
11 files changed, 4 insertions, 42 deletions
diff --git a/src/calendar.c b/src/calendar.c
index e8967974..0166c500 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 e3b8a428..6820bbbe 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 ca5e3752..efb2234d 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 9edbb6ae..30495558 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 59c6461f..072908e6 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 4132ae98..ce25ab3a 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 ff254fde..6d85390b 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 3fd2c2ef..dfbdd8a9 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 adcf67be..ea56dd22 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 8f383b9c..83aff9b5 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 819f9a8e..ac61cd87 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");
bgstack15