talons

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

commit 44b1b201e4017d924776c29eb8e86c15bf49a3d9
parent fab3c79304dcafc24845e41a403305cf32a6e411
Author: Paul <paul@claws-mail.org>
Date:   Wed,  5 Jun 2024 12:17:11 +0100

allow hiding the Notice panel when pasting files into the Compose window

Diffstat:
Msrc/compose.c | 16+++++++++++++---
Msrc/prefs_common.c | 5+++--
Msrc/prefs_common.h | 3++-
3 files changed, 18 insertions(+), 6 deletions(-)

diff --git a/src/compose.c b/src/compose.c @@ -10975,11 +10975,21 @@ static void attach_uri_list(Compose *compose, GtkSelectionData *data) g_free(utf8_filename); } if (list) { + AlertValue val; compose_changed_cb(NULL, compose); - alertpanel_notice(ngettext( - "The following file has been attached: \n%s", - "The following files have been attached: \n%s", att), warn_files); + if (prefs_common.notify_pasted_attachments) { + gchar *msg; + + msg = g_strdup_printf(ngettext("The following file has been attached: \n%s", + "The following files have been attached: \n%s", att), warn_files); + val = alertpanel_full(_("Notice"), msg, + NULL, _("_Close"), NULL, NULL, NULL, NULL, + ALERTFOCUS_FIRST, TRUE, NULL, ALERT_NOTICE); + g_free(msg); + } g_free(warn_files); + if (val & G_ALERTDISABLE) + prefs_common.notify_pasted_attachments = FALSE; } list_free_strings_full(list); } diff --git a/src/prefs_common.c b/src/prefs_common.c @@ -1,6 +1,6 @@ /* * Claws Mail -- a GTK based, lightweight, and fast e-mail client - * Copyright (C) 1999-2023 the Claws Mail team and Hiroyuki Yamamoto + * Copyright (C) 1999-2024 the Claws Mail team and Hiroyuki Yamamoto * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -241,7 +241,8 @@ static PrefParam param[] = { NULL, NULL, NULL}, {"type_any_header", "FALSE", &prefs_common.type_any_header, P_BOOL, NULL, NULL, NULL}, - + {"notify_pasted_attachments", "TRUE", &prefs_common.notify_pasted_attachments, P_BOOL, + NULL, NULL, NULL}, {"linewrap_length", "72", &prefs_common.linewrap_len, P_INT, NULL, NULL, NULL}, diff --git a/src/prefs_common.h b/src/prefs_common.h @@ -1,6 +1,6 @@ /* * Claws Mail -- a GTK based, lightweight, and fast e-mail client - * Copyright (C) 1999-2023 the Claws Mail team and Hiroyuki Yamamoto + * Copyright (C) 1999-2024 the Claws Mail team and Hiroyuki Yamamoto * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -205,6 +205,7 @@ struct _PrefsCommon gchar *compose_body_format; gboolean show_compose_margin; gboolean type_any_header; + gboolean notify_pasted_attachments; /* Quote */ gboolean reply_with_quote;