[evolution] EAlert: Make it possible to mark actions as destructive in the .error files



commit bdc9cb4f1690cfa02c77e913b87b2726237fbf35
Author: Milan Crha <mcrha redhat com>
Date:   Wed Jul 28 17:08:46 2021 +0200

    EAlert: Make it possible to mark actions as destructive in the .error files
    
    ...and use this on appropriate places.

 src/addressbook/addressbook.error.xml              |  6 ++--
 src/calendar/calendar.error.xml                    | 34 +++++++++++-----------
 src/composer/mail-composer.error.xml               |  4 +--
 src/e-util/e-alert-bar.c                           |  2 ++
 src/e-util/e-alert-dialog.c                        |  4 ++-
 src/e-util/e-alert.c                               | 33 +++++++++++++++++++--
 src/e-util/e-alert.h                               |  6 +++-
 src/e-util/e-system.error.xml                      |  2 +-
 src/e-util/filter.error.xml                        |  2 +-
 src/e-util/widgets.error.xml                       |  2 +-
 src/mail/mail-send-recv.c                          |  4 +--
 src/mail/mail.error.xml                            | 22 +++++++-------
 src/modules/mdn/evolution-mdn.c                    |  2 +-
 .../offline-alert/evolution-offline-alert.c        |  2 +-
 14 files changed, 80 insertions(+), 45 deletions(-)
---
diff --git a/src/addressbook/addressbook.error.xml b/src/addressbook/addressbook.error.xml
index 134fcbfd4b..d9416932ee 100644
--- a/src/addressbook/addressbook.error.xml
+++ b/src/addressbook/addressbook.error.xml
@@ -36,14 +36,14 @@
     <_primary>Are you sure you want to delete address book “{0}”?</_primary>
     <_secondary>This address book will be removed permanently.</_secondary>
     <button _label="Do _Not Delete" response="GTK_RESPONSE_CANCEL"/>
-    <button stock="gtk-delete" response="GTK_RESPONSE_YES"/>
+    <button stock="gtk-delete" response="GTK_RESPONSE_YES" destructive="true"/>
   </error>
 
  <error id="ask-delete-remote-addressbook" type="question" default="GTK_RESPONSE_CANCEL">
    <_primary>Delete remote address book “{0}”?</_primary>
    <_secondary>This will permanently remove the address book “{0}” from the server.  Are you sure you want 
to proceed?</_secondary>
    <button _label="Do _Not Delete" response="GTK_RESPONSE_CANCEL"/>
-   <button _label="_Delete From Server" response="GTK_RESPONSE_YES"/>
+   <button _label="_Delete From Server" response="GTK_RESPONSE_YES" destructive="true"/>
  </error>
 
   <error id="edit-categories" type="error">
@@ -73,7 +73,7 @@
   <error id="prompt-save" type="question" default="GTK_RESPONSE_YES">
     <_primary>Would you like to save your changes?</_primary>
     <_secondary>You have made modifications to this contact. Do you want to save these changes?</_secondary>
-    <button _label="_Discard" response="GTK_RESPONSE_NO"/>
+    <button _label="_Discard" response="GTK_RESPONSE_NO" destructive="true"/>
     <button stock="gtk-cancel" response="GTK_RESPONSE_CANCEL"/>
     <button stock="gtk-save" response="GTK_RESPONSE_YES"/>
   </error>
diff --git a/src/calendar/calendar.error.xml b/src/calendar/calendar.error.xml
index 8c0a248cf4..03f71fa705 100644
--- a/src/calendar/calendar.error.xml
+++ b/src/calendar/calendar.error.xml
@@ -12,7 +12,7 @@
     <_primary>Are you sure you want to delete this meeting?</_primary>
     <_secondary>All information on this meeting will be deleted and can not be restored.</_secondary>
     <button _label="Do _Not Delete" response="GTK_RESPONSE_NO"/>
-    <button stock="gtk-delete" response="GTK_RESPONSE_YES"/>
+    <button stock="gtk-delete" response="GTK_RESPONSE_YES" destructive="true"/>
   </error>
 
   <error id="prompt-cancel-task" type="question" default="GTK_RESPONSE_YES">
