patch: user settable default Bcc header



I've patched Balsa so it is possible to set a default value for the
Bcc header field of outgoing mails. Note that I'm entirely new to
GTK/GNOME/Balsa, so I may be doing things the wrong way. The patch is
small however, so it shouldn't take too long to scan it for errors. I
patched against a 1999-12-21 CVS update.

Is this list the correct place to post patches? Are patches welcome?


Sverre.

-- 
<URL:mailto:sverrehu@online.no>
<URL:http://home.sol.no/~sverrehu/>
diff -rc balsa.cvs/ChangeLog balsa.shh/ChangeLog
*** balsa.cvs/ChangeLog	Tue Dec 21 18:59:01 1999
--- balsa.shh/ChangeLog	Tue Dec 21 21:56:50 1999
***************
*** 1,3 ****
--- 1,9 ----
+ 1999-12-21  Sverre H. Huseby  <sverrehu@online.no>
+ 
+ 	* src/balsa-app.h, src/save-restore.c, src/balsa-app.c,
+ 	src/sendmsg-window.c, src/pref-manager.c: Added user settable
+ 	default Bcc field for outgoing mails.
+ 
  1999-12-21  Héctor García Álvarez <hector@scouts-es.org>
  	* libbalsa/send.c: Made some changes to make balsa send queued 
  	messages. Still have the bug when trying to send queued messages 
diff -rc balsa.cvs/src/balsa-app.c balsa.shh/src/balsa-app.c
*** balsa.cvs/src/balsa-app.c	Tue Dec 21 21:50:39 1999
--- balsa.shh/src/balsa-app.c	Tue Dec 21 20:21:39 1999
***************
*** 92,97 ****
--- 92,98 ----
     */
    balsa_app.address = address_new ();
    balsa_app.replyto = NULL;
+   balsa_app.bcc = NULL;
  
    balsa_app.local_mail_directory = NULL;
    balsa_app.signature_path = NULL;
diff -rc balsa.cvs/src/balsa-app.h balsa.shh/src/balsa-app.h
*** balsa.cvs/src/balsa-app.h	Tue Dec 21 21:50:39 1999
--- balsa.shh/src/balsa-app.h	Tue Dec 21 20:05:25 1999
***************
*** 72,77 ****
--- 72,78 ----
    /* personal information */
    Address *address;
    gchar *replyto;
+   gchar *bcc;
    
    gchar *local_mail_directory;
    gchar *smtp_server;
diff -rc balsa.cvs/src/pref-manager.c balsa.shh/src/pref-manager.c
*** balsa.cvs/src/pref-manager.c	Tue Dec 21 21:50:40 1999
--- balsa.shh/src/pref-manager.c	Tue Dec 21 21:43:31 1999
***************
*** 50,55 ****
--- 50,56 ----
      GtkRadioButton *pwindow_type[NUM_PWINDOW_MODES];
      GtkWidget *wordwrap;
      GtkWidget *wraplength;
+     GtkWidget *bcc;
  
  #ifdef BALSA_SHOW_INFO
      GtkWidget *mblist_show_mb_content_info;
***************
*** 284,289 ****
--- 285,292 ----
  		      GTK_SIGNAL_FUNC (wrap_modified_cb), pui->pbox);
    gtk_signal_connect (GTK_OBJECT (pui->wraplength), "changed",
  		      GTK_SIGNAL_FUNC (wrap_modified_cb), pui->pbox);
+   gtk_signal_connect (GTK_OBJECT (pui->bcc), "changed",
+ 		      GTK_SIGNAL_FUNC (properties_modified_cb), pui->pbox);
  
    /* arp */
    gtk_signal_connect (GTK_OBJECT (pui->quote_str), "changed",
***************
*** 411,416 ****
--- 414,422 ----
    balsa_app.wordwrap = GTK_TOGGLE_BUTTON(pui->wordwrap)->active;
    balsa_app.wraplength = gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(pui->wraplength));
  
+   g_free (balsa_app.bcc);
+   balsa_app.bcc = g_strdup (gtk_entry_get_text (GTK_ENTRY (pui->bcc)));
+ 
  
    /* arp */
    g_free (balsa_app.quote_str);
***************
*** 513,518 ****
--- 519,527 ----
    gtk_spin_button_set_value (GTK_SPIN_BUTTON (pui->wraplength), 
  		(float) balsa_app.wraplength );
  
+   gtk_entry_set_text (GTK_ENTRY (pui->bcc),
+                       balsa_app.bcc ? balsa_app.bcc : "");
+ 
    gtk_widget_set_sensitive (pui->wraplength,
  			    GTK_TOGGLE_BUTTON(pui->wordwrap)->active);
  
***************
*** 908,913 ****
--- 917,932 ----
  
    pui->quote_str = gtk_entry_new ();
    gtk_table_attach (GTK_TABLE (table), pui->quote_str, 1, 2, 0, 1,
+ 		    GTK_EXPAND | GTK_FILL, GTK_FILL, 0, 10);
+ 
+   /* bcc address */
+   label = gtk_label_new (_ ("Default Bcc to:"));
+   gtk_misc_set_alignment (GTK_MISC (label), 1.0, 0.5);
+   gtk_table_attach (GTK_TABLE (table), label, 0, 1, 2, 3,
+ 		    GTK_FILL, GTK_FILL, 10, 10);
+ 
+   pui->bcc = gtk_entry_new ();
+   gtk_table_attach (GTK_TABLE (table), pui->bcc, 1, 2, 2, 3,
  		    GTK_EXPAND | GTK_FILL, GTK_FILL, 0, 10);
  
    gtk_box_pack_start (GTK_BOX (vbox1), GTK_WIDGET (table), TRUE, TRUE, 2);
diff -rc balsa.cvs/src/save-restore.c balsa.shh/src/save-restore.c
*** balsa.cvs/src/save-restore.c	Tue Dec 21 21:50:41 1999
--- balsa.shh/src/save-restore.c	Tue Dec 21 20:08:16 1999
***************
*** 638,643 ****
--- 638,650 ----
    else
      balsa_app.replyto = g_strdup (field);
  
+   /* bcc field for outgoing mails */
+   g_free (balsa_app.bcc);
+   if ((field = pl_dict_get_str (globals, "Bcc")) == NULL)
+     ;  /* optional */
+   else
+     balsa_app.bcc = g_strdup (field);
+ 
    /* directory */
    if ((field = pl_dict_get_str (globals, "LocalMailDir")) == NULL)
      return FALSE;
***************
*** 845,850 ****
--- 852,859 ----
      pl_dict_add_str_str (globals, "Email", balsa_app.address->mailbox);
    if (balsa_app.replyto != NULL)
      pl_dict_add_str_str (globals, "ReplyTo", balsa_app.replyto);
+   if (balsa_app.bcc != NULL)
+     pl_dict_add_str_str (globals, "Bcc", balsa_app.bcc);
  
    if (balsa_app.local_mail_directory != NULL)
      pl_dict_add_str_str (globals, "LocalMailDir",
diff -rc balsa.cvs/src/sendmsg-window.c balsa.shh/src/sendmsg-window.c
*** balsa.cvs/src/sendmsg-window.c	Tue Dec 21 21:50:43 1999
--- balsa.shh/src/sendmsg-window.c	Tue Dec 21 21:43:57 1999
***************
*** 621,626 ****
--- 621,632 ----
      g_free (from);
    }
  
+   /* Bcc: */
+   {
+     if (balsa_app.bcc)
+       gtk_entry_set_text (GTK_ENTRY (msg->bcc), balsa_app.bcc);
+   }
+ 
    /* Subject: */
    switch (type)
      {


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