[balsa] Make the initial address in compose window useful



commit 9d4c339591459ed99db6cdea594c5bb7a562c635
Author: Peter Bloomfield <PeterBloomfield bellsouth net>
Date:   Wed Jun 1 22:24:43 2011 -0400

    Make the initial address in compose window useful

 ChangeLog            |    8 ++++++++
 src/sendmsg-window.c |   19 ++++++++++++++++---
 src/spell-check.c    |    4 ----
 3 files changed, 24 insertions(+), 7 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 7e0abcf..2000e72 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2011-06-01  Peter Bloomfield
+
+	* 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.
+	* src/spell-check.c (balsa_spell_check_class_init): silence
+	gcc-4.6.
+
 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 587bd22..68b5b77 100644
--- a/src/sendmsg-window.c
+++ b/src/sendmsg-window.c
@@ -4202,12 +4202,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);
 }
 
 
@@ -4322,6 +4331,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
diff --git a/src/spell-check.c b/src/spell-check.c
index 6a3c4fa..a0a68b4 100644
--- a/src/spell-check.c
+++ b/src/spell-check.c
@@ -193,13 +193,9 @@ balsa_spell_check_class_init(BalsaSpellCheckClass * klass)
 {
     GtkObjectClass *object_class;
     GObjectClass *o_class;
-    GtkWidgetClass *widget_class;
-    GtkContainerClass *container_class;
 
     object_class = (GtkObjectClass *) klass;
     o_class = (GObjectClass *) klass;
-    widget_class = (GtkWidgetClass *) klass;
-    container_class = (GtkContainerClass *) klass;
 
     parent_class = g_type_class_peek_parent(klass);
 



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