@@ -26,7 +26,7 @@
     <_primary>Are you sure you want to delete this task?</_primary>
     <_secondary>All information on this task will be deleted and can not be restored.</_secondary>
     <button _label="Do _Not Delete" response="GTK_RESPONSE_NO"/>
-    <button stock="gtk-delete" response="GTK_RESPONSE_YES"/>
+    <button stock="gtk-delete" response="GTK_RESPONSE_YES" destructive="true"/>
   </error>
 
   <error id="prompt-cancel-memo" type="question" default="GTK_RESPONSE_YES">
@@ -40,63 +40,63 @@
     <_primary>Are you sure you want to delete this memo?</_primary>
     <_secondary>All information on this memo will be deleted and can not be restored.</_secondary>
     <button _label="Do _Not Delete" response="GTK_RESPONSE_NO"/>
-    <button stock="gtk-delete" response="GTK_RESPONSE_YES"/>
+    <button stock="gtk-delete" response="GTK_RESPONSE_YES" destructive="true"/>
   </error>
 
   <error id="prompt-delete-titled-meeting" type="question" default="GTK_RESPONSE_NO">
     <_primary>Are you sure you want to delete the meeting titled “{0}”?</_primary>
     <_secondary>All information on this meeting will be deleted and can not be restored.</_secondary>
     <button _label="Do _Not Delete" response="GTK_RESPONSE_NO"/>
-    <button stock="gtk-delete" response="GTK_RESPONSE_YES"/>
+    <button stock="gtk-delete" response="GTK_RESPONSE_YES" destructive="true"/>
   </error>
 
   <error id="prompt-delete-titled-appointment" type="question" default="GTK_RESPONSE_NO">
     <_primary>Are you sure you want to delete the appointment titled “{0}”?</_primary>
     <_secondary>All information on this appointment will be deleted and can not be restored.</_secondary>
     <button _label="Do _Not Delete" response="GTK_RESPONSE_NO"/>
-    <button stock="gtk-delete" response="GTK_RESPONSE_YES"/>
+    <button stock="gtk-delete" response="GTK_RESPONSE_YES" destructive="true"/>
   </error>
 
   <error id="prompt-delete-appointment" type="question" default="GTK_RESPONSE_YES">
     <_primary>Are you sure you want to delete this appointment?</_primary>
     <_secondary>All information on this appointment will be deleted and can not be restored.</_secondary>
     <button _label="Do _Not Delete" response="GTK_RESPONSE_NO"/>
-    <button stock="gtk-delete" response="GTK_RESPONSE_YES"/>
+    <button stock="gtk-delete" response="GTK_RESPONSE_YES" destructive="true"/>
   </error>
 
   <error id="prompt-delete-named-task" type="question" default="GTK_RESPONSE_NO">
     <_primary>Are you sure you want to delete the “{0}” task?</_primary>
     <_secondary>All information on this task will be deleted and can not be restored.</_secondary>
     <button _label="Do _Not Delete" response="GTK_RESPONSE_NO"/>
-    <button stock="gtk-delete" response="GTK_RESPONSE_YES"/>
+    <button stock="gtk-delete" response="GTK_RESPONSE_YES" destructive="true"/>
   </error>
 
   <error id="prompt-delete-named-memo" type="question" default="GTK_RESPONSE_NO">
     <_primary>Are you sure you want to delete the memo “{0}”?</_primary>
     <_secondary>All information in this memo will be deleted and can not be restored.</_secondary>
     <button _label="Do _Not Delete" response="GTK_RESPONSE_NO"/>
-    <button stock="gtk-delete" response="GTK_RESPONSE_YES"/>
+    <button stock="gtk-delete" response="GTK_RESPONSE_YES" destructive="true"/>
   </error>
 
   <error id="prompt-delete-appointments" type="question" default="GTK_RESPONSE_NO">
     <_primary>Are you sure you want to delete these {0} appointments?</_primary>
     <_secondary>All information on these appointments will be deleted and can not be restored.</_secondary>
     <button _label="Do _Not Delete" response="GTK_RESPONSE_NO"/>
