Skip to content

Commit 54a9de1

Browse files
sc0wlukefromdc
authored andcommitted
caja-autorun: avoid gtk_dialog_add_buttons with stock ids
1 parent ff1b432 commit 54a9de1

File tree

1 file changed

+28
-4
lines changed

1 file changed

+28
-4
lines changed

libcaja-private/caja-autorun.c

Lines changed: 28 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -915,6 +915,24 @@ combo_box_enter_ok (GtkWidget *togglebutton, GdkEventKey *event, GtkDialog *dial
915915
return FALSE;
916916
}
917917

918+
static void
919+
mate_dialog_add_button (GtkDialog *dialog,
920+
const gchar *button_text,
921+
const gchar *icon_name,
922+
gint response_id)
923+
{
924+
GtkWidget *button;
925+
926+
button = gtk_button_new_with_mnemonic (button_text);
927+
gtk_button_set_image (GTK_BUTTON (button), gtk_image_new_from_icon_name (icon_name, GTK_ICON_SIZE_BUTTON));
928+
929+
gtk_button_set_use_underline (GTK_BUTTON (button), TRUE);
930+
gtk_style_context_add_class (gtk_widget_get_style_context (button), "text-button");
931+
gtk_widget_set_can_default (button, TRUE);
932+
gtk_widget_show (button);
933+
gtk_dialog_add_action_widget (GTK_DIALOG (dialog), button, response_id);
934+
}
935+
918936
/* returns TRUE if a folder window should be opened */
919937
static gboolean
920938
do_autorun_for_content_type (GMount *mount, const char *x_content_type, CajaAutorunOpenWindow open_window_func, gpointer user_data)
@@ -1126,10 +1144,16 @@ do_autorun_for_content_type (GMount *mount, const char *x_content_type, CajaAuto
11261144
data);
11271145
gtk_box_pack_start (GTK_BOX (vbox), always_check_button, TRUE, TRUE, 0);
11281146

1129-
gtk_dialog_add_buttons (GTK_DIALOG (dialog),
1130-
"gtk-cancel", GTK_RESPONSE_CANCEL,
1131-
"gtk-ok", GTK_RESPONSE_OK,
1132-
NULL);
1147+
mate_dialog_add_button (GTK_DIALOG (dialog),
1148+
_("_Cancel"),
1149+
"process-stop",
1150+
GTK_RESPONSE_CANCEL);
1151+
1152+
mate_dialog_add_button (GTK_DIALOG (dialog),
1153+
_("_OK"),
1154+
"gtk-ok",
1155+
GTK_RESPONSE_OK);
1156+
11331157
gtk_dialog_set_default_response (GTK_DIALOG (dialog), GTK_RESPONSE_OK);
11341158

11351159
if (g_mount_can_eject (mount))

0 commit comments

Comments
 (0)