aboutsummaryrefslogtreecommitdiffstats
path: root/composer
diff options
context:
space:
mode:
authorJeffrey Stedfast <fejj@ximian.com>2001-11-16 05:48:37 +0800
committerJeffrey Stedfast <fejj@src.gnome.org>2001-11-16 05:48:37 +0800
commit8e2b3ae66d616fb0d9ab4708f5a87f27f4683313 (patch)
tree4707e6de36e026c275422c76c9905a2359641567 /composer
parent4b355d91cdba907c0f540715c9920c68d8b3275d (diff)
downloadgsoc2013-evolution-8e2b3ae66d616fb0d9ab4708f5a87f27f4683313.tar
gsoc2013-evolution-8e2b3ae66d616fb0d9ab4708f5a87f27f4683313.tar.gz
gsoc2013-evolution-8e2b3ae66d616fb0d9ab4708f5a87f27f4683313.tar.bz2
gsoc2013-evolution-8e2b3ae66d616fb0d9ab4708f5a87f27f4683313.tar.lz
gsoc2013-evolution-8e2b3ae66d616fb0d9ab4708f5a87f27f4683313.tar.xz
gsoc2013-evolution-8e2b3ae66d616fb0d9ab4708f5a87f27f4683313.tar.zst
gsoc2013-evolution-8e2b3ae66d616fb0d9ab4708f5a87f27f4683313.zip
Allow drag & drop for vcards.
2001-11-11 Jeffrey Stedfast <fejj@ximian.com> * e-msg-composer.c (drag_data_received): Allow drag & drop for vcards. svn path=/trunk/; revision=14727
Diffstat (limited to 'composer')
-rw-r--r--composer/ChangeLog5
-rw-r--r--composer/e-msg-composer.c16
2 files changed, 21 insertions, 0 deletions
diff --git a/composer/ChangeLog b/composer/ChangeLog
index dfd3eff5e6..24be915c07 100644
--- a/composer/ChangeLog
+++ b/composer/ChangeLog
@@ -1,3 +1,8 @@
+2001-11-11 Jeffrey Stedfast <fejj@ximian.com>
+
+ * e-msg-composer.c (drag_data_received): Allow drag & drop for
+ vcards.
+
2001-11-14 Larry Ewing <lewing@ximian.com>
* e-msg-composer.c (create_composer): popup failure dialog if we
diff --git a/composer/e-msg-composer.c b/composer/e-msg-composer.c
index 7ac6c3b770..b545877d42 100644
--- a/composer/e-msg-composer.c
+++ b/composer/e-msg-composer.c
@@ -65,6 +65,8 @@
#include <gal/e-text/e-entry.h>
#include <gtkhtml/gtkhtml.h>
+/*#include <addressbook/backend/ebook/e-card.h>*/
+
#include "widgets/misc/e-charset-picker.h"
#include "camel/camel.h"
@@ -107,11 +109,13 @@ static guint signals[LAST_SIGNAL] = { 0 };
enum {
DND_TYPE_MESSAGE_RFC822,
DND_TYPE_TEXT_URI_LIST,
+ DND_TYPE_TEXT_VCARD,
};
static GtkTargetEntry drop_types[] = {
{ "message/rfc822", 0, DND_TYPE_MESSAGE_RFC822 },
{ "text/uri-list", 0, DND_TYPE_TEXT_URI_LIST },
+ { "text/x-vcard", 0, DND_TYPE_TEXT_VCARD },
};
static const int num_drop_types = sizeof (drop_types) / sizeof (drop_types[0]);
@@ -2083,6 +2087,7 @@ drag_data_received (EMsgComposer *composer, GdkDragContext *context,
guint info, guint time)
{
gchar *tmp, *filename, **filenames;
+ CamelMimePart *mime_part;
CamelStream *stream;
CamelURL *url;
int i;
@@ -2120,6 +2125,17 @@ drag_data_received (EMsgComposer *composer, GdkDragContext *context,
g_free (filenames);
break;
+ case DND_TYPE_TEXT_VCARD:
+ mime_part = camel_mime_part_new ();
+ camel_mime_part_set_content (mime_part, selection->data,
+ selection->length, "text/x-vcard");
+ camel_mime_part_set_disposition (mime_part, "inline");
+
+ e_msg_composer_attachment_bar_attach_mime_part
+ (E_MSG_COMPOSER_ATTACHMENT_BAR (composer->attachment_bar),
+ mime_part);
+
+ camel_object_unref (CAMEL_OBJECT (mime_part));
default:
break;
}