-    <button stock="gtk-delete" response="GTK_RESPONSE_YES"/>
+    <button stock="gtk-delete" response="GTK_RESPONSE_YES" destructive="true"/>
   </error>
 
   <error id="prompt-delete-tasks" type="question" default="GTK_RESPONSE_NO">
     <_primary>Are you sure you want to delete these {0} tasks?</_primary>
     <_secondary>All information on these tasks will be deleted and can not be restored.</_secondary>
     <button _label="Do _Not Delete" response="GTK_RESPONSE_NO"/>
-    <button stock="gtk-delete" response="GTK_RESPONSE_YES"/>
+    <button stock="gtk-delete" response="GTK_RESPONSE_YES" destructive="true"/>
   </error>
 
   <error id="prompt-delete-memos" type="question" default="GTK_RESPONSE_NO">
     <_primary>Are you sure you want to delete these {0} memos?</_primary>
     <_secondary>All information in these memos will be deleted and can not be restored.</_secondary>
     <button _label="Do _Not Delete" response="GTK_RESPONSE_NO"/>
-    <button stock="gtk-delete" response="GTK_RESPONSE_YES"/>
+    <button stock="gtk-delete" response="GTK_RESPONSE_YES" destructive="true"/>
   </error>
 
   <error id="prompt-save-meeting-dragged-or-resized" type="warning" default="GTK_RESPONSE_CANCEL">
@@ -211,42 +211,42 @@
     <_primary>Are you sure you want to delete calendar “{0}”?</_primary>
     <_secondary>This calendar will be removed permanently.</_secondary>
     <button _label="Do _Not Delete" response="GTK_RESPONSE_CANCEL"/>
-    <button stock="gtk-delete" response="GTK_RESPONSE_YES"/>
+    <button stock="gtk-delete" response="GTK_RESPONSE_YES" destructive="true"/>
   </error>
 
   <error id="prompt-delete-task-list" type="question" default="GTK_RESPONSE_CANCEL">
     <_primary>Are you sure you want to delete task list “{0}”?</_primary>
     <_secondary>This task list will be removed permanently.</_secondary>
     <button _label="Do _Not Delete" response="GTK_RESPONSE_CANCEL"/>
-    <button stock="gtk-delete" response="GTK_RESPONSE_YES"/>
+    <button stock="gtk-delete" response="GTK_RESPONSE_YES" destructive="true"/>
   </error>
 
   <error id="prompt-delete-memo-list" type="question" default="GTK_RESPONSE_CANCEL">
     <_primary>Are you sure you want to delete memo list “{0}”?</_primary>
     <_secondary>This memo list will be removed permanently.</_secondary>
     <button _label="Do _Not Delete" response="GTK_RESPONSE_NO"/>
-    <button stock="gtk-delete" response="GTK_RESPONSE_YES"/>
+    <button stock="gtk-delete" response="GTK_RESPONSE_YES" destructive="true"/>
   </error>
 
   <error id="prompt-delete-remote-calendar" type="question" default="GTK_RESPONSE_CANCEL">
     <_primary>Are you sure you want to delete remote calendar “{0}”?</_primary>
     <_secondary>This will permanently remove the calendar “{0}” from the server. Are you sure you want to 
proceed?</_secondary>
     <button _label="Do _Not Delete" response="GTK_RESPONSE_CANCEL"/>
-    <button _label="_Delete From Server" response="GTK_RESPONSE_YES"/>
+    <button _label="_Delete From Server" response="GTK_RESPONSE_YES" destructive="true"/>
   </error>
 
   <error id="prompt-delete-remote-task-list" type="question" default="GTK_RESPONSE_CANCEL">
     <_primary>Are you sure you want to delete remote task list “{0}”?</_primary>
     <_secondary>This will permanently remove the task list “{0}” from the server. Are you sure you want to 
proceed?</_secondary>
     <button _label="Do _Not Delete" response="GTK_RESPONSE_CANCEL"/>
-    <button _label="_Delete From Server" response="GTK_RESPONSE_YES"/>
+    <button _label="_Delete From Server" response="GTK_RESPONSE_YES" destructive="true"/>
   </error>
 
   <error id="prompt-delete-remote-memo-list" type="question" default="GTK_RESPONSE_CANCEL">
     <_primary>Are you sure you want to delete remote memo list “{0}”?</_primary>
     <_secondary>This will permanently remove the memo list “{0}” from the server. Are you sure you want to 
