'From' field modification patch



Hi,

I enclose patch that makes it possible to modify the 'From' field; the
sent message will 'From' header's value taken from the proper input
field (the po files need to be updated apropriately, I guess).

I have also four questions:
1. use of other than GtkText widgets for editing. Would it be accepted
to use some other widget for the mail composition? I mean for instance,
GtkExText. It seems to be more functional than GtkText but - to my
knowledge - is not a standard Gtk widget.

2. I think it would be useful to save configuration of shown headers of
the compose window between sessions. I remember there was some work
going on save-restore.c. Is it finished? Should I just restrict myself
to adding needed field to BalsaApp structure?

3. when I tried cvs rdiff balsa I get messages that, for instance:
Index: balsa/po/balsa.pot
diff -c balsa/po/balsa.pot:1.65 balsa/po/balsa.pot:removed

The messages appear even on a freshly checked-out tree. Do you also get
it? If so, is it a proper and expected behavior?

4. is anyone working now on improving the message view window? I would
like to add features like line wrapping, marking reply text with
italic, and - if not too difficult - copying text from the message view
window but I would not like to reinvent the wheel.

Pawel

Index: libbalsa/address.h
===================================================================
RCS file: /cvs/gnome/balsa/libbalsa/address.h,v
retrieving revision 1.1
diff -c -r1.1 address.h
*** libbalsa/address.h	1999/10/18 02:10:56	1.1
--- libbalsa/address.h	2000/02/24 19:18:44
***************
*** 31,35 ****
--- 31,36 ----
  
  Address *address_new(void);
  void address_free(Address *address);
+ void address_list_free(GList *address_list);
  
  #endif /* __ADDRESS_H__ */
Index: libbalsa/mailbox.c
===================================================================
RCS file: /cvs/gnome/balsa/libbalsa/mailbox.c,v
retrieving revision 1.110
diff -c -r1.110 mailbox.c
*** libbalsa/mailbox.c	2000/01/30 17:32:18	1.110
--- libbalsa/mailbox.c	2000/02/24 19:18:45
***************
*** 1395,1401 ****
    g_free (address);
  }
  
! 
  
  static Address *
  translate_address (ADDRESS * caddr)
--- 1395,1407 ----
    g_free (address);
  }
  
! void address_list_free(GList * address_list)
! {
!   GList *list;
!   for (list = g_list_first (address_list); list; list = g_list_next (list))
!     if(list->data) address_free (list->data);
!   g_list_free (address_list);
! }
  
  static Address *
  translate_address (ADDRESS * caddr)
Index: libbalsa/message.c
===================================================================
RCS file: /cvs/gnome/balsa/libbalsa/message.c,v
retrieving revision 1.10
diff -c -r1.10 message.c
*** libbalsa/message.c	1997/01/03 15:23:29	1.10
--- libbalsa/message.c	2000/02/24 19:18:45
***************
*** 179,185 ****
  static void
  libbalsa_message_real_destroy(GtkObject *object)
  {
-   GList* list;
    Message *message;
  
    g_return_if_fail(object != NULL);
--- 179,184 ----
***************
*** 194,210 ****
    address_free (message->reply_to);
    g_free (message->subject);
  
!   for (list = g_list_first (message->to_list); list; list = g_list_next (list))
!     address_free (list->data);
!   g_list_free (message->to_list);
! 
!   for (list = g_list_first (message->cc_list); list; list = g_list_next (list))
!     address_free (list->data);
!   g_list_free (message->cc_list);
! 
!   for (list = g_list_first (message->bcc_list); list; list = g_list_next (list))
!     address_free (list->data);
!   g_list_free (message->bcc_list);
  
    g_free (message->in_reply_to);
    g_free (message->message_id); 
--- 193,201 ----
    address_free (message->reply_to);
    g_free (message->subject);
  
!   address_list_free(message->to_list);
!   address_list_free(message->cc_list);
!   address_list_free(message->bcc_list);
  
    g_free (message->in_reply_to);
    g_free (message->message_id); 
Index: src/sendmsg-window.c
===================================================================
RCS file: /cvs/gnome/balsa/src/sendmsg-window.c,v
retrieving revision 1.156
diff -c -r1.156 sendmsg-window.c
*** src/sendmsg-window.c	2000/02/15 03:08:37	1.156
--- src/sendmsg-window.c	2000/02/24 19:18:45
***************
*** 227,233 ****
     gtk_widget_destroy (bsm->window);
     if(balsa_app.debug) printf("balsa_sendmsg_destroy: Freeing bsm\n");
     g_free (bsm);
!    bsm = NULL; // useless - it's just a local variable...
  }
  
  static void
--- 227,233 ----
     gtk_widget_destroy (bsm->window);
     if(balsa_app.debug) printf("balsa_sendmsg_destroy: Freeing bsm\n");
     g_free (bsm);
!    bsm = NULL; // useless - it is just a local variable...
  }
  
  static void
***************
*** 468,475 ****
    msg->from[1] = gtk_entry_new ();
    gtk_table_attach (GTK_TABLE (table), msg->from[1], 1, 2, 1, 2,
  		    GTK_FILL | GTK_EXPAND, GTK_FILL | GTK_SHRINK, 0, 0);
-   GTK_WIDGET_UNSET_FLAGS (msg->from[1], GTK_CAN_FOCUS);
-   gtk_entry_set_editable (GTK_ENTRY (msg->from[1]), FALSE);
  
    msg->from[2] = gtk_button_new ();
    gtk_button_set_relief (GTK_BUTTON (msg->from[2]), GTK_RELIEF_NONE);
--- 468,473 ----
***************
*** 1061,1066 ****
--- 1059,1065 ----
    Body *body;
    gchar *tmp;
    gchar *def_charset;
+   GList * from_list;
  
    tmp = gtk_entry_get_text (GTK_ENTRY (bsmsg->to[1]));
    {
***************
*** 1087,1094 ****
  
    /* we should just copy balsa_app.address */
    message->from = address_new ();
!   message->from->personal = g_strdup (balsa_app.address->personal);
!   message->from->mailbox = g_strdup (balsa_app.address->mailbox);
    message->subject = g_strdup (gtk_entry_get_text 
  			       (GTK_ENTRY (bsmsg->subject[1])));
  
--- 1086,1097 ----
  
    /* we should just copy balsa_app.address */
    message->from = address_new ();
!   from_list =  make_list_from_string (gtk_entry_get_text 
! 			       (GTK_ENTRY (bsmsg->from[1])));
!   message->from = from_list->data;
!   from_list = g_list_remove(from_list,message->from);
!   if(from_list) address_list_free(from_list);
! 
    message->subject = g_strdup (gtk_entry_get_text 
  			       (GTK_ENTRY (bsmsg->subject[1])));
  
***************
*** 1148,1155 ****
      for (i = 0; i < GNOME_ICON_LIST (bsmsg->attachments[1])->icons; i++)
        {
  	abody = body_new ();
! 	/* PKGW: This used to be g_strdup'ed. However, the original pointer was strduped and never freed, so
! 	   we'll take it. */
  	abody->filename = (gchar *) gnome_icon_list_get_icon_data 
  	   (GNOME_ICON_LIST (bsmsg->attachments[1]), i);
  	message->body_list = g_list_append (message->body_list, abody);
--- 1151,1158 ----
      for (i = 0; i < GNOME_ICON_LIST (bsmsg->attachments[1])->icons; i++)
        {
  	abody = body_new ();
! 	/* PKGW: This used to be g_strdup'ed. However, the original pointer 
! 	   was strduped and never freed, so we'll take it. */
  	abody->filename = (gchar *) gnome_icon_list_get_icon_data 
  	   (GNOME_ICON_LIST (bsmsg->attachments[1]), i);
  	message->body_list = g_list_append (message->body_list, abody);


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