[Xfce4-commits] <postler:master> Implement Blind Copy field behind the arrow

Christian Dywan noreply at xfce.org
Thu Mar 10 04:24:02 CET 2011


Updating branch refs/heads/master
         to 6cdbae0f9b600183daa158ca7438d9bb1f65391f (commit)
       from 080a8e3e7a3c37924ebfdd426ab64d099fbd5f9a (commit)

commit 6cdbae0f9b600183daa158ca7438d9bb1f65391f
Author: Christian Dywan <christian at twotoasts.de>
Date:   Wed Mar 9 21:14:44 2011 +0100

    Implement Blind Copy field behind the arrow
    
    Fixes: https://bugs.launchpad.net/postler/+bug/726187

 postler/postler-composer.vala |   24 ++++++++++++++++++++++--
 1 files changed, 22 insertions(+), 2 deletions(-)

diff --git a/postler/postler-composer.vala b/postler/postler-composer.vala
index 14f9085..03a1a3f 100644
--- a/postler/postler-composer.vala
+++ b/postler/postler-composer.vala
@@ -25,6 +25,7 @@ public class Postler.Composer : Gtk.Window {
     Gtk.ComboBox combo_from;
     Postler.RecipientEntry entry_to;
     Postler.RecipientEntry entry_copy;
+    Postler.RecipientEntry entry_blind_copy;
     Gtk.Entry entry_subject;
     Gtk.Button button_send;
     uint grace_period_timer = 0;
@@ -83,6 +84,7 @@ public class Postler.Composer : Gtk.Window {
         combo_from.sensitive = state;
         entry_to.sensitive = state;
         entry_copy.sensitive = state;
+        entry_blind_copy.sensitive = state;
         entry_subject.sensitive = state;
         content.sensitive = state;
         attachments.sensitive = state;
@@ -184,7 +186,8 @@ public class Postler.Composer : Gtk.Window {
     string generate_message (string sender, AccountInfo info) {
         var now = new Soup.Date.from_now (0);
         string copy = entry_copy.text;
-        string header = ("From: %s\nTo: %s\n%s%s"
+        string blind_copy = entry_blind_copy.text;
+        string header = ("From: %s\nTo: %s\n%s%s%s"
             + "MIME-Version: 1.0\n"
             + "Subject: %s\n"
             + "Date: %s\n"
@@ -195,6 +198,7 @@ public class Postler.Composer : Gtk.Window {
               sender,
               entry_to.text,
               copy != "" ? "CC: " : "", copy != "" ? copy + "\n" : "",
+              blind_copy != "" ? "BCC: " : "", blind_copy != "" ? blind_copy + "\n" : "",
               entry_subject.text,
               now.to_string (Soup.DateFormat.RFC2822),
               Postler.App.get_user_agent ());
@@ -601,10 +605,11 @@ public class Postler.Composer : Gtk.Window {
         button.clicked.connect ((widget) => {
             if (arrow.arrow_type == Gtk.ArrowType.RIGHT) {
                 entry_copy.parent.show ();
+                entry_blind_copy.parent.show ();
                 arrow.arrow_type = Gtk.ArrowType.DOWN;
             }
             else {
-                entry_copy.parent.hide ();
+                entry_blind_copy.parent.hide ();
                 arrow.arrow_type = Gtk.ArrowType.RIGHT;
             }
         });
@@ -628,6 +633,17 @@ public class Postler.Composer : Gtk.Window {
         box.set_no_show_all (true);
         box = new Gtk.HBox (false, 0);
         shelf.pack_start (box, false, false, 4);
+        label = new Gtk.Label.with_mnemonic (_("_Blind Copy:"));
+        label.xalign = 1.0f;
+        box.pack_start (label, false, false, 4);
+        sizegroup.add_widget (label);
+        entry_blind_copy = new Postler.RecipientEntry ();
+        box.pack_end (entry_blind_copy, true, true, 12);
+        label.show ();
+        entry_blind_copy.show ();
+        box.set_no_show_all (true);
+        box = new Gtk.HBox (false, 0);
+        shelf.pack_start (box, false, false, 4);
         label = new Gtk.Label.with_mnemonic (_("_Subject:"));
         label.xalign = 1.0f;
         box.pack_start (label, false, false, 4);
@@ -730,6 +746,10 @@ public class Postler.Composer : Gtk.Window {
             entry = entry_copy.entry;
             entry_copy.parent.show ();
         }
+        else if (name == "bcc") {
+            entry = entry_blind_copy.entry;
+            entry_blind_copy.parent.show ();
+        }
         else if (name == "subject")
             entry = entry_subject;
         else if (name == "body") {



More information about the Xfce4-commits mailing list