proceed?</_secondary>
     <button _label="Do _Not Delete" response="GTK_RESPONSE_CANCEL"/>
-    <button _label="_Delete From Server" response="GTK_RESPONSE_YES"/>
+    <button _label="_Delete From Server" response="GTK_RESPONSE_YES" destructive="true"/>
   </error>
 
   <error id="prompt-save-no-subject-calendar" type="question" default="GTK_RESPONSE_YES">
diff --git a/src/composer/mail-composer.error.xml b/src/composer/mail-composer.error.xml
index cbe94f0bdc..c7a141b2ca 100644
--- a/src/composer/mail-composer.error.xml
+++ b/src/composer/mail-composer.error.xml
@@ -38,7 +38,7 @@
  <error id="exit-unsaved" type="warning" default="GTK_RESPONSE_CANCEL">
   <_primary>Are you sure you want to discard the message, titled “{0}”, you are composing?</_primary>
   <_secondary>Closing this composer window will discard the message permanently, unless you choose to save 
the message in your Drafts folder. This will allow you to continue the message at a later date.</_secondary>
-  <button _label="_Discard Changes" response="GTK_RESPONSE_NO"/>
+  <button _label="_Discard Changes" response="GTK_RESPONSE_NO" destructive="true"/>
   <button _label="_Continue Editing" response="GTK_RESPONSE_CANCEL"/>
   <button _label="_Save Draft" response="GTK_RESPONSE_YES"/>
  </error>
@@ -46,7 +46,7 @@
  <error id="exit-unsaved-no-subject" type="warning" default="GTK_RESPONSE_CANCEL">
   <_primary>Are you sure you want to discard the message you are composing?</_primary>
   <_secondary>Closing this composer window will discard the message permanently, unless you choose to save 
the message in your Drafts folder. This will allow you to continue the message at a later date.</_secondary>
-  <button _label="_Discard Changes" response="GTK_RESPONSE_NO"/>
+  <button _label="_Discard Changes" response="GTK_RESPONSE_NO" destructive="true"/>
   <button _label="_Continue Editing" response="GTK_RESPONSE_CANCEL"/>
   <button _label="_Save Draft" response="GTK_RESPONSE_YES"/>
  </error>
diff --git a/src/e-util/e-alert-bar.c b/src/e-util/e-alert-bar.c
index c0beb1ebde..c5088fdfeb 100644
--- a/src/e-util/e-alert-bar.c
+++ b/src/e-util/e-alert-bar.c
@@ -184,6 +184,8 @@ alert_bar_show_alert (EAlertBar *alert_bar)
                gtk_activatable_set_related_action (GTK_ACTIVATABLE (widget), action);
                gtk_box_pack_end (GTK_BOX (action_area), widget, FALSE, FALSE, 0);
 
+               e_alert_update_destructive_action_style (action, widget);
+
                link = g_list_next (link);
        }
 
diff --git a/src/e-util/e-alert-dialog.c b/src/e-util/e-alert-dialog.c
index d239257f67..d296564b9f 100644
--- a/src/e-util/e-alert-dialog.c
+++ b/src/e-util/e-alert-dialog.c
@@ -160,7 +160,7 @@ alert_dialog_constructed (GObject *object)
                 * thus the dialog can be closed. */
                action = gtk_action_new (
                        "alert-response-0", _("_Dismiss"), NULL, NULL);
-               e_alert_add_action (alert, action, GTK_RESPONSE_CLOSE);
+               e_alert_add_action (alert, action, GTK_RESPONSE_CLOSE, FALSE);
                g_object_unref (action);
 
                link = e_alert_peek_actions (alert);
@@ -184,6 +184,8 @@ alert_dialog_constructed (GObject *object)
                gtk_activatable_set_related_action (GTK_ACTIVATABLE (button), action);
                gtk_box_pack_end (GTK_BOX (action_area), button, FALSE, FALSE, 0);
 
+               e_alert_update_destructive_action_style (action, button);
+
                /* This is set in e_alert_add_action(). */
                data = g_object_get_data (G_OBJECT (action), "e-alert-response-id");
 
