[balsa/gtk3] Make initial address in compose window more useful



commit c9e65ccfd449c4ae0f0aa6a10ee653dcd52ebb87
Author: Peter Bloomfield <PeterBloomfield bellsouth net>
Date:   Wed Jun 1 21:57:34 2011 -0400

    Make initial address in compose window more useful

 ChangeLog            |    9 +++++++++
 src/sendmsg-window.c |   19 ++++++++++++++++---
 2 files changed, 25 insertions(+), 3 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 5a817ff..9d86ce0 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2011-06-01  Peter Bloomfield
+
+	Respond to
+	<URL:http://mail.gnome.org/archives/balsa-list/2011-May/msg00023.html>
+
+	* src/sendmsg-window.c (setup_headers_from_message): make the
+	blank line in the recipient widget not a Bcc: line;
+	(setup_headers_from_identity): ditto.
+
 2011-05-31  Peter Bloomfield
 
 	* src/main.c (mw_message_received_cb): present compose window;
diff --git a/src/sendmsg-window.c b/src/sendmsg-window.c
index c16fcfd..88f48bb 100644
--- a/src/sendmsg-window.c
+++ b/src/sendmsg-window.c
@@ -4198,12 +4198,21 @@ setup_headers_from_message(BalsaSendmsg* bsmsg, LibBalsaMessage *message)
 {
     g_return_if_fail(message->headers);
 
+    /* Try to make the blank line in the address view useful;
+     * - never make it a Bcc: line;
+     * - if Cc: is non-empty, make it a Cc: line;
+     * - if Cc: is empty, make it a To: line
+     * Note that if set-from-list is given an empty list, the blank line
+     * will be a To: line */
     libbalsa_address_view_set_from_list(bsmsg->recipient_view,
-                                        "To:", message->headers->to_list);
+                                        "Bcc:",
+                                        message->headers->bcc_list);
     libbalsa_address_view_set_from_list(bsmsg->recipient_view,
-                                        "Cc:", message->headers->cc_list);
+                                        "To:",
+                                        message->headers->to_list);
     libbalsa_address_view_set_from_list(bsmsg->recipient_view,
-                                        "Bcc:", message->headers->bcc_list);
+                                        "Cc:",
+                                        message->headers->cc_list);
 }
 
 
@@ -4318,6 +4327,10 @@ setup_headers_from_identity(BalsaSendmsg* bsmsg, LibBalsaIdentity *ident)
         libbalsa_address_view_set_from_string(bsmsg->recipient_view,
                                               "Bcc:",
                                               ident->bcc);
+
+    /* Make sure the blank line is "To:" */
+    libbalsa_address_view_add_from_string(bsmsg->recipient_view,
+                                          "To:", NULL);
 }
 
 static int



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