Re: Patches



On 31 Jan, David Pickens wrote:
> I haven't yet had a chance to try the patch to change the composition
> window, but it sounds nice -- I'll do that as soon as possible, if someone
> hasn't beaten me there.

Before you start, I will send you updaded patch with some bug fixes:
among others, the original select_icon handler did not handle properly
case when the event argument is NULL. It can happen so according to the
Gtk+ documentation:

/* 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.

Regards,

Pawel


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
52a53,61
> 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 *);
> 
75c84,85
<   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),
77c87,88
<   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),
79c90,91
<   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),
82c94,95
<   GNOMEUIINFO_ITEM_STOCK (N_ ("Spelling"), N_ ("Check Spelling"), NULL, GNOME_STOCK_PIXMAP_SPELLCHECK),
---
>   GNOMEUIINFO_ITEM_STOCK (N_ ("Spelling"), N_ ("Check Spelling"), 
> 			  NULL, GNOME_STOCK_PIXMAP_SPELLCHECK),
84c97,98
<   GNOMEUIINFO_ITEM_STOCK (N_ ("Print"), N_ ("Print"), NULL, GNOME_STOCK_PIXMAP_PRINT),
---
>   GNOMEUIINFO_ITEM_STOCK (N_ ("Print"), N_ ("Print"), 
> 			  NULL, GNOME_STOCK_PIXMAP_PRINT),
87c101,102
<   GNOMEUIINFO_ITEM_STOCK (N_ ("Cancel"), N_ ("Cancel"), close_window, GNOME_STOCK_PIXMAP_CLOSE),
---
>   GNOMEUIINFO_ITEM_STOCK (N_ ("Cancel"), N_ ("Cancel"), 
> 			  close_window, GNOME_STOCK_PIXMAP_CLOSE),
111a127,174
> static GnomeUIInfo view_menu[] =
> {
> #define MENU_TOGGLE_FROM_POS 0
>   {
>      GNOME_APP_UI_TOGGLEITEM, N_ ("_From"), NULL,
>     toggle_from_cb, NULL,
>     NULL, GNOME_APP_PIXMAP_NONE, NULL , GDK_VoidSymbol, 0, NULL
>   },
> #define MENU_TOGGLE_TO_POS 1
>   {
>      GNOME_APP_UI_TOGGLEITEM, N_ ("_To"), NULL,
>     toggle_to_cb, NULL,
>     NULL, GNOME_APP_PIXMAP_NONE, NULL , GDK_VoidSymbol, 0, NULL
>   },
> #define MENU_TOGGLE_SUBJECT_POS 2
>   {
>      GNOME_APP_UI_TOGGLEITEM, N_ ("_Subject"), NULL,
>     toggle_subject_cb, NULL,
>     NULL, GNOME_APP_PIXMAP_NONE, NULL , GDK_VoidSymbol, 0, NULL
>   },
> #define MENU_TOGGLE_CC_POS 3
>   {
>      GNOME_APP_UI_TOGGLEITEM, N_ ("_Cc"), NULL,
>     toggle_cc_cb, NULL,
>     NULL, GNOME_APP_PIXMAP_NONE, NULL , GDK_VoidSymbol, 0, NULL
>   },
> #define MENU_TOGGLE_BCC_POS 4
>   {
>      GNOME_APP_UI_TOGGLEITEM, N_ ("_Bcc"), NULL,
>     toggle_bcc_cb, NULL,
>     NULL, GNOME_APP_PIXMAP_NONE, NULL , GDK_VoidSymbol, 0, NULL
>   },
> #define MENU_TOGGLE_FCC_POS 5
>   {
>      GNOME_APP_UI_TOGGLEITEM, N_ ("_Fcc"), NULL,
>     toggle_fcc_cb, NULL,
>     NULL, GNOME_APP_PIXMAP_NONE, NULL , GDK_VoidSymbol, 0, NULL
>   },
> #define MENU_TOGGLE_ATTACHMENTS_POS 6
>   {
>      GNOME_APP_UI_TOGGLEITEM, N_ ("_Attachments"), NULL,
>     toggle_attachments_cb, NULL,
>     NULL, GNOME_APP_PIXMAP_NONE, NULL , GDK_VoidSymbol, 0, NULL
>   },
>   GNOMEUIINFO_END
> };
> 
> 
114a178
>   GNOMEUIINFO_SUBTREE(N_("_Show"), view_menu),
132,137c196,201
<   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->to[1]);
>   gtk_widget_destroy (bsm->from[1]);
>   gtk_widget_destroy (bsm->subject[1]);
>   gtk_widget_destroy (bsm->cc[1]);
>   gtk_widget_destroy (bsm->bcc[1]);
>   gtk_widget_destroy (bsm->fcc[1]);
139a204
>   
165a231,239
> /* 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.
> */
> 
167c241,242
< select_attachment (GnomeIconList * ilist, gint num, GdkEventButton * event)
---
> select_attachment (GnomeIconList * ilist, gint num, GdkEventButton * event,
> 		   gpointer data)
169,173c244,248
< 
<   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);
181a257
>   printf("attachment icon position: %s\n",pix);
197c273
< 						"Sadly, this means you cannot attach any files.\n"), 
---
> 						"This means you cannot attach any files.\n"), 
264c340
<   iconlist = GNOME_ICON_LIST (bsm->attachments);
---
>   iconlist = GNOME_ICON_LIST (bsm->attachments[1]);
331,332c407,408
<   GtkWidget *label;
<   GtkWidget *button;
---
>   //GtkWidget *label;
>   //GtkWidget *button;
340,342c416,418
<   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,346c421,422
<   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,352c425,428
<   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]),
354c430
<   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,358c432,435
<   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",
360c437
<   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,367c442,444
<   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,371c447,448
<   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,374c450,451
<   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,379c453,456
<   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]),
381c458
<   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,387c462,464
<   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,391c467,468
<   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,397c472,474
<   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,401c477,478
<   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,407c481,484
<   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]),
409c486
<   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,413c488,491
<   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",
415c493
<   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,422c498,500
<   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,426c503,504
<   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,432c507,510
<   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]),
434c512
<   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,438c514,517
<   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",
440c519
<   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,447c524,526
<   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,452c529,531
<   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);
467c546
<     gtk_combo_set_popdown_strings (GTK_COMBO (msg->fcc), glist);
---
>     gtk_combo_set_popdown_strings (GTK_COMBO (msg->fcc[1]), glist);
469c548
<   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,475c552,554
<   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,485c563,564
<   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",
487c566
<   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,
491c570
<   gtk_widget_set_usize (msg->attachments, -1, 50);
---
>   gtk_widget_set_usize (msg->attachments[1], -1, 50);
495c574
<   gtk_container_add (GTK_CONTAINER (sw), msg->attachments);
---
>   gtk_container_add (GTK_CONTAINER (sw), msg->attachments[1]);
499c578,579
< 		    GTK_FILL | GTK_EXPAND, GTK_FILL | GTK_EXPAND | GTK_SHRINK, 0, 0);
---
> 		    GTK_FILL | GTK_EXPAND, GTK_FILL | GTK_EXPAND | GTK_SHRINK,
> 		    0, 0);
501c581
<   gtk_signal_connect (GTK_OBJECT (msg->attachments), "select_icon",
---
>   gtk_signal_connect (GTK_OBJECT (msg->attachments[1]), "select_icon",
505,506c585,593
<   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) );
>   set_menus(msg);
523c610
<   colormap = gtk_widget_get_colormap (GTK_WIDGET (msg->attachments));
---
>   colormap = gtk_widget_get_colormap (GTK_WIDGET (msg->attachments[1]));
544a632,633
>   gtk_widget_show_all( GTK_WIDGET(table) );
> 
558d646
< 
559a648
> 
585,586c674,675
<   msg->window = window;
<   msg->type = type;
---
>   msg->window  = window;
>   msg->type    = type;
590a680,682
>   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,593c684
<   gtk_paned_add1 (GTK_PANED(paned),
< 		      create_info_pane (msg, type));
---
>   gtk_paned_add1 (GTK_PANED(paned), create_info_pane (msg, type));
609c700
<       gtk_entry_set_text (GTK_ENTRY (msg->to), tmp);
---
>       gtk_entry_set_text (GTK_ENTRY (msg->to[1]), tmp);
616,617c707,709
<     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);
624c716
<       gtk_entry_set_text (GTK_ENTRY (msg->bcc), balsa_app.bcc);
---
>       gtk_entry_set_text (GTK_ENTRY (msg->bcc[1]), balsa_app.bcc);
630c722
<       gtk_entry_set_text (GTK_ENTRY(GTK_COMBO(msg->fcc)->entry),
---
>       gtk_entry_set_text (GTK_ENTRY(GTK_COMBO(msg->fcc[1])->entry),
691c783
<       gtk_entry_set_text (GTK_ENTRY (msg->subject), newsubject);
---
>       gtk_entry_set_text (GTK_ENTRY (msg->subject[1]), newsubject);
701c793
<       gtk_entry_set_text (GTK_ENTRY (msg->to), tmp);
---
>       gtk_entry_set_text (GTK_ENTRY (msg->to[1]), tmp);
706c798
<       gtk_entry_set_text (GTK_ENTRY (msg->cc), tmp);
---
>       gtk_entry_set_text (GTK_ENTRY (msg->cc[1]), tmp);
711c803
<       gtk_entry_set_text (GTK_ENTRY (msg->bcc), tmp);
---
>       gtk_entry_set_text (GTK_ENTRY (msg->bcc[1]), tmp);
715c807
<       gtk_entry_set_text (GTK_ENTRY (msg->subject), message->subject);
---
>       gtk_entry_set_text (GTK_ENTRY (msg->subject[1]), message->subject);
723c815
<       gtk_entry_set_text (GTK_ENTRY (msg->cc), tmp);
---
>       gtk_entry_set_text (GTK_ENTRY (msg->cc[1]), tmp);
728c820
< 	  gtk_entry_append_text (GTK_ENTRY (msg->cc), ", ");
---
> 	  gtk_entry_append_text (GTK_ENTRY (msg->cc[1]), ", ");
731c823
< 	  gtk_entry_append_text (GTK_ENTRY (msg->cc), tmp);
---
> 	  gtk_entry_append_text (GTK_ENTRY (msg->cc[1]), tmp);
740,742d831
<   gnome_app_create_menus_with_data (GNOME_APP (window), main_menu, msg);
<   gnome_app_create_toolbar_with_data (GNOME_APP (window), main_toolbar, msg);
< 
785,786c874,875
< 	    gtk_text_insert (GTK_TEXT (msg->text), NULL, NULL, NULL, str->str, strlen (str->str));
< 
---
> 	    gtk_text_insert (GTK_TEXT (msg->text), NULL, NULL, NULL, 
> 			     str->str, strlen (str->str));
791c880
< 	    rbdy = content2reply (message, balsa_app.quote_str);	/* arp */
---
> 	    rbdy = content2reply (message, balsa_app.quote_str);     /* arp */
793c882
< 	    rbdy = content2reply (message, NULL);	/* arp */
---
> 	    rbdy = content2reply (message, NULL);	             /* arp */
795c884,885
< 	  gtk_text_insert (GTK_TEXT (msg->text), NULL, NULL, NULL, rbdy->str, strlen (rbdy->str));
---
> 	  gtk_text_insert (GTK_TEXT (msg->text), NULL, NULL, NULL, rbdy->str, 
> 			   strlen (rbdy->str));
803c893,894
<      if ( ((type == SEND_REPLY || type == SEND_REPLY_ALL) && balsa_app.sig_whenreply) ||
---
>      if ( ((type == SEND_REPLY || type == SEND_REPLY_ALL) && 
> 	   balsa_app.sig_whenreply) ||
806c897,898
< 	      gtk_text_insert (GTK_TEXT (msg->text), NULL, NULL, NULL, signature, strlen (signature));
---
> 	gtk_text_insert (GTK_TEXT (msg->text), NULL, NULL, NULL, 
> 			 signature, strlen (signature));
824,825c916,919
<   /* display the window */
<   gtk_widget_show_all (window);
---
>   /* display the window, but some stuff shold be hidden? */
> 
>   gtk_widget_show (window);
> 
856c950
<   tmp = gtk_entry_get_text (GTK_ENTRY (bsmsg->to));
---
>   tmp = gtk_entry_get_text (GTK_ENTRY (bsmsg->to[1]));
883c977,978
<   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,887c980,985
<   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])));
889c987
<   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));
935c1033
<     for (i = 0; i < GNOME_ICON_LIST (bsmsg->attachments)->icons; i++)
---
>     for (i = 0; i < GNOME_ICON_LIST (bsmsg->attachments[1])->icons; i++)
940c1038,1039
< 	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);
981c1080
<   tmp = gtk_entry_get_text (GTK_ENTRY (bsmsg->to));
---
>   tmp = gtk_entry_get_text (GTK_ENTRY (bsmsg->to[1]));
1008c1107,1108
<   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,1012c1110,1115
<   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])));
1030c1133
<     for (i = 0; i < GNOME_ICON_LIST (bsmsg->attachments)->icons; i++)
---
>     for (i = 0; i < GNOME_ICON_LIST (bsmsg->attachments[1])->icons; i++)
1034c1137
< 	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);
1044c1147
<                                GTK_ENTRY(GTK_COMBO(bsmsg->fcc)->entry)));
---
>                                GTK_ENTRY(GTK_COMBO(bsmsg->fcc[1])->entry)));
1047c1150
<        GTK_ENTRY(GTK_COMBO(bsmsg->fcc)->entry)));
---
>        GTK_ENTRY(GTK_COMBO(bsmsg->fcc[1])->entry)));
1060a1164
> 
1148a1253,1322
> 
> 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)
> {
>    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); 
> }
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
45,46c45,46
<       GtkWidget *to, *from, *subject, *cc, *bcc, *fcc;
<       GtkWidget *attachments;
---
>       GtkWidget* to[3], *from[3], *subject[2], *cc[3], *bcc[3], *fcc[3];
>       GtkWidget *attachments[4];


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