diff --git a/src/e-util/e-alert.c b/src/e-util/e-alert.c
index 3cc0936eac..f925e3ec4d 100644
--- a/src/e-util/e-alert.c
+++ b/src/e-util/e-alert.c
@@ -65,6 +65,7 @@ struct _EAlertButton {
        const gchar *stock_id;
        const gchar *label;
        gint response_id;
+       gboolean destructive;
 };
 
 static GHashTable *alert_table;
@@ -283,6 +284,11 @@ e_alert_load (const gchar *path)
                                                        map_response (tmp);
                                                xmlFree (tmp);
                                        }
+                                       tmp = (gchar *) xmlGetProp (scan, (xmlChar *) "destructive");
+                                       if (g_strcmp0 (tmp, "1") == 0 || g_strcmp0 (tmp, "true") == 0)
+                                               button->destructive = TRUE;
+                                       if (tmp)
+                                               xmlFree (tmp);
 
                                        if (stock_id == NULL && label == NULL) {
                                                g_warning (
@@ -616,14 +622,14 @@ alert_constructed (GObject *object)
                        action = gtk_action_new (
                                action_name, NULL, NULL, button->stock_id);
                        e_alert_add_action (
-                               alert, action, button->response_id);
+                               alert, action, button->response_id, button->destructive);
                        g_object_unref (action);
 
                } else if (button->label != NULL) {
                        action = gtk_action_new (
                                action_name, button->label, NULL, NULL);
                        e_alert_add_action (
-                               alert, action, button->response_id);
+                               alert, action, button->response_id, button->destructive);
                        g_object_unref (action);
                }
 
