diff options
author | Pablo Barciela <[email protected]> | 2018-02-22 23:26:41 +0100 |
---|---|---|
committer | lukefromdc <[email protected]> | 2018-02-22 20:58:07 -0500 |
commit | 54a9de15cde0302ee1d624176279a5d3dd2e4951 (patch) | |
tree | 0a2d9e3d9d043e3c6c69e5e2a6febaca5c97e94e /libcaja-private | |
parent | ff1b432f989c29a89a39fa547784044cd78499f3 (diff) | |
download | caja-54a9de15cde0302ee1d624176279a5d3dd2e4951.tar.bz2 caja-54a9de15cde0302ee1d624176279a5d3dd2e4951.tar.xz |
caja-autorun: avoid gtk_dialog_add_buttons with stock ids
Diffstat (limited to 'libcaja-private')
-rw-r--r-- | libcaja-private/caja-autorun.c | 32 |
1 files changed, 28 insertions, 4 deletions
diff --git a/libcaja-private/caja-autorun.c b/libcaja-private/caja-autorun.c index 1b85237a..110b9fe7 100644 --- a/libcaja-private/caja-autorun.c +++ b/libcaja-private/caja-autorun.c @@ -915,6 +915,24 @@ combo_box_enter_ok (GtkWidget *togglebutton, GdkEventKey *event, GtkDialog *dial return FALSE; } +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); +} + /* returns TRUE if a folder window should be opened */ static gboolean do_autorun_for_content_type (GMount *mount, const char *x_content_type, CajaAutorunOpenWindow open_window_func, gpointer user_data) @@ -1126,10 +1144,16 @@ show_dialog: data); gtk_box_pack_start (GTK_BOX (vbox), always_check_button, TRUE, TRUE, 0); - gtk_dialog_add_buttons (GTK_DIALOG (dialog), - "gtk-cancel", GTK_RESPONSE_CANCEL, - "gtk-ok", GTK_RESPONSE_OK, - NULL); + mate_dialog_add_button (GTK_DIALOG (dialog), + _("_Cancel"), + "process-stop", + GTK_RESPONSE_CANCEL); + + mate_dialog_add_button (GTK_DIALOG (dialog), + _("_OK"), + "gtk-ok", + GTK_RESPONSE_OK); + gtk_dialog_set_default_response (GTK_DIALOG (dialog), GTK_RESPONSE_OK); if (g_mount_can_eject (mount)) |