From 471a9893af493a9c25d3fa1b2fe702bac21942b3 Mon Sep 17 00:00:00 2001 From: Alexey Chernyshov Date: Mon, 18 Nov 2019 21:27:16 +0200 Subject: [PATCH] file-operations: Mark certain buttons as destructive actions Marks 'Empty Trash' and 'Delete All' buttons as destructive actions which have special appearance making them consistent with other destructive actions. Fixes #969 --- src/nautilus-file-operations.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/nautilus-file-operations.c b/src/nautilus-file-operations.c index a90706e2ee..a9266c336d 100644 --- a/src/nautilus-file-operations.c +++ b/src/nautilus-file-operations.c @@ -227,6 +227,7 @@ typedef struct #define MERGE _("_Merge") #define MERGE_ALL _("Merge _All") #define COPY_FORCE _("Copy _Anyway") +#define EMPTY_TRASH _("Empty _Trash") static gboolean is_all_button_text (const char *button_text) @@ -1229,7 +1230,9 @@ do_run_simple_dialog (gpointer _data) button = gtk_dialog_add_button (GTK_DIALOG (dialog), button_title, response_id); gtk_dialog_set_default_response (GTK_DIALOG (dialog), response_id); - if (g_strcmp0 (button_title, DELETE) == 0) + if (g_strcmp0 (button_title, DELETE) == 0 || + g_strcmp0 (button_title, EMPTY_TRASH) == 0 || + g_strcmp0 (button_title, DELETE_ALL) == 0) { gtk_style_context_add_class (gtk_widget_get_style_context (button), "destructive-action"); @@ -1585,7 +1588,7 @@ confirm_empty_trash (CommonJob *job) g_strdup (_("All items in the Trash will be permanently deleted.")), NULL, FALSE, - CANCEL, _("Empty _Trash"), + CANCEL, EMPTY_TRASH, NULL); return (response == 1); -- GitLab