@@ -935,7 +941,8 @@ e_alert_get_icon_name (EAlert *alert)
 void
 e_alert_add_action (EAlert *alert,
                     GtkAction *action,
-                    gint response_id)
+                    gint response_id,
+                   gboolean is_destructive)
 {
        g_return_if_fail (E_IS_ALERT (alert));
        g_return_if_fail (GTK_IS_ACTION (action));
@@ -943,6 +950,9 @@ e_alert_add_action (EAlert *alert,
        g_object_set_data (
                G_OBJECT (action), "e-alert-response-id",
                GINT_TO_POINTER (response_id));
+       g_object_set_data (
+               G_OBJECT (action), "e-alert-is-destructive",
+               GINT_TO_POINTER (is_destructive ? 1 : 0));
 
        g_signal_connect_swapped (
                action, "activate",
@@ -1055,3 +1065,20 @@ e_alert_submit_valist (EAlertSink *alert_sink,
        e_alert_sink_submit_alert (alert_sink, alert);
        g_object_unref (alert);
 }
+
+void
+e_alert_update_destructive_action_style (GtkAction *for_action,
+                                        GtkWidget *button)
+{
+       GtkStyleContext *style_context;
+
+       g_return_if_fail (GTK_IS_ACTION (for_action));
+       g_return_if_fail (GTK_IS_WIDGET (button));
+
+       style_context = gtk_widget_get_style_context (button);
+
+       if (GPOINTER_TO_INT (g_object_get_data (G_OBJECT (for_action), "e-alert-is-destructive")) != 0)
+               gtk_style_context_add_class (style_context, "destructive-action");
+       else
+               gtk_style_context_remove_class (style_context, "destructive-action");
+}
diff --git a/src/e-util/e-alert.h b/src/e-util/e-alert.h
index 375b6f4061..c4201861e8 100644
--- a/src/e-util/e-alert.h
+++ b/src/e-util/e-alert.h
@@ -101,7 +101,8 @@ void                e_alert_set_secondary_text      (EAlert *alert,
 const gchar *  e_alert_get_icon_name           (EAlert *alert);
 void           e_alert_add_action              (EAlert *alert,
                                                 GtkAction *action,
-                                                gint response_id);
+                                                gint response_id,
+                                                gboolean is_destructive);
 GList *                e_alert_peek_actions            (EAlert *alert);
 void           e_alert_add_widget              (EAlert *alert,
                                                 GtkWidget *widget);
@@ -119,6 +120,9 @@ void                e_alert_submit                  (struct _EAlertSink *alert_sink,
 void           e_alert_submit_valist           (struct _EAlertSink *alert_sink,
                                                 const gchar *tag,
                                                 va_list va);
+void           e_alert_update_destructive_action_style
+                                               (GtkAction *for_action,
+                                                GtkWidget *button);
 
 G_END_DECLS
 
diff --git a/src/e-util/e-system.error.xml b/src/e-util/e-system.error.xml
index 02facb7d26..46bfea71fe 100644
--- a/src/e-util/e-system.error.xml
+++ b/src/e-util/e-system.error.xml
@@ -103,7 +103,7 @@
    <_primary>Are you sure you want to delete remote collection “{0}”?</_primary>
    <_secondary>This will permanently remove the collection “{0}” from the server. Are you sure you want to 
proceed?</_secondary>
    <button _label="Do _Not Delete" response="GTK_RESPONSE_CANCEL"/>
-   <button _label="_Delete From Server" response="GTK_RESPONSE_YES"/>
+   <button _label="_Delete From Server" response="GTK_RESPONSE_YES" destructive="true"/>
  </error>
 
   <error id="refresh-backend-failed" type="error">
diff --git a/src/e-util/filter.error.xml b/src/e-util/filter.error.xml
index 0dcd168c36..71c7e509ea 100644
--- a/src/e-util/filter.error.xml
+++ b/src/e-util/filter.error.xml
@@ -44,6 +44,6 @@
  <error id="remove-rule-question" type="question" default="GTK_RESPONSE_YES">
   <_primary>Are you sure you want to remove rule “{0}”?</_primary>
   <button _label="_Keep" response="GTK_RESPONSE_CANCEL"/>
-  <button _label="_Remove" response="GTK_RESPONSE_YES"/>
+  <button _label="_Remove" response="GTK_RESPONSE_YES" destructive="true"/>
  </error>
 </error-list>
diff --git a/src/e-util/widgets.error.xml b/src/e-util/widgets.error.xml
index e6421ae601..afa2472d79 100644
--- a/src/e-util/widgets.error.xml
+++ b/src/e-util/widgets.error.xml
@@ -4,7 +4,7 @@
   <error id="ask-signature-changed" type="question" default="GTK_RESPONSE_YES">
     <_primary>Do you wish to save your changes?</_primary>
     <_secondary xml:space="preserve">This signature has been changed, but has not been saved.</_secondary>
-    <button _label="_Discard changes" response="GTK_RESPONSE_NO"/>
+    <button _label="_Discard changes" response="GTK_RESPONSE_NO" destructive="true"/>
     <button stock="gtk-cancel" response="GTK_RESPONSE_CANCEL"/>
     <button stock="gtk-save" response="GTK_RESPONSE_YES"/>
   </error>
diff --git a/src/mail/mail-send-recv.c b/src/mail/mail-send-recv.c
index cb13fac3cf..6ccd416664 100644
--- a/src/mail/mail-send-recv.c
+++ b/src/mail/mail-send-recv.c
@@ -608,12 +608,12 @@ report_error_to_ui_cb (gpointer user_data)
 
                        if (data->send_failed_uids->len == 1) {
                                action = gtk_action_new ("send-failed-edit-action", _("Edit Message"), NULL, 
NULL);
-                               e_alert_add_action (alert, action, GTK_RESPONSE_APPLY);
+                               e_alert_add_action (alert, action, GTK_RESPONSE_APPLY, FALSE);
                                g_object_unref (action);
                        }
 
                        action = gtk_action_new ("send-failed-outbox-action", _("Open Outbox Folder"), NULL, 
NULL);
-                       e_alert_add_action (alert, action, GTK_RESPONSE_REJECT);
+                       e_alert_add_action (alert, action, GTK_RESPONSE_REJECT, FALSE);
                        g_object_unref (action);
 
                        g_signal_connect (alert, "response",
diff --git a/src/mail/mail.error.xml b/src/mail/mail.error.xml
index 17e27a74d4..fee493ff84 100644
--- a/src/mail/mail.error.xml
+++ b/src/mail/mail.error.xml
@@ -108,14 +108,14 @@ The reported error was “{0}”.</_secondary>
     <_primary>Are you sure you want to permanently remove all the deleted messages in folder 
“{0}”?</_primary>
     <_secondary xml:space="preserve">If you continue, you will not be able to recover these 
messages.</_secondary>
     <button stock="gtk-cancel" response="GTK_RESPONSE_CANCEL"/>
-    <button _label="_Expunge" response="GTK_RESPONSE_YES"/>
+    <button _label="_Expunge" response="GTK_RESPONSE_YES" destructive="true"/>
   </error>
 
   <error id="ask-empty-trash" type="warning" default="GTK_RESPONSE_CANCEL">
     <_primary>Are you sure you want to permanently remove all the deleted messages in all folders?</_primary>
     <_secondary xml:space="preserve">If you continue, you will not be able to recover these 
messages.</_secondary>
     <button stock="gtk-cancel" response="GTK_RESPONSE_CANCEL"/>
-    <button _label="_Empty Trash" response="GTK_RESPONSE_YES"/>
+    <button _label="_Empty Trash" response="GTK_RESPONSE_YES" destructive="true"/>
   </error>
 
   <error id="ask-open-many" type="warning" default="GTK_RESPONSE_CANCEL">
@@ -211,7 +211,7 @@ The reported error was “{0}”.</_secondary>
     <_primary>Really delete folder “{0}” and all of its subfolders?</_primary>
     <_secondary xml:space="preserve">If you delete the folder, all of its contents and its subfolders’ 
contents will be deleted permanently.</_secondary>
     <button _label="Do _Not Delete" response="GTK_RESPONSE_CANCEL"/>
-    <button stock="gtk-delete" response="GTK_RESPONSE_OK"/>
+    <button stock="gtk-delete" response="GTK_RESPONSE_OK" destructive="true"/>
   </error>
 
   <error id="ask-unsubscribe-folder" type="question" default="GTK_RESPONSE_NO">
@@ -224,27 +224,27 @@ The reported error was “{0}”.</_secondary>
   <error id="ask-delete-vfolder" type="question" default="GTK_RESPONSE_CANCEL">
     <_primary>Really delete folder “{0}” and all of its subfolders?</_primary>
     <button _label="Do _Not Delete" response="GTK_RESPONSE_CANCEL"/>
-    <button stock="gtk-delete" response="GTK_RESPONSE_OK"/>
+    <button stock="gtk-delete" response="GTK_RESPONSE_OK" destructive="true"/>
   </error>
 
   <error id="ask-delete-folder-nochild" type="question" default="GTK_RESPONSE_CANCEL">
     <_primary>Really delete folder “{0}”?</_primary>
     <_secondary xml:space="preserve">If you delete the folder, all of its contents will be deleted 
permanently.</_secondary>
     <button _label="Do _Not Delete" response="GTK_RESPONSE_CANCEL"/>
-    <button stock="gtk-delete" response="GTK_RESPONSE_OK"/>
+    <button stock="gtk-delete" response="GTK_RESPONSE_OK" destructive="true"/>
   </error>
 
   <error id="ask-delete-vfolder-nochild" type="question" default="GTK_RESPONSE_CANCEL">
     <_primary>Really delete folder “{0}”?</_primary>
     <button _label="Do _Not Delete" response="GTK_RESPONSE_CANCEL"/>
-    <button stock="gtk-delete" response="GTK_RESPONSE_OK"/>
+    <button stock="gtk-delete" response="GTK_RESPONSE_OK" destructive="true"/>
   </error>
 
   <error id="ask-delete-vfolder-msg" type="warning" default="GTK_RESPONSE_CANCEL">
     <_primary>These messages are not copies.</_primary>
     <_secondary xml:space="preserve">Messages shown in Search Folders are not copies. Deleting them from a 
Search Folder will delete the actual messages from the folder or folders in which they physically reside. Do 
you really want to delete these messages?</_secondary>
     <button _label="Do _Not Delete" response="GTK_RESPONSE_CANCEL"/>
-    <button stock="gtk-delete" response="GTK_RESPONSE_OK"/>
+    <button stock="gtk-delete" response="GTK_RESPONSE_OK" destructive="true"/>
   </error>
 
   <error id="no-rename-folder-exists" type="error">
@@ -296,7 +296,7 @@ The reported error was “{0}”.</_secondary>
     <_primary>Are you sure you want to delete account “{0}”?</_primary>
     <_secondary xml:space="preserve">If you proceed, the account information will be deleted 
permanently.</_secondary>
     <button _label="Do _Not Delete" response="GTK_RESPONSE_NO"/>
-    <button stock="gtk-delete" response="GTK_RESPONSE_YES"/>
+    <button stock="gtk-delete" response="GTK_RESPONSE_YES" destructive="true"/>
   </error>
 
   <error id="ask-delete-account-with-proxies" type="question" default="GTK_RESPONSE_NO">
@@ -304,7 +304,7 @@ The reported error was “{0}”.</_secondary>
     <_secondary xml:space="preserve">If you proceed, the account information and
 all proxy information will be deleted permanently.</_secondary>
     <button _label="Do _Not Delete" response="GTK_RESPONSE_NO"/>
-    <button stock="gtk-delete" response="GTK_RESPONSE_YES"/>
+    <button stock="gtk-delete" response="GTK_RESPONSE_YES" destructive="true"/>
   </error>
 
   <error id="ask-delete-proxy-accounts" type="question" default="GTK_RESPONSE_NO">
@@ -473,7 +473,7 @@ An mbox account will be created to preserve the old mbox folders. You can delete
     <_primary>Remove duplicate messages?</_primary>
     <secondary>{0}</secondary>
     <button stock="gtk-cancel" response="GTK_RESPONSE_CANCEL"/>
-    <button stock="gtk-delete" response="GTK_RESPONSE_YES"/>
+    <button stock="gtk-delete" response="GTK_RESPONSE_YES" destructive="true"/>
   </error>
 
   <error id="info-no-remove-duplicates" type="info" default="GTK_RESPONSE_OK">
@@ -618,7 +618,7 @@ in the folder will be available in offline mode.</_secondary>
   <error id="ask-mail-note-changed" type="question" default="GTK_RESPONSE_YES">
     <_primary>Do you wish to save your changes?</_primary>
     <_secondary xml:space="preserve">This message note has been changed, but has not been saved.</_secondary>
-    <button _label="_Discard changes" response="GTK_RESPONSE_NO"/>
+    <button _label="_Discard changes" response="GTK_RESPONSE_NO" destructive="true"/>
     <button stock="gtk-cancel" response="GTK_RESPONSE_CANCEL"/>
     <button stock="gtk-save" response="GTK_RESPONSE_YES"/>
   </error>
diff --git a/src/modules/mdn/evolution-mdn.c b/src/modules/mdn/evolution-mdn.c
index 1c009f8044..0e1cc7b519 100644
--- a/src/modules/mdn/evolution-mdn.c
+++ b/src/modules/mdn/evolution-mdn.c
@@ -555,7 +555,7 @@ mdn_message_loaded_cb (EMailReader *reader,
                        (GConnectFlags) 0);
 
                alert = e_alert_new ("mdn:notify-sender", NULL);
-               e_alert_add_action (alert, action, GTK_RESPONSE_APPLY);
+               e_alert_add_action (alert, action, GTK_RESPONSE_APPLY, FALSE);
                mdn_submit_alert (mdn, reader, alert);
                g_object_unref (alert);
 
diff --git a/src/modules/offline-alert/evolution-offline-alert.c 
b/src/modules/offline-alert/evolution-offline-alert.c
index fd11c9ff48..395fbcca08 100644
--- a/src/modules/offline-alert/evolution-offline-alert.c
+++ b/src/modules/offline-alert/evolution-offline-alert.c
@@ -140,7 +140,7 @@ offline_alert_window_added_cb (GtkApplication *application,
        else
                alert_id = "offline-alert:no-network";
        extension->alert = e_alert_new (alert_id, NULL);
-       e_alert_add_action (extension->alert, action, GTK_RESPONSE_NONE);
+       e_alert_add_action (extension->alert, action, GTK_RESPONSE_NONE, FALSE);
 
        g_object_add_weak_pointer (
                G_OBJECT (extension->alert), &extension->alert);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]