Re: Attaching and quoting messages



On 2001.10.09 07:15 Toralf Lund wrote:

> And here it is! The attached patch (against today's CVS version, as 
> usual)
> will insert 3 new menu items; "Include Message(s)" and "Attach 
> Messages(s)
> under "File", and "Quote Message(s)" under "Edit", where the "Quote"
> version is different from the "Include" one in that reply style quote
> characters are inserted. I'm not sure if that's the best way of
> structuring it, but the menu items and quote types could be easily 
> changed.
> 
> Also, I'm not too happy with the term "attach" (neither here nor in 
> "Forward
> attached") as the parts included are explicitly marked as "inline" 
> (i.e.
> we're explicitly telling the receiver they are NOT attachments - 
> refer to
> RFC 2183), but I couldn't think of a better alternative. I guess 
> "Include
> Message(s) as Separate Part(s)" would have been more accurate, but 
> it's
> somewhat long-winded.
> 
> --
> - Toralf

and here's the drag'n'drop!  This patch depends on Toralf's.  It 
implements dragging messages from the index tree into a 
sendmsg-window--any part of the window except the address widgets 
(From, To, Cc, Bcc)--where they become inline parts (``attachments'').

The patch was made with `diff -b...', and doesn't properly change the 
indentation of some existing code, but that kept it smaller and more 
readable.

Peter
diff -bNur balsa-include/src/sendmsg-window.c balsa-attach/src/sendmsg-window.c
--- balsa-include/src/sendmsg-window.c	Tue Oct  9 18:36:59 2001
+++ balsa-attach/src/sendmsg-window.c	Tue Oct  9 18:53:06 2001
@@ -126,11 +126,13 @@
 
 /* Standard DnD types */
 enum {
+    TARGET_MESSAGES,
     TARGET_URI_LIST,
     TARGET_EMAIL,
 };
 
 static GtkTargetEntry drop_types[] = {
+    {"x-application/x-message-list", GTK_TARGET_SAME_APP, TARGET_MESSAGES},
     {"text/uri-list", 0, TARGET_URI_LIST}
 };
 
@@ -1021,6 +1023,15 @@
 		GtkSelectionData * selection_data,
 		guint info, guint32 time, BalsaSendmsg * bsmsg)
 {
+    if (balsa_app.debug)
+        printf("attachments_add: info %d\n", info);
+    if (info == TARGET_MESSAGES) {
+        LibBalsaMessage **message_array =
+            (LibBalsaMessage **) selection_data->data;
+
+        while (*message_array)
+            attach_message(bsmsg, *message_array++);
+    } else { /* ??? if (info == TARGET_URI_LIST) */
     GList *names, *l;
 
     names = gnome_uri_list_extract_filenames(selection_data->data);
@@ -1036,6 +1047,7 @@
     gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(
 	bsmsg->view_checkitems[MENU_TOGGLE_ATTACHMENTS_POS]), TRUE);
     bsmsg->update_config = TRUE;
+    }
 }
 
 /* to_add - e-mail (To, From, Cc, Bcc) field D&D callback */


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