Re: Compose window patch



I am sorry for this, I was supposed to be against the current CVS version
but apparently it wasn't. Anyway, I try again. Ihave just generated the
diffs with
cvs diff <source>

pref-manager patch as actually completely independent; this is why I
enclose it as an separate attachment.

Sorry for the trouble and hope this time it will work,

Pawel

On Sat, 12 Feb 2000, Peter Williams wrote:

> This patch fails pretty miserably on my CVS Balsa. Is
> it against the CVS source?
Index: src/pref-manager.c
===================================================================
RCS file: /cvs/gnome/balsa/src/pref-manager.c,v
retrieving revision 1.93
diff -r1.93 pref-manager.c
842,844c842,844
< 	pui->sig_whenforward  = gtk_check_button_new_with_label (_("replying to mail"));
< 	gtk_widget_show ( pui->sig_whenforward );
< 	gtk_table_attach (GTK_TABLE (table1),  pui->sig_whenforward , 1, 2, 1, 2,
---
> 	pui->sig_whenreply = gtk_check_button_new_with_label (_("replying to mail"));
> 	gtk_widget_show ( pui->sig_whenreply);
> 	gtk_table_attach (GTK_TABLE (table1),  pui->sig_whenreply, 1, 2, 1, 2,
848,850c848,850
< 	pui->sig_whenreply = gtk_check_button_new_with_label (_("forwarding mail"));
< 	gtk_widget_show ( pui->sig_whenreply);
< 	gtk_table_attach (GTK_TABLE (table1),  pui->sig_whenreply, 1, 2, 2, 3,
---
> 	pui->sig_whenforward  = gtk_check_button_new_with_label (_("forwarding mail"));
> 	gtk_widget_show ( pui->sig_whenforward );
> 	gtk_table_attach (GTK_TABLE (table1),  pui->sig_whenforward , 1, 2, 2, 3,
Index: src/sendmsg-window.c
===================================================================
RCS file: /cvs/gnome/balsa/src/sendmsg-window.c,v
retrieving revision 1.151
diff -r1.151 sendmsg-window.c
44a45
> static gint include_file_cb (GtkWidget *, BalsaSendmsg *);
46a48
> static gint print_message_cb (GtkWidget *, BalsaSendmsg *);
49c51
< static gint check_if_regular_file (gchar *);
---
> static gint check_if_regular_file (const gchar *);
52a55,73
> 
> static void set_menus(BalsaSendmsg*);
> static gint toggle_from_cb (GtkWidget *, BalsaSendmsg *);
> static gint toggle_to_cb (GtkWidget *, BalsaSendmsg *);
> static gint toggle_subject_cb (GtkWidget *, BalsaSendmsg *);
> static gint toggle_cc_cb (GtkWidget *, BalsaSendmsg *);
> static gint toggle_bcc_cb (GtkWidget *, BalsaSendmsg *);
> static gint toggle_fcc_cb (GtkWidget *, BalsaSendmsg *);
> static gint toggle_attachments_cb (GtkWidget *, BalsaSendmsg *);
> 
> static gint iso_font_set(BalsaSendmsg*, gint , gint );
> static gint iso_1_cb(GtkWidget* , BalsaSendmsg *);
> static gint iso_15_cb(GtkWidget* , BalsaSendmsg *);
> static gint iso_2_cb(GtkWidget* , BalsaSendmsg *);
> static gint iso_3_cb(GtkWidget* , BalsaSendmsg *);
> static gint iso_5_cb(GtkWidget* , BalsaSendmsg *);
> static gint iso_8_cb(GtkWidget* , BalsaSendmsg *);
> static gint iso_9_cb(GtkWidget* , BalsaSendmsg *);
> 
75c96,97
<   GNOMEUIINFO_ITEM_STOCK (N_ ("Send"), N_ ("Send this mail"), send_message_cb, GNOME_STOCK_PIXMAP_MAIL_SND),
---
>   GNOMEUIINFO_ITEM_STOCK (N_ ("Send"), N_ ("Send this mail"), send_message_cb,
> 			  GNOME_STOCK_PIXMAP_MAIL_SND),
77c99,100
<   GNOMEUIINFO_ITEM_STOCK (N_ ("Attach"), N_ ("Add attachments to this message"), attach_clicked, GNOME_STOCK_PIXMAP_ATTACH),
---
>   GNOMEUIINFO_ITEM_STOCK (N_ ("Attach"),N_ ("Add attachments to this message"),
> 			  attach_clicked, GNOME_STOCK_PIXMAP_ATTACH),
79c102,103
<   GNOMEUIINFO_ITEM_STOCK (N_ ("Postpone"), N_ ("Continue this message later"), postpone_message_cb, GNOME_STOCK_PIXMAP_SAVE),
---
>   GNOMEUIINFO_ITEM_STOCK (N_ ("Postpone"), N_ ("Continue this message later"),
> 			  postpone_message_cb, GNOME_STOCK_PIXMAP_SAVE),
82,84c106,107
<   GNOMEUIINFO_ITEM_STOCK (N_ ("Spelling"), N_ ("Check Spelling"), NULL, GNOME_STOCK_PIXMAP_SPELLCHECK),
<   GNOMEUIINFO_SEPARATOR,
<   GNOMEUIINFO_ITEM_STOCK (N_ ("Print"), N_ ("Print"), NULL, GNOME_STOCK_PIXMAP_PRINT),
---
>   GNOMEUIINFO_ITEM_STOCK (N_ ("Spelling"), N_ ("Check Spelling"), 
> 			  NULL, GNOME_STOCK_PIXMAP_SPELLCHECK),
87c110,114
<   GNOMEUIINFO_ITEM_STOCK (N_ ("Cancel"), N_ ("Cancel"), close_window, GNOME_STOCK_PIXMAP_CLOSE),
---
>   GNOMEUIINFO_ITEM_STOCK (N_ ("Print"), N_ ("Print"), 
> 			  print_message_cb, GNOME_STOCK_PIXMAP_PRINT),
>   GNOMEUIINFO_SEPARATOR,
>   GNOMEUIINFO_ITEM_STOCK (N_ ("Cancel"), N_ ("Cancel"), 
> 			  close_window, GNOME_STOCK_PIXMAP_CLOSE),
93,104c120,130
<   {
<     GNOME_APP_UI_ITEM, N_ ("_Send"), NULL, send_message_cb, NULL,
<     NULL, GNOME_APP_PIXMAP_STOCK, GNOME_STOCK_MENU_MAIL_SND, 'Y', 0, NULL
<   },
<   {
<     GNOME_APP_UI_ITEM, N_ ("_Attach file..."), NULL, attach_clicked, NULL,
<     NULL, GNOME_APP_PIXMAP_STOCK, GNOME_STOCK_MENU_ATTACH, 'H', 0, NULL
<   },
<   {
<     GNOME_APP_UI_ITEM, N_ ("_Postpone"), NULL, postpone_message_cb, NULL,
<     NULL, GNOME_APP_PIXMAP_STOCK, GNOME_STOCK_MENU_SAVE, 'P', 0, NULL
<   },
---
>   GNOMEUIINFO_ITEM_STOCK(N_ ("_Include File..."), NULL,
> 			 include_file_cb, GNOME_STOCK_MENU_OPEN),
>   GNOMEUIINFO_ITEM_STOCK(N_ ("_Attach file..."), NULL, 
> 			 attach_clicked, GNOME_STOCK_MENU_ATTACH),
>   GNOMEUIINFO_SEPARATOR,
>   GNOMEUIINFO_ITEM_STOCK(N_ ("_Send"),N_ ("Send the currently edited message"),
> 			 send_message_cb, GNOME_STOCK_MENU_MAIL_SND),
>   GNOMEUIINFO_ITEM_STOCK(N_ ("_Postpone"), NULL, 
> 			 postpone_message_cb, GNOME_STOCK_MENU_SAVE),
>   GNOMEUIINFO_ITEM_STOCK(N_ ("Print"), N_ ("Print the edited message"), 
> 			  print_message_cb, GNOME_STOCK_PIXMAP_PRINT),
111a138,195
> 
> static GnomeUIInfo view_menu[] =
> {
> #define MENU_TOGGLE_FROM_POS 0
>   GNOMEUIINFO_TOGGLEITEM( N_ ("_From"), NULL, toggle_from_cb, NULL),
> #define MENU_TOGGLE_TO_POS 1
>   GNOMEUIINFO_TOGGLEITEM( N_ ("_To"), NULL, toggle_to_cb, NULL),
> #define MENU_TOGGLE_SUBJECT_POS 2
>   GNOMEUIINFO_TOGGLEITEM( N_ ("_Subject"), NULL, toggle_subject_cb, NULL),
> #define MENU_TOGGLE_CC_POS 3
>   GNOMEUIINFO_TOGGLEITEM( N_ ("_Cc"), NULL, toggle_cc_cb, NULL),
> #define MENU_TOGGLE_BCC_POS 4
>   GNOMEUIINFO_TOGGLEITEM( N_ ("_Bcc"), NULL, toggle_bcc_cb, NULL),
> #define MENU_TOGGLE_FCC_POS 5
>   GNOMEUIINFO_TOGGLEITEM( N_ ("_Fcc"), NULL, toggle_fcc_cb, NULL),
> #define MENU_TOGGLE_ATTACHMENTS_POS 6
>   GNOMEUIINFO_TOGGLEITEM( N_ ("_Attachments"),NULL,toggle_attachments_cb,NULL),
>   GNOMEUIINFO_END
> };
> 
> 
> /* ISO-8859-1 MUST BE at the first position - see set_menus */
> static GnomeUIInfo iso_charset_menu[] = {
> #define ISO_CHARSET_1_POS 0
>   GNOMEUIINFO_ITEM_NONE( N_ ("_Western (ISO-8859-1)"), NULL, iso_1_cb),
> #define ISO_CHARSET_15_POS 1
>   GNOMEUIINFO_ITEM_NONE( N_ ("W_estern (ISO-8859-15)"), NULL, iso_15_cb),
> #define ISO_CHARSET_2_POS 2
>   GNOMEUIINFO_ITEM_NONE( N_ ("_Central European (ISO-8859-2)"), NULL,iso_2_cb),
> #define ISO_CHARSET_3_POS 3
>   GNOMEUIINFO_ITEM_NONE( N_ ("_South European (ISO-8859-3)"), NULL, iso_3_cb),
> #define ISO_CHARSET_5_POS 4
>   GNOMEUIINFO_ITEM_NONE( N_ ("_Cyrylic (ISO-8859-5)"), NULL, iso_5_cb),
> #define ISO_CHARSET_8_POS 5
>   GNOMEUIINFO_ITEM_NONE( N_ ("_Hebrew (ISO-8859-8)"), NULL, iso_8_cb),
> #define ISO_CHARSET_9_POS 6
>   GNOMEUIINFO_ITEM_NONE( N_ ("_Turkish (ISO-8859-9)"), NULL, iso_9_cb),
>   GNOMEUIINFO_END
> };
> 
> /* the same sequence as in iso_charset_menu */
> static gchar* iso_charset_names[] = {
>    "ISO-8859-1",
>    "ISO-8859-15",
>    "ISO-8859-2",
>    "ISO-8859-3",
>    "ISO-8859-5",
>    "ISO-8859-8",
>    "ISO-8859-9",
> };
> 
> static GnomeUIInfo iso_menu[] = {
>   { GNOME_APP_UI_RADIOITEMS, NULL, NULL, iso_charset_menu, NULL, NULL,
>     GNOME_APP_PIXMAP_NONE, NULL, 0, 0, NULL },
>   GNOMEUIINFO_END
> };
> 
> 
114a199,200
>   GNOMEUIINFO_SUBTREE(N_("_Show"), view_menu),
>   GNOMEUIINFO_SUBTREE(N_("_ISO Charset"), iso_menu),
117a204
> /* the callback handlers */
121,124c208
<   BalsaSendmsg *bsm;
<   bsm = data;
<   balsa_sendmsg_destroy (bsm);
< 
---
>   balsa_sendmsg_destroy ((BalsaSendmsg*)data);
127a212,217
> static gint
> delete_event_cb (GtkWidget * widget, GdkEvent *e, gpointer data)
> {
>   balsa_sendmsg_destroy ((BalsaSendmsg*)data);
>   return TRUE;
> }
128a219
> /* the balsa_sendmsg destructor */
132,140c223,228
<   gtk_widget_destroy (bsm->to);
<   gtk_widget_destroy (bsm->from);
<   gtk_widget_destroy (bsm->subject);
<   gtk_widget_destroy (bsm->cc);
<   gtk_widget_destroy (bsm->bcc);
<   gtk_widget_destroy (bsm->fcc);
<   gtk_widget_destroy (bsm->window);
<   g_free (bsm);
<   bsm = NULL;
---
>    g_assert(bsm != NULL);
>    
>    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...
146c234,235
<   gint num = GPOINTER_TO_INT (gtk_object_get_data (GTK_OBJECT (ilist), "selectednumbertoremove"));
---
>   gint num = GPOINTER_TO_INT (gtk_object_get_data (GTK_OBJECT (ilist), 
> 						   "selectednumbertoremove"));
150a240
> /* the menu is createn on right-button click an an attachement */
157c247,248
<   gtk_object_set_data (GTK_OBJECT (ilist), "selectednumbertoremove", GINT_TO_POINTER (num));
---
>   gtk_object_set_data (GTK_OBJECT (ilist), "selectednumbertoremove", 
> 		       GINT_TO_POINTER (num));
162c253
< 
---
>   
165a257,265
> /* select_icon --------------------------------------------------------------
> 
>    This signal is emitted when an icon becomes selected. If the event
>    argument is NULL, then it means the icon became selected due to a
>    range or rubberband selection. If it is non-NULL, it means the icon
>    became selected due to an user-initiated event such as a mouse button
>    press. The event can be examined to get this information.
> */
> 
167c267,268
< select_attachment (GnomeIconList * ilist, gint num, GdkEventButton * event)
---
> select_attachment (GnomeIconList * ilist, gint num, GdkEventButton * event,
> 		   gpointer data)
169,173c270,274
< 
<   if (event->type == GDK_BUTTON_PRESS && event->button == 3)
<     gtk_menu_popup (GTK_MENU (create_popup_menu (ilist, num)),
< 		    NULL, NULL, NULL, NULL,
< 		    event->button, event->time);
---
>    if(event==NULL) return;
>    if (event->type == GDK_BUTTON_PRESS && event->button == 3)
>       gtk_menu_popup (GTK_MENU (create_popup_menu (ilist, num)),
> 		      NULL, NULL, NULL, NULL,
> 		      event->button, event->time);
179,182c280,283
<   /* Why use unconditional? */ 
<   gchar *pix = gnome_pixmap_file ("balsa/attachment.png");
< 
<   if( !check_if_regular_file( filename ) ) {
---
>    /* FIXME: the path to the file must not be hardcoded */ 
>    gchar *pix = gnome_pixmap_file ("balsa/attachment.png");
>    
>    if( !check_if_regular_file( filename ) ) {
185,194c286,294
<   }
< 
<   if( pix && check_if_regular_file( pix ) ) {
<     gint pos;
<     pos = gnome_icon_list_append (
< 				 iconlist,
< 				 pix,
< 				 g_basename (filename));
<     gnome_icon_list_set_icon_data (iconlist, pos, filename);
<   } else {
---
>    }
>    
>    if( pix && check_if_regular_file( pix ) ) {
>       gint pos;
>       pos = gnome_icon_list_append (
> 	 iconlist, pix,
> 	 g_basename (filename));
>       gnome_icon_list_set_icon_data (iconlist, pos, filename);
>    } else {
196,202c296,303
<       GtkWidget *box = gnome_message_box_new( _("The attachment pixmap (balsa/attachment.png) cannot be found.\n"
< 						"Sadly, this means you cannot attach any files.\n"), 
< 					      GNOME_MESSAGE_BOX_ERROR, _("OK"), NULL );
<       gtk_window_set_modal( GTK_WINDOW( box ), TRUE );
<       gnome_dialog_run( GNOME_DIALOG( box ) );
<       gtk_widget_destroy( GTK_WIDGET( box ) );
<   }
---
>       GtkWidget *box = gnome_message_box_new( 
> 	 _("The attachment pixmap (balsa/attachment.png) cannot be found.\n"
> 	  "This means you cannot attach any files.\n"), 
> 	GNOME_MESSAGE_BOX_ERROR, _("OK"), NULL );
>      gtk_window_set_modal( GTK_WINDOW( box ), TRUE );
>      gnome_dialog_run( GNOME_DIALOG( box ) );
>      gtk_widget_destroy( GTK_WIDGET( box ) );
>    }
206c307
< check_if_regular_file (gchar *filename)
---
> check_if_regular_file (const gchar *filename)
210c311
<   gchar *ptr = 0;
---
>   gchar *ptr = NULL;
211a313
> 
213c315,316
<     ptr = g_strdup_printf (_ ("Cannot get info on file '%s': %s\n"), filename, strerror (errno));
---
>     ptr = g_strdup_printf (_ ("Cannot get info on file '%s': %s\n"), filename,
> 			   strerror (errno));
216c319,320
<     ptr = g_strdup_printf (_ ("Attachment is not a regular file: '%s'\n"), filename);
---
>     ptr = g_strdup_printf (_ ("Attachment is not a regular file: '%s'\n"), 
> 			   filename);
220c324,326
<     msgbox = gnome_message_box_new (ptr, GNOME_MESSAGE_BOX_ERROR, _ ("Cancel"), NULL);
---
>     msgbox = gnome_message_box_new (ptr, GNOME_MESSAGE_BOX_ERROR, 
> 				    _ ("Cancel"), NULL);
>     g_free (ptr);
223d328
<     free (ptr);
241,242c346
<   /* FIXME */
<   /* g_free(filename); */
---
>   /* don't g_free(filename) - the add_attachment arg is not const */
248,254d351
< attach_dialog_cancel (GtkWidget * widget, gpointer data)
< {
<   gtk_widget_destroy (GTK_WIDGET (data));
<   return TRUE;
< }
< 
< static gint
264c361
<   iconlist = GNOME_ICON_LIST (bsm->attachments);
---
>   iconlist = GNOME_ICON_LIST (bsm->attachments[1]);
275c372
< 		      (GtkSignalFunc) attach_dialog_cancel,
---
> 		      (GtkSignalFunc) GTK_SIGNAL_FUNC(gtk_widget_destroy),
331,332d427
<   GtkWidget *label;
<   GtkWidget *button;
340,342c435,437
<   label = gtk_label_new (_("To:"));
<   gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
<   gtk_table_attach (GTK_TABLE (table), label, 0, 1, 0, 1,
---
>   msg->to[0] = gtk_label_new (_("To:"));
>   gtk_misc_set_alignment (GTK_MISC (msg->to[0]), 0.0, 0.5);
>   gtk_table_attach (GTK_TABLE (table), msg->to[0], 0, 1, 0, 1,
345,346c440,441
<   msg->to = gtk_entry_new ();
<   gtk_table_attach (GTK_TABLE (table), msg->to, 1, 2, 0, 1,
---
>   msg->to[1] = gtk_entry_new ();
>   gtk_table_attach (GTK_TABLE (table), msg->to[1], 1, 2, 0, 1,
349,352c444,447
<   button = gtk_button_new ();
<   gtk_button_set_relief (GTK_BUTTON (button), GTK_RELIEF_NONE);
<   GTK_WIDGET_UNSET_FLAGS (button, GTK_CAN_FOCUS);
<   gtk_container_add (GTK_CONTAINER (button),
---
>   msg->to[2] = gtk_button_new ();
>   gtk_button_set_relief (GTK_BUTTON (msg->to[2]), GTK_RELIEF_NONE);
>   GTK_WIDGET_UNSET_FLAGS (msg->to[2], GTK_CAN_FOCUS);
>   gtk_container_add (GTK_CONTAINER (msg->to[2]),
354c449
<   gtk_table_attach (GTK_TABLE (table), button, 2, 3, 0, 1,
---
>   gtk_table_attach (GTK_TABLE (table), msg->to[2], 2, 3, 0, 1,
356,358c451,454
<   gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(address_book_cb),
< 		     (gpointer) msg->to);
<   gtk_signal_connect (GTK_OBJECT (msg->to), "drag_data_received",
---
>   gtk_signal_connect(GTK_OBJECT(msg->to[2]), "clicked", 
> 		     GTK_SIGNAL_FUNC(address_book_cb),
> 		     (gpointer) msg->to[1]);
>   gtk_signal_connect (GTK_OBJECT (msg->to[1]), "drag_data_received",
360c456
<   gtk_drag_dest_set (GTK_WIDGET (msg->to), GTK_DEST_DEFAULT_ALL,
---
>   gtk_drag_dest_set (GTK_WIDGET (msg->to[1]), GTK_DEST_DEFAULT_ALL,
365,367c461,463
<   label = gtk_label_new (_("From:"));
<   gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
<   gtk_table_attach (GTK_TABLE (table), label, 0, 1, 1, 2,
---
>   msg->from[0] = gtk_label_new (_("From:"));
>   gtk_misc_set_alignment (GTK_MISC (msg->from[0]), 0.0, 0.5);
>   gtk_table_attach (GTK_TABLE (table), msg->from[0], 0, 1, 1, 2,
370,371c466,467
<   msg->from = gtk_entry_new ();
<   gtk_table_attach (GTK_TABLE (table), msg->from, 1, 2, 1, 2,
---
>   msg->from[1] = gtk_entry_new ();
>   gtk_table_attach (GTK_TABLE (table), msg->from[1], 1, 2, 1, 2,
373,374c469,470
<   GTK_WIDGET_UNSET_FLAGS (msg->from, GTK_CAN_FOCUS);
<   gtk_entry_set_editable (GTK_ENTRY (msg->from), FALSE);
---
>   GTK_WIDGET_UNSET_FLAGS (msg->from[1], GTK_CAN_FOCUS);
>   gtk_entry_set_editable (GTK_ENTRY (msg->from[1]), FALSE);
376,379c472,475
<   button = gtk_button_new ();
<   gtk_button_set_relief (GTK_BUTTON (button), GTK_RELIEF_NONE);
<   GTK_WIDGET_UNSET_FLAGS (button, GTK_CAN_FOCUS);
<   gtk_container_add (GTK_CONTAINER (button),
---
>   msg->from[2] = gtk_button_new ();
>   gtk_button_set_relief (GTK_BUTTON (msg->from[2]), GTK_RELIEF_NONE);
>   GTK_WIDGET_UNSET_FLAGS (msg->from[2], GTK_CAN_FOCUS);
>   gtk_container_add (GTK_CONTAINER (msg->from[2]),
381c477
<   gtk_table_attach (GTK_TABLE (table), button, 2, 3, 1, 2,
---
>   gtk_table_attach (GTK_TABLE (table), msg->from[2], 2, 3, 1, 2,
385,387c481,483
<   label = gtk_label_new (_("Subject:"));
<   gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
<   gtk_table_attach (GTK_TABLE (table), label, 0, 1, 2, 3,
---
>   msg->subject[0] = gtk_label_new (_("Subject:"));
>   gtk_misc_set_alignment (GTK_MISC (msg->subject[0]), 0.0, 0.5);
>   gtk_table_attach (GTK_TABLE (table), msg->subject[0], 0, 1, 2, 3,
390,391c486,487
<   msg->subject = gtk_entry_new ();
<   gtk_table_attach (GTK_TABLE (table), msg->subject, 1, 2, 2, 3,
---
>   msg->subject[1] = gtk_entry_new ();
>   gtk_table_attach (GTK_TABLE (table), msg->subject[1], 1, 2, 2, 3,
395,397c491,493
<   label = gtk_label_new (_("cc:"));
<   gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
<   gtk_table_attach (GTK_TABLE (table), label, 0, 1, 3, 4,
---
>   msg->cc[0] = gtk_label_new (_("cc:"));
>   gtk_misc_set_alignment (GTK_MISC (msg->cc[0]), 0.0, 0.5);
>   gtk_table_attach (GTK_TABLE (table), msg->cc[0], 0, 1, 3, 4,
400,401c496,497
<   msg->cc = gtk_entry_new ();
<   gtk_table_attach (GTK_TABLE (table), msg->cc, 1, 2, 3, 4,
---
>   msg->cc[1] = gtk_entry_new ();
>   gtk_table_attach (GTK_TABLE (table), msg->cc[1], 1, 2, 3, 4,
404,407c500,503
<   button = gtk_button_new ();
<   gtk_button_set_relief (GTK_BUTTON (button), GTK_RELIEF_NONE);
<   GTK_WIDGET_UNSET_FLAGS (button, GTK_CAN_FOCUS);
<   gtk_container_add (GTK_CONTAINER (button),
---
>   msg->cc[2] = gtk_button_new ();
>   gtk_button_set_relief (GTK_BUTTON (msg->cc[2]), GTK_RELIEF_NONE);
>   GTK_WIDGET_UNSET_FLAGS (msg->cc[2], GTK_CAN_FOCUS);
>   gtk_container_add (GTK_CONTAINER (msg->cc[2]),
409c505
<   gtk_table_attach (GTK_TABLE (table), button, 2, 3, 3, 4,
---
>   gtk_table_attach (GTK_TABLE (table), msg->cc[2], 2, 3, 3, 4,
411,413c507,510
<   gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(address_book_cb),
< 		     (gpointer) msg->cc);
<   gtk_signal_connect (GTK_OBJECT (msg->cc), "drag_data_received",
---
>   gtk_signal_connect(GTK_OBJECT(msg->cc[2]), "clicked", 
> 		     GTK_SIGNAL_FUNC(address_book_cb),
> 		     (gpointer) msg->cc[1]);
>   gtk_signal_connect (GTK_OBJECT (msg->cc[1]), "drag_data_received",
415c512
<   gtk_drag_dest_set (GTK_WIDGET (msg->cc), GTK_DEST_DEFAULT_ALL,
---
>   gtk_drag_dest_set (GTK_WIDGET (msg->cc[1]), GTK_DEST_DEFAULT_ALL,
420,422c517,519
<   label = gtk_label_new (_("bcc:"));
<   gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
<   gtk_table_attach (GTK_TABLE (table), label, 0, 1, 4, 5,
---
>   msg->bcc[0] = gtk_label_new (_("bcc:"));
>   gtk_misc_set_alignment (GTK_MISC (msg->bcc[0]), 0.0, 0.5);
>   gtk_table_attach (GTK_TABLE (table), msg->bcc[0], 0, 1, 4, 5,
425,426c522,523
<   msg->bcc = gtk_entry_new ();
<   gtk_table_attach (GTK_TABLE (table), msg->bcc, 1, 2, 4, 5,
---
>   msg->bcc[1] = gtk_entry_new ();
>   gtk_table_attach (GTK_TABLE (table), msg->bcc[1], 1, 2, 4, 5,
429,432c526,529
<   button = gtk_button_new ();
<   gtk_button_set_relief (GTK_BUTTON (button), GTK_RELIEF_NONE);
<   GTK_WIDGET_UNSET_FLAGS (button, GTK_CAN_FOCUS);
<   gtk_container_add (GTK_CONTAINER (button),
---
>   msg->bcc[2] = gtk_button_new ();
>   gtk_button_set_relief (GTK_BUTTON (msg->bcc[2]), GTK_RELIEF_NONE);
>   GTK_WIDGET_UNSET_FLAGS (msg->bcc[2], GTK_CAN_FOCUS);
>   gtk_container_add (GTK_CONTAINER (msg->bcc[2]),
434c531
<   gtk_table_attach (GTK_TABLE (table), button, 2, 3, 4, 5,
---
>   gtk_table_attach (GTK_TABLE (table), msg->bcc[2], 2, 3, 4, 5,
436,438c533,536
<   gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(address_book_cb),
< 		     (gpointer) msg->bcc);
<   gtk_signal_connect (GTK_OBJECT (msg->bcc), "drag_data_received",
---
>   gtk_signal_connect(GTK_OBJECT(msg->bcc[2]), "clicked", 
> 		     GTK_SIGNAL_FUNC(address_book_cb),
> 		     (gpointer) msg->bcc[1]);
>   gtk_signal_connect (GTK_OBJECT (msg->bcc[1]), "drag_data_received",
440c538
<   gtk_drag_dest_set (GTK_WIDGET (msg->bcc), GTK_DEST_DEFAULT_ALL,
---
>   gtk_drag_dest_set (GTK_WIDGET (msg->bcc[1]), GTK_DEST_DEFAULT_ALL,
445,447c543,545
<   label = gtk_label_new (_("fcc:"));
<   gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
<   gtk_table_attach (GTK_TABLE (table), label, 0, 1, 5, 6,
---
>   msg->fcc[0] = gtk_label_new (_("fcc:"));
>   gtk_misc_set_alignment (GTK_MISC (msg->fcc[0]), 0.0, 0.5);
>   gtk_table_attach (GTK_TABLE (table), msg->fcc[0], 0, 1, 5, 6,
450,452c548,550
<   msg->fcc = gtk_combo_new ();
<   gtk_combo_set_use_arrows (GTK_COMBO (msg->fcc), 0);
<   gtk_combo_set_use_arrows_always (GTK_COMBO (msg->fcc), 0);
---
>   msg->fcc[1] = gtk_combo_new ();
>   gtk_combo_set_use_arrows (GTK_COMBO (msg->fcc[1]), 0);
>   gtk_combo_set_use_arrows_always (GTK_COMBO (msg->fcc[1]), 0);
467c565
<     gtk_combo_set_popdown_strings (GTK_COMBO (msg->fcc), glist);
---
>     gtk_combo_set_popdown_strings (GTK_COMBO (msg->fcc[1]), glist);
469c567
<   gtk_table_attach (GTK_TABLE (table), msg->fcc, 1, 3, 5, 6, 
---
>   gtk_table_attach (GTK_TABLE (table), msg->fcc[1], 1, 3, 5, 6, 
473,475c571,573
<   label = gtk_label_new (_("Attachments:"));
<   gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
<   gtk_table_attach (GTK_TABLE (table), label, 0, 1, 6, 7,
---
>   msg->attachments[0] = gtk_label_new (_("Attachments:"));
>   gtk_misc_set_alignment (GTK_MISC (msg->attachments[0]), 0.0, 0.5);
>   gtk_table_attach (GTK_TABLE (table), msg->attachments[0], 0, 1, 6, 7,
484,485c582,583
<   msg->attachments = gnome_icon_list_new (100, NULL, FALSE);
<   gtk_signal_connect (GTK_OBJECT (msg->attachments), "drag_data_received",
---
>   msg->attachments[1] = gnome_icon_list_new (100, NULL, FALSE);
>   gtk_signal_connect (GTK_OBJECT (msg->attachments[1]), "drag_data_received",
487c585
<   gtk_drag_dest_set (GTK_WIDGET (msg->attachments), GTK_DEST_DEFAULT_ALL,
---
>   gtk_drag_dest_set (GTK_WIDGET (msg->attachments[1]), GTK_DEST_DEFAULT_ALL,
491c589
<   gtk_widget_set_usize (msg->attachments, -1, 50);
---
>   gtk_widget_set_usize (msg->attachments[1], -1, 50);
495c593
<   gtk_container_add (GTK_CONTAINER (sw), msg->attachments);
---
>   gtk_container_add (GTK_CONTAINER (sw), msg->attachments[1]);
499c597,598
< 		    GTK_FILL | GTK_EXPAND, GTK_FILL | GTK_EXPAND | GTK_SHRINK, 0, 0);
---
> 		    GTK_FILL | GTK_EXPAND, GTK_FILL | GTK_EXPAND | GTK_SHRINK,
> 		    0, 0);
501c600
<   gtk_signal_connect (GTK_OBJECT (msg->attachments), "select_icon",
---
>   gtk_signal_connect (GTK_OBJECT (msg->attachments[1]), "select_icon",
505,506c604,611
<   gnome_icon_list_set_selection_mode (GNOME_ICON_LIST (msg->attachments), GTK_SELECTION_MULTIPLE);
<   GTK_WIDGET_SET_FLAGS (GNOME_ICON_LIST (msg->attachments), GTK_CAN_FOCUS);
---
>   gnome_icon_list_set_selection_mode (GNOME_ICON_LIST (msg->attachments[1]), 
> 				      GTK_SELECTION_MULTIPLE);
>   GTK_WIDGET_SET_FLAGS (GNOME_ICON_LIST (msg->attachments[1]), GTK_CAN_FOCUS);
> 
>   msg->attachments[2] = sw;
>   msg->attachments[3] = frame;
> 
>   gtk_widget_show_all( GTK_WIDGET(table) );
510a616,618
> /* create_text_area should not have any hard-coded assumptions about the 
>    font charset that is to be used.
> */
517,524d624
<   GdkFont *font;
<   GdkColormap* colormap;
<   GtkStyle *style;
< 
<   style = gtk_style_new ();
<   font = gdk_font_load ("-misc-fixed-medium-r-normal--14-130-75-75-c-70-iso8859-1");
<   colormap = gtk_widget_get_colormap (GTK_WIDGET (msg->attachments));
<   style->font = font;
531,532c631,634
<   gtk_widget_set_style (msg->text, style);
<   gtk_widget_set_usize (msg->text, (82 * 7) + (2 * msg->text->style->klass->xthickness), -1);
---
> 
>   gtk_widget_set_usize (msg->text, 
> 			(82 * 7) + (2 * msg->text->style->klass->xthickness), 
> 			-1);
544a647,648
>   gtk_widget_show_all( GTK_WIDGET(table) );
> 
547a652,740
> /* continueBody ---------------------------------------------------------
>    a short-circuit procedure for the 'Continue action'
> */
> static void
> continueBody(Message * message, BalsaSendmsg *msg)
> {
>    GString *rbdy;
> 
>    g_return_if_fail(message->body_list != NULL); /* FIXME: is it needed? */
> 
>    rbdy = content2reply (message, NULL); 
>    gtk_text_insert (GTK_TEXT (msg->text), NULL, NULL, NULL, rbdy->str, 
> 		    strlen (rbdy->str));
>    g_string_free (rbdy, TRUE);
> }
> 
> /* quoteBody ------------------------------------------------------------
>    quotes properly the body of the message
>    Continue basically copies the text over to the entry field.
> */
> static void 
> quoteBody(Message * message, BalsaSendmsg *msg, SendType type)
> {
>    GString *rbdy;
>    gchar *str, *personStr;
> 
>    message_body_ref (message); /* avoid unexpected object vanishing(?) */
>    
>    //body = (Body *) message->body_list->data;
> 
>    personStr = (message->from && message->from->personal) ?
>       message->from->personal : _("you");
>    
>       /* Should use instead something like:
>        * 	strftime( buf, sizeof(buf), _("On %A %B %d %Y etc"),
>        * 	                somedateparser(message-date)));
>        * 	tmp = g_strdup_printf (buf);
>        * so the date attribution can fully (and properly) translated.
>        */
>    if(message->date)
>       str = g_strdup_printf (_("On %s %s wrote:\n"), message->date, personStr);
>    else
>       str = g_strdup_printf (_("%s wrote:\n"), personStr);
> 
> 
>    gtk_text_insert (GTK_TEXT (msg->text), NULL, NULL, NULL, 
> 		    str, strlen (str));
>    
>    g_free (str);
> 
>    rbdy = content2reply (message, 
> 			 (type == SEND_REPLY || type == SEND_REPLY_ALL) ?
> 			 balsa_app.quote_str : NULL); 
>    
>    gtk_text_insert (GTK_TEXT (msg->text), NULL, NULL, NULL, rbdy->str, 
> 		    strlen (rbdy->str));
>    g_string_free (rbdy, TRUE);
> 
>    gtk_text_insert (GTK_TEXT (msg->text), NULL, NULL, NULL, "\n\n", 2);
>    message_body_unref (message);
> }
> 
> /* fillBody --------------------------------------------------------------
>    fills the body of the message to be composed based on the given message.
>    First quotes the original one and then adds the signature
> */
> static void
> fillBody(Message * message, BalsaSendmsg *msg, SendType type)
> {
>    gchar *signature;
>    
>    if (type != SEND_NORMAL && message) 
>       quoteBody(message, msg, type);
>    
>   if ((signature = read_signature()) != NULL) {
>      if ( ((type == SEND_REPLY || type == SEND_REPLY_ALL) && 
> 	   balsa_app.sig_whenreply) ||
> 	  ( (type == SEND_FORWARD) && balsa_app.sig_whenforward) ||
> 	  ( (type == SEND_NORMAL) && balsa_app.sig_sending) ) {
> 	gtk_text_insert (GTK_TEXT (msg->text), NULL, NULL, NULL, 
> 			 signature, strlen (signature));
>      }
>      g_free (signature);
>   }
>   /* FIXME: workaround for buggy GtkText, is it needed? */
>   gtk_text_set_point( GTK_TEXT(msg->text), 0); 
>   gtk_editable_set_position( GTK_EDITABLE(msg->text), 0);
> }
> 
554,555d746
<   gchar *signature;
< 
558d748
< 
559a750,751
>   msg->font = NULL;
> 
585,586c777,778
<   msg->window = window;
<   msg->type = type;
---
>   msg->window  = window;
>   msg->type    = type;
588,589c780,786
<   gtk_signal_connect (GTK_OBJECT (msg->window), "delete_event",
< 		      GTK_SIGNAL_FUNC (gtk_false), NULL);
---
>   gtk_signal_connect (GTK_OBJECT(msg->window), "delete_event",
> 		      GTK_SIGNAL_FUNC (delete_event_cb), msg);
>   gtk_signal_connect (GTK_OBJECT (msg->window), "destroy_event",
>   		      GTK_SIGNAL_FUNC (delete_event_cb), msg);
> 
>   gnome_app_create_menus_with_data (GNOME_APP (window), main_menu, msg);
>   gnome_app_create_toolbar_with_data (GNOME_APP (window), main_toolbar, msg);
592,593c789
<   gtk_paned_add1 (GTK_PANED(paned),
< 		      create_info_pane (msg, type));
---
>   gtk_paned_add1 (GTK_PANED(paned), create_info_pane (msg, type));
609c805
<       gtk_entry_set_text (GTK_ENTRY (msg->to), tmp);
---
>       gtk_entry_set_text (GTK_ENTRY (msg->to[1]), tmp);
616,617c812,814
<     from = g_strdup_printf ("%s <%s>", balsa_app.address->personal, balsa_app.address->mailbox);
<     gtk_entry_set_text (GTK_ENTRY (msg->from), from);
---
>     from = g_strdup_printf ("%s <%s>", balsa_app.address->personal, 
> 			    balsa_app.address->mailbox);
>     gtk_entry_set_text (GTK_ENTRY (msg->from[1]), from);
624c821
<       gtk_entry_set_text (GTK_ENTRY (msg->bcc), balsa_app.bcc);
---
>       gtk_entry_set_text (GTK_ENTRY (msg->bcc[1]), balsa_app.bcc);
630c827
<       gtk_entry_set_text (GTK_ENTRY(GTK_COMBO(msg->fcc)->entry),
---
>       gtk_entry_set_text (GTK_ENTRY(GTK_COMBO(msg->fcc[1])->entry),
691c888
<       gtk_entry_set_text (GTK_ENTRY (msg->subject), newsubject);
---
>       gtk_entry_set_text (GTK_ENTRY (msg->subject[1]), newsubject);
701c898
<       gtk_entry_set_text (GTK_ENTRY (msg->to), tmp);
---
>       gtk_entry_set_text (GTK_ENTRY (msg->to[1]), tmp);
706c903
<       gtk_entry_set_text (GTK_ENTRY (msg->cc), tmp);
---
>       gtk_entry_set_text (GTK_ENTRY (msg->cc[1]), tmp);
711c908
<       gtk_entry_set_text (GTK_ENTRY (msg->bcc), tmp);
---
>       gtk_entry_set_text (GTK_ENTRY (msg->bcc[1]), tmp);
715c912
<       gtk_entry_set_text (GTK_ENTRY (msg->subject), message->subject);
---
>       gtk_entry_set_text (GTK_ENTRY (msg->subject[1]), message->subject);
723c920
<       gtk_entry_set_text (GTK_ENTRY (msg->cc), tmp);
---
>       gtk_entry_set_text (GTK_ENTRY (msg->cc[1]), tmp);
728c925
< 	  gtk_entry_append_text (GTK_ENTRY (msg->cc), ", ");
---
> 	  gtk_entry_append_text (GTK_ENTRY (msg->cc[1]), ", ");
731c928
< 	  gtk_entry_append_text (GTK_ENTRY (msg->cc), tmp);
---
> 	  gtk_entry_append_text (GTK_ENTRY (msg->cc[1]), tmp);
740,741c937
<   gnome_app_create_menus_with_data (GNOME_APP (window), main_menu, msg);
<   gnome_app_create_toolbar_with_data (GNOME_APP (window), main_toolbar, msg);
---
>   gtk_text_insert   (GTK_TEXT(msg->text), NULL, NULL, NULL, "\n", 1);
743,810c939,942
< 
<   gtk_text_freeze (GTK_TEXT (msg->text));
<   if (type != SEND_NORMAL)
<     {
<       Body *body = NULL;
<       GString *str = g_string_new ("\n\n");
<       GString *rbdy;
<       gchar *tmp;
< 
<       message_body_ref (message);
< 
<       if (message->body_list)
< 	{
< 	  body = (Body *) message->body_list->data;
< 
< 	  if (message->date)
< 	    {
<               /* Should use instead something like:
<                * 	strftime( buf, sizeof(buf), _("On %A %B %d %Y etc"),
<                * 	                somedateparser(message-date)));
<                * 	tmp = g_strdup_printf (buf);
<                * so the date attribution can fully (and properly) translated.
<                */		
< 	      tmp = g_strdup_printf (_("On %s "), message->date);
< 	      str = g_string_append (str, tmp);
< 	      g_free (tmp);
< 	    }
< 
< 	  if (message->from)
< 	    {
< 	      if (message->from->personal)
< 		str = g_string_append (str, message->from->personal);
< 	      else
< 		str = g_string_append (str, _("you"));
< 	    }
< 	  else
< 	    str = g_string_append (str, _("you"));
< 
< 	  str = g_string_append (str, _(" wrote:\n"));
< 
< 
<       if (type != SEND_CONTINUE)
< 	    gtk_text_insert (GTK_TEXT (msg->text), NULL, NULL, NULL, str->str, strlen (str->str));
< 
< 
< 	  g_string_free (str, TRUE);
< 
<       if (type != SEND_CONTINUE)
< 	    rbdy = content2reply (message, balsa_app.quote_str);	/* arp */
< 	  else
< 	    rbdy = content2reply (message, NULL);	/* arp */
< 
< 	  gtk_text_insert (GTK_TEXT (msg->text), NULL, NULL, NULL, rbdy->str, strlen (rbdy->str));
< 	  g_string_free (rbdy, TRUE);
< 	  gtk_text_insert (GTK_TEXT (msg->text), NULL, NULL, NULL, "\n\n", 2);
< 	}
<       message_body_unref (message);
<     }
< 
<   if ((signature = read_signature()) != NULL && type != SEND_CONTINUE) {
<      if ( ((type == SEND_REPLY || type == SEND_REPLY_ALL) && balsa_app.sig_whenreply) ||
< 	  ( (type == SEND_FORWARD) && balsa_app.sig_whenforward) ||
< 	  ( (type == SEND_NORMAL) && balsa_app.sig_sending) )
< 	      gtk_text_insert (GTK_TEXT (msg->text), NULL, NULL, NULL, signature, strlen (signature));
<      g_free (signature);
<     }
<   gtk_text_set_point (GTK_TEXT (msg->text), 0);
<   gtk_text_thaw (GTK_TEXT (msg->text));
---
>   if(type==SEND_CONTINUE) 
>      continueBody(message,msg);
>   else
>      fillBody(message, msg, type);
824,825c956,961
<   /* display the window */
<   gtk_widget_show_all (window);
---
>   /* set the menus  - and charset index - and display the window */
>   /* FIXME: this will also reset the font, copying the text back and 
>      forth which is sub-optimal
>   */
>   set_menus(msg); 
>   gtk_widget_show (window);
848a985,1054
> /* opens the load file dialog box, allows selection of the file and includes
>    it at current point */
> static void do_insert_file(GtkWidget *selector, GtkFileSelection* fs) {
>    gchar* fname;
>    guint cnt;
>    gchar buf[4096];
>    FILE* fl;
>    BalsaSendmsg * bsmsg;
> 
>    bsmsg = (BalsaSendmsg*) gtk_object_get_user_data (GTK_OBJECT (fs));
>    fname = gtk_file_selection_get_filename( GTK_FILE_SELECTION(fs) );
> 
>    cnt = gtk_editable_get_position( GTK_EDITABLE(bsmsg->text) );
> 
>    if(! (fl = fopen(fname,"rt")) ) {
>       GtkWidget *box = gnome_message_box_new( 
> 	 _("Could not open the file.\n"), 
> 	 GNOME_MESSAGE_BOX_ERROR, _("Cancel"), NULL );
>       gtk_window_set_modal( GTK_WINDOW( box ), TRUE );
>       gnome_dialog_run( GNOME_DIALOG( box ) );
>       gtk_widget_destroy( GTK_WIDGET( box ) );
>    } else {
>       gnome_appbar_push(balsa_app.appbar, _("Loading..."));
> 
>       gtk_text_freeze( GTK_TEXT(bsmsg->text) );
>       gtk_text_set_point( GTK_TEXT(bsmsg->text), cnt); 
>       while( (cnt=fread(buf, 1,sizeof(buf), fl)) > 0) {
> 	 if(balsa_app.debug)
> 	    printf("%s cnt: %d (max: %d)\n",fname, cnt, sizeof(buf));
> 	 gtk_text_insert(GTK_TEXT(bsmsg->text), bsmsg->font, 
> 			 NULL, NULL, buf, cnt);
>       }
>       if(balsa_app.debug)
> 	 printf("%s cnt: %d (max: %d)\n",fname, cnt, sizeof(buf));
> 
>       gtk_text_thaw( GTK_TEXT(bsmsg->text) );
>       fclose(fl);
>       gnome_appbar_pop(balsa_app.appbar);
>    }
>    /* g_free(fname); */
>    gtk_widget_destroy(GTK_WIDGET(fs) );
>    
> }
> 
> static gint include_file_cb (GtkWidget *widget, BalsaSendmsg *bsmsg) {
>    GtkWidget *file_selector;
> 
>    file_selector =  gtk_file_selection_new(_("Include file"));
>    gtk_object_set_user_data (GTK_OBJECT (file_selector), bsmsg);
> 
>    gtk_file_selection_hide_fileop_buttons (GTK_FILE_SELECTION(file_selector));
> 
>    gtk_signal_connect (GTK_OBJECT(
>       GTK_FILE_SELECTION(file_selector)->ok_button),
> 		       "clicked", GTK_SIGNAL_FUNC (do_insert_file), 
> 		       file_selector);
>                              
>    /* Ensure that the dialog box is destroyed when the user clicks a button. */
>      
>    gtk_signal_connect_object (GTK_OBJECT(
>       GTK_FILE_SELECTION(file_selector)->cancel_button),  
> 			      "clicked", GTK_SIGNAL_FUNC (gtk_widget_destroy),
> 			      (gpointer) file_selector);
>    
>    /* Display that dialog */
>    gtk_widget_show (file_selector);
> 
>    return TRUE;
> }
> 
854a1061
>   gchar *def_charset;
856c1063
<   tmp = gtk_entry_get_text (GTK_ENTRY (bsmsg->to));
---
>   tmp = gtk_entry_get_text (GTK_ENTRY (bsmsg->to[1]));
883c1090,1091
<   message->subject = g_strdup (gtk_entry_get_text (GTK_ENTRY (bsmsg->subject)));
---
>   message->subject = g_strdup (gtk_entry_get_text 
> 			       (GTK_ENTRY (bsmsg->subject[1])));
885,887c1093,1098
<   message->to_list = make_list_from_string (gtk_entry_get_text (GTK_ENTRY (bsmsg->to)));
<   message->cc_list = make_list_from_string (gtk_entry_get_text (GTK_ENTRY (bsmsg->cc)));
<   message->bcc_list = make_list_from_string (gtk_entry_get_text (GTK_ENTRY (bsmsg->bcc)));
---
>   message->to_list = make_list_from_string (gtk_entry_get_text
> 					    (GTK_ENTRY (bsmsg->to[1])));
>   message->cc_list = make_list_from_string (gtk_entry_get_text 
> 					    (GTK_ENTRY (bsmsg->cc[1])));
>   message->bcc_list = make_list_from_string (gtk_entry_get_text 
> 					     (GTK_ENTRY (bsmsg->bcc[1])));
889c1100
<   tmp = gtk_entry_get_text (GTK_ENTRY(GTK_COMBO(bsmsg->fcc)->entry));
---
>   tmp = gtk_entry_get_text (GTK_ENTRY(GTK_COMBO(bsmsg->fcc[1])->entry));
935c1146
<     for (i = 0; i < GNOME_ICON_LIST (bsmsg->attachments)->icons; i++)
---
>     for (i = 0; i < GNOME_ICON_LIST (bsmsg->attachments[1])->icons; i++)
940c1151,1152
< 	abody->filename = (gchar *) gnome_icon_list_get_icon_data (GNOME_ICON_LIST (bsmsg->attachments), i);
---
> 	abody->filename = (gchar *) gnome_icon_list_get_icon_data 
> 	   (GNOME_ICON_LIST (bsmsg->attachments[1]), i);
945a1158,1163
>   /* not really a nice way of doing it, is it? */
>   def_charset =  balsa_app.charset;
>   balsa_app.charset = iso_charset_names[bsmsg->charset_idx];
>   if(balsa_app.debug) 
>      fprintf(stderr, "sending with charset: %s\n", balsa_app.charset);
> 
966a1185,1186
>   balsa_app.charset = def_charset;
> 
981c1201
<   tmp = gtk_entry_get_text (GTK_ENTRY (bsmsg->to));
---
>   tmp = gtk_entry_get_text (GTK_ENTRY (bsmsg->to[1]));
1008c1228,1229
<   message->subject = g_strdup (gtk_entry_get_text (GTK_ENTRY (bsmsg->subject)));
---
>   message->subject = g_strdup (gtk_entry_get_text 
> 			       (GTK_ENTRY (bsmsg->subject[1])));
1010,1012c1231,1236
<   message->to_list = make_list_from_string (gtk_entry_get_text (GTK_ENTRY (bsmsg->to)));
<   message->cc_list = make_list_from_string (gtk_entry_get_text (GTK_ENTRY (bsmsg->cc)));
<   message->bcc_list = make_list_from_string (gtk_entry_get_text (GTK_ENTRY (bsmsg->bcc)));
---
>   message->to_list = make_list_from_string (
>      gtk_entry_get_text (GTK_ENTRY (bsmsg->to[1])));
>   message->cc_list = make_list_from_string (
>      gtk_entry_get_text (GTK_ENTRY (bsmsg->cc[1])));
>   message->bcc_list = make_list_from_string (
>      gtk_entry_get_text (GTK_ENTRY (bsmsg->bcc[1])));
1022,1023c1246,1248
<   body->buffer = gtk_editable_get_chars (GTK_EDITABLE (bsmsg->text), 0,
< 			      gtk_text_get_length (GTK_TEXT (bsmsg->text)));
---
>   body->buffer = gtk_editable_get_chars(GTK_EDITABLE (bsmsg->text), 0,
> 					gtk_text_get_length (
> 					   GTK_TEXT (bsmsg->text)));
1030,1036c1255,1263
<     for (i = 0; i < GNOME_ICON_LIST (bsmsg->attachments)->icons; i++)
<       {
< 	abody = body_new ();
< 	/* PKGW: see above about why this isn't strduped. */
< 	abody->filename = (gchar *) gnome_icon_list_get_icon_data (GNOME_ICON_LIST (bsmsg->attachments), i);
< 	message->body_list = g_list_append (message->body_list, abody);
<       }
---
> 
>     for (i = 0; i < GNOME_ICON_LIST (bsmsg->attachments[1])->icons; i++) {
>       abody = body_new ();
>       /* PKGW: see above about why this isn't strduped. */
>       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);
>     }
1037a1265
>   
1038a1267,1274
>   if ((bsmsg->type == SEND_REPLY || bsmsg->type == SEND_REPLY_ALL)
>       && bsmsg->orig_message)
>      balsa_postpone_message (message, bsmsg->orig_message, 
> 			     gtk_entry_get_text (
> 				GTK_ENTRY(GTK_COMBO(bsmsg->fcc[1])->entry)));
>   else
>      balsa_postpone_message (message, NULL, gtk_entry_get_text (
> 	GTK_ENTRY(GTK_COMBO(bsmsg->fcc[1])->entry)));
1040,1047d1275
<  if ((bsmsg->type == SEND_REPLY || bsmsg->type == SEND_REPLY_ALL)
<      && bsmsg->orig_message)
<    balsa_postpone_message (message, bsmsg->orig_message, 
<                            gtk_entry_get_text (
<                                GTK_ENTRY(GTK_COMBO(bsmsg->fcc)->entry)));
<  else
<    balsa_postpone_message (message, NULL, gtk_entry_get_text (
<        GTK_ENTRY(GTK_COMBO(bsmsg->fcc)->entry)));
1060a1289,1351
> /* very harsh print handler. Prints headers and the body only, as raw text
> */
> static gint 
> print_message_cb(GtkWidget * widget, BalsaSendmsg * bsmsg)
> {
> 
> #ifdef GNOME_PRINT
> #error this is not finished yet!
> #define FNT_SZ 12
>    GnomePrintFont * fnt;
>    GnomePrintContext * prn = gnome_print_context_new(
>       gnome_print_default_printer());
> 
>    fnt = gnome_print_find_font("Times", FNT_SZ);
>    gnome_print_set_font(prn,fnt);
> 
> 
>    gnome_print_context_close(prn);
>    gnome_print_context_free (prn);
> #else
>    gchar* str;
>    gchar* dest;
>    FILE * lpr;
> 
>    dest = g_strdup_printf(balsa_app.PrintCommand.PrintCommand, "-");
>    lpr  = popen(dest,"w");
>    g_free(dest);
> 
>    if(!lpr) {
>       GtkWidget* msgbox = gnome_message_box_new (
> 	 _("Cannot execute print command."), 
> 	 GNOME_MESSAGE_BOX_ERROR, 
> 	 _("Cancel"), NULL);
>       gtk_window_set_modal (GTK_WINDOW (msgbox), TRUE);
>       gnome_dialog_run (GNOME_DIALOG (msgbox));
>    }
> 
>    str = gtk_editable_get_chars( GTK_EDITABLE(bsmsg->from[1]),0,-1);
>    fprintf(lpr, "From   : %s\n",str);
>    g_free(str);
>    str = gtk_editable_get_chars( GTK_EDITABLE(bsmsg->to[1]),0,-1);
>    fprintf(lpr, "To     : %s\n",str);
>    g_free(str);
>    str = gtk_editable_get_chars( GTK_EDITABLE(bsmsg->subject[1]),0,-1);
>    fprintf(lpr, "Subject: %s\n",str);
>    g_free(str);
> 
>    str = gtk_editable_get_chars( GTK_EDITABLE(bsmsg->text), 0, -1);
>    fputs(str, lpr);
>    g_free(str);
>    fputs("\n\f",lpr);
> 
>    if(pclose(lpr)!=0) {
>       GtkWidget* msgbox = gnome_message_box_new (
> 	 _("Error executing lpr"), GNOME_MESSAGE_BOX_ERROR, 
> 	 _("Cancel"), NULL);
>       gtk_window_set_modal (GTK_WINDOW (msgbox), TRUE);
>       gnome_dialog_run (GNOME_DIALOG (msgbox));
>    }
> #endif
>    return TRUE;
> }
> 
1133c1424
<   body->buffer = malloc(final_length);
---
>   body->buffer = g_malloc(final_length);
1142c1433
<       free(next_line->data);
---
>       g_free(next_line->data);
1148a1440,1586
> static gint 
> toggle_entry (GtkWidget *entry[], int pos, int cnt)
> {
>    GtkWidget* parent;
>    if( GTK_CHECK_MENU_ITEM(view_menu[pos].widget)->active) {
>       while(cnt--)
> 	 gtk_widget_show( GTK_WIDGET(entry[cnt]) );
>    } else {
>       while(cnt--)
> 	 gtk_widget_hide( GTK_WIDGET(entry[cnt]) );
>       
>       /* force size recomutation if embedded in paned */
>       parent = GTK_WIDGET(GTK_WIDGET(entry[0])->parent)->parent;
>       if(parent)
> 	 gtk_paned_set_position(GTK_PANED(parent), -1);
>    }
>    return TRUE;
> }
> 
> static gint toggle_to_cb (GtkWidget * widget, BalsaSendmsg *bsmsg)
> {return toggle_entry(bsmsg->to, MENU_TOGGLE_TO_POS,3); }
> 
> static gint toggle_from_cb (GtkWidget * widget, BalsaSendmsg *bsmsg)
> {return toggle_entry(bsmsg->from, MENU_TOGGLE_FROM_POS,3); }
> 
> static gint toggle_subject_cb (GtkWidget * widget, BalsaSendmsg *bsmsg)
> {return toggle_entry(bsmsg->subject, MENU_TOGGLE_SUBJECT_POS,2); }
> 
> static gint toggle_cc_cb (GtkWidget * widget, BalsaSendmsg *bsmsg)
> {return toggle_entry(bsmsg->cc, MENU_TOGGLE_CC_POS,3); }
> 
> static gint toggle_bcc_cb (GtkWidget * widget, BalsaSendmsg *bsmsg)
> {return toggle_entry(bsmsg->bcc,  MENU_TOGGLE_BCC_POS,3); }
> static gint toggle_fcc_cb (GtkWidget * widget, BalsaSendmsg *bsmsg)
> {return toggle_entry(bsmsg->fcc, MENU_TOGGLE_FCC_POS,2); }
> static gint toggle_attachments_cb (GtkWidget * widget, BalsaSendmsg *bsmsg)
> { 
>    return toggle_entry(bsmsg->attachments, MENU_TOGGLE_ATTACHMENTS_POS,4);
> }
> 
> /* note that hiding the entries must be done seperately */
> static void set_menus(BalsaSendmsg *msg)
> {
>    unsigned i;
>    gtk_check_menu_item_set_active(
>       GTK_CHECK_MENU_ITEM(view_menu[MENU_TOGGLE_TO_POS].widget), TRUE );
> 
>    gtk_check_menu_item_set_active(
>       GTK_CHECK_MENU_ITEM(view_menu[MENU_TOGGLE_FROM_POS].widget), FALSE);
>    toggle_entry(msg->from,  MENU_TOGGLE_FROM_POS,3); 
> 
>    gtk_check_menu_item_set_active(
>       GTK_CHECK_MENU_ITEM(view_menu[MENU_TOGGLE_SUBJECT_POS].widget), TRUE );
> 
>    gtk_check_menu_item_set_active(
>       GTK_CHECK_MENU_ITEM(view_menu[MENU_TOGGLE_CC_POS].widget), TRUE );
> 
>    gtk_check_menu_item_set_active(
>       GTK_CHECK_MENU_ITEM(view_menu[MENU_TOGGLE_BCC_POS].widget), FALSE );
>    toggle_entry(msg->bcc,  MENU_TOGGLE_BCC_POS,3); 
> 
>    gtk_check_menu_item_set_active(
>       GTK_CHECK_MENU_ITEM(view_menu[MENU_TOGGLE_FCC_POS].widget), FALSE );
>    toggle_entry(msg->fcc,  MENU_TOGGLE_BCC_POS,2); 
> 
>    gtk_check_menu_item_set_active(
>       GTK_CHECK_MENU_ITEM(view_menu[MENU_TOGGLE_ATTACHMENTS_POS].widget),
>       FALSE);
>    toggle_entry(msg->attachments,  MENU_TOGGLE_ATTACHMENTS_POS,4); 
> 
>    /* this should be read from the preferences set up. If not found, 
>       set to the 0th set.
>    */
>    i = sizeof(iso_charset_names)/sizeof(iso_charset_names[0])-1;
>    while( i>0 && g_strcasecmp (iso_charset_names[i],balsa_app.charset) !=0)
>       i--;
> 
>    if(i==0) 
>       iso_font_set(msg, 1, 0);
>    else
>       gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(
> 	 iso_charset_menu[i].widget), TRUE);
>    msg->charset_idx = i;
> }
> 
> /* hardcoded charset set :
>    text is the GtkText message edit widget, code is the iso-8859 character 
>    set encoding and pos is the menu position.
>    gtk_text_set_point doesn't work.
>    gtk_text_get_point doesn't work if the cursor pointer position was changed
>    by a mouse click
> */
> 
> static gint iso_font_set(BalsaSendmsg *msg, gint code, gint idx) {
> static const char base_mask[] = 
>    "-*-fixed-medium-r-normal--14-*-*-*-c-*-iso8859";
>    guint point, txt_len;
>    gchar* str;
>    /* ten extra characters for the code only is more than sufficent */
>    gchar font_name[sizeof(base_mask)+10]; 
>    
>    msg->charset_idx = idx;
> 
>    if( ! GTK_CHECK_MENU_ITEM(iso_charset_menu[idx].widget)->active)
>       return TRUE;
>    
>    g_snprintf(font_name,sizeof(font_name),"%s-%d",base_mask,code);
>    
>    if(msg->font) gdk_font_unref(msg->font);
> 
>    if( !( msg->font = gdk_font_load (font_name)) ) {
>       printf("Cannot find fond: %s\n", font_name);
>       return TRUE;
>    }
>    if(balsa_app.debug) 
>       fprintf(stderr,"loaded font with mask: %s\n", font_name);
> 
>    gtk_text_freeze( GTK_TEXT(msg->text) );
>    point   = gtk_editable_get_position( GTK_EDITABLE(msg->text) ); 
>    txt_len = gtk_text_get_length( GTK_TEXT(msg->text) );
>    str     = gtk_editable_get_chars( GTK_EDITABLE(msg->text), 0, txt_len);
>    
>    gtk_text_set_point( GTK_TEXT(msg->text), 0);
>    gtk_text_forward_delete ( GTK_TEXT(msg->text), txt_len); 
>    
>    gtk_text_insert(GTK_TEXT(msg->text), msg->font, NULL, NULL, str, txt_len);
>    g_free(str);
>    gtk_text_thaw( GTK_TEXT(msg->text) );
> 
>    gtk_editable_set_position( GTK_EDITABLE(msg->text), point);
>    return FALSE;
> }
> 
> static gint iso_1_cb(GtkWidget* widget, BalsaSendmsg *bsmsg)
> {return iso_font_set(bsmsg,  1, ISO_CHARSET_1_POS); }
> static gint iso_15_cb(GtkWidget* widget, BalsaSendmsg *bsmsg)
> {return iso_font_set(bsmsg, 15, ISO_CHARSET_15_POS); }
> static gint iso_2_cb(GtkWidget* widget, BalsaSendmsg *bsmsg)
> {return iso_font_set(bsmsg,  2, ISO_CHARSET_2_POS); }
> static gint iso_3_cb(GtkWidget* widget, BalsaSendmsg *bsmsg)
> {return iso_font_set(bsmsg,  3, ISO_CHARSET_3_POS); }
> static gint iso_5_cb(GtkWidget* widget, BalsaSendmsg *bsmsg)
> {return iso_font_set(bsmsg,  5, ISO_CHARSET_5_POS); }
> static gint iso_8_cb(GtkWidget* widget, BalsaSendmsg *bsmsg)
> {return iso_font_set(bsmsg,  8, ISO_CHARSET_8_POS); }
> static gint iso_9_cb(GtkWidget* widget, BalsaSendmsg *bsmsg)
> {return iso_font_set(bsmsg,  9, ISO_CHARSET_9_POS); }
Index: src/sendmsg-window.h
===================================================================
RCS file: /cvs/gnome/balsa/src/sendmsg-window.h,v
retrieving revision 1.15
diff -r1.15 sendmsg-window.h
1d0
< 
28,50c27,51
< 
<   typedef enum
<     {
<       SEND_NORMAL,
<       SEND_REPLY,
<       SEND_REPLY_ALL,
<       SEND_FORWARD,
<       SEND_CONTINUE
<     }
<   SendType;
< 
< 
<   typedef struct _BalsaSendmsg BalsaSendmsg;
< 
<   struct _BalsaSendmsg
<     {
<       GtkWidget *window;
<       GtkWidget *to, *from, *subject, *cc, *bcc, *fcc;
<       GtkWidget *attachments;
<       GtkWidget *text;
<       Message *orig_message;
<       SendType type;
<     };
---
>    
>    typedef enum
>    {
>       SEND_NORMAL,              /* initialized by Compose */
>       SEND_REPLY,               /* by Reply               */
>       SEND_REPLY_ALL,           /* by Reply All           */
>       SEND_FORWARD,             /* by Forward             */
>       SEND_CONTINUE             /* by Continue postponed  */
>    }
>    SendType;
>    
>    
>    typedef struct _BalsaSendmsg BalsaSendmsg;
>    
>    struct _BalsaSendmsg
>    {
> 	 GtkWidget *window;
> 	 GtkWidget* to[3], *from[3], *subject[2], *cc[3], *bcc[3], *fcc[3];
> 	 GtkWidget *attachments[4];
> 	 GtkWidget *text;
> 	 GdkFont   *font;
> 	 Message *orig_message;
> 	 SendType type;
> 	 guint charset_idx;
>    };
53c54
< 
---
>    


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