summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPablo Barciela <[email protected]>2018-02-24 18:17:49 +0100
committerPablo Barciela <[email protected]>2018-02-27 17:09:21 +0100
commit9778a3a06089fa6d0f3db29f51b6ff149c0befa3 (patch)
treebe0eee7b00ebb2316a95ed1e928291b1d6fe7f66
parent5f0ad00b5f3c48c01bf3d9444cb186437932e64c (diff)
downloadcaja-9778a3a06089fa6d0f3db29f51b6ff149c0befa3.tar.bz2
caja-9778a3a06089fa6d0f3db29f51b6ff149c0befa3.tar.xz
eel-stock-dialogs: avoid gtk_dialog_add_button with stock ids
-rw-r--r--eel/eel-stock-dialogs.c26
1 files changed, 24 insertions, 2 deletions
diff --git a/eel/eel-stock-dialogs.c b/eel/eel-stock-dialogs.c
index ba5f20fc..752fbebb 100644
--- a/eel/eel-stock-dialogs.c
+++ b/eel/eel-stock-dialogs.c
@@ -191,6 +191,24 @@ trash_dialog_response_callback (GtkDialog *dialog,
gtk_widget_destroy (GTK_WIDGET (dialog));
}
+static void
+mate_dialog_add_button (GtkDialog *dialog,
+ const gchar *button_text,
+ const gchar *icon_name,
+ gint response_id)
+{
+ GtkWidget *button;
+
+ button = gtk_button_new_with_mnemonic (button_text);
+ gtk_button_set_image (GTK_BUTTON (button), gtk_image_new_from_icon_name (icon_name, GTK_ICON_SIZE_BUTTON));
+
+ gtk_button_set_use_underline (GTK_BUTTON (button), TRUE);
+ gtk_style_context_add_class (gtk_widget_get_style_context (button), "text-button");
+ gtk_widget_set_can_default (button, TRUE);
+ gtk_widget_show (button);
+ gtk_dialog_add_action_widget (GTK_DIALOG (dialog), button, response_id);
+}
+
static gboolean
timed_wait_callback (gpointer callback_data)
{
@@ -201,7 +219,7 @@ timed_wait_callback (gpointer callback_data)
wait = callback_data;
/* Put up the timed wait window. */
- button = wait->cancel_callback != NULL ? "gtk-cancel" : "gtk-ok";
+ button = wait->cancel_callback != NULL ? "process-stop" : "gtk-ok";
dialog = GTK_DIALOG (gtk_message_dialog_new (wait->parent_window,
0,
GTK_MESSAGE_INFO,
@@ -213,7 +231,11 @@ timed_wait_callback (gpointer callback_data)
"secondary-text", _("You can stop this operation by clicking cancel."),
NULL);
- gtk_dialog_add_button (GTK_DIALOG (dialog), button, GTK_RESPONSE_OK);
+ if (g_strcmp0 (button, "process-stop") == 0)
+ mate_dialog_add_button (GTK_DIALOG (dialog), _("_Cancel"), button, GTK_RESPONSE_OK);
+ else
+ mate_dialog_add_button (GTK_DIALOG (dialog), _("_OK"), button, GTK_RESPONSE_OK);
+
gtk_dialog_set_default_response (GTK_DIALOG (dialog), GTK_RESPONSE_OK);
/* The contents are often very small, causing tiny little