talons

Fork of Claws Mail https://www.claws-mail
Log | Files | Refs | README | LICENSE

commit f0b5dc5b4505cd2be030a677986f8ac3fd28ffce
parent b4fc92008adc6e35690a94a315fbf16ae89b97cc
Author: Paul <paul@claws-mail.org>
Date:   Sun, 24 Sep 2023 17:59:24 +0100

when queueing or drafting a msg with an attachment which no longer exists, use the correct label on the button of the warning dialogue

Diffstat:
Msrc/compose.c | 11++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/src/compose.c b/src/compose.c @@ -333,7 +333,8 @@ static ComposeQueueResult compose_queue_sub (Compose *compose, gboolean perform_checks, gboolean remove_reedit_target); static int compose_add_attachments (Compose *compose, - MimeInfo *parent); + MimeInfo *parent, + gint action); static gchar *compose_get_header (Compose *compose); static gchar *compose_get_manual_headers_info (Compose *compose); @@ -5913,7 +5914,7 @@ static gint compose_write_to_file(Compose *compose, FILE *fp, gint action, gbool g_node_append(mimempart->node, mimetext->node); g_node_append(mimemsg->node, mimempart->node); - if (compose_add_attachments(compose, mimempart) < 0) + if (compose_add_attachments(compose, mimempart, action) < 0) return COMPOSE_QUEUE_ERROR_NO_MSG; } else g_node_append(mimemsg->node, mimetext->node); @@ -6401,7 +6402,7 @@ static ComposeQueueResult compose_queue_sub(Compose *compose, gint *msgnum, Fold return COMPOSE_QUEUE_SUCCESS; } -static int compose_add_attachments(Compose *compose, MimeInfo *parent) +static int compose_add_attachments(Compose *compose, MimeInfo *parent, gint action) { AttachInfo *ainfo; GtkTreeView *tree_view = GTK_TREE_VIEW(compose->attach_clist); @@ -6427,8 +6428,8 @@ static int compose_add_attachments(Compose *compose, MimeInfo *parent) if (!is_file_exist(ainfo->file)) { gchar *msg = g_strdup_printf(_("Attachment %s doesn't exist anymore. Ignore?"), ainfo->file); - AlertValue val = alertpanel_full(_("Warning"), msg, - NULL, _("Cancel sending"), + AlertValue val = alertpanel_full(_("Warning"), msg, NULL, + action == COMPOSE_WRITE_FOR_STORE? _("Cancel drafting"): _("Cancel sending"), NULL, _("Ignore attachment"), NULL, NULL, ALERTFOCUS_FIRST, FALSE, NULL, ALERT_WARNING); g_free(msg);