add the drop type of mozilla browser link to make composer support to

2003-08-04  Antonio Xu  <antonio.xu@sun.com>

	* e-msg-composer.c (drag_data_received): add the drop type of
	mozilla browser link to make composer support to handle mozilla
	DnD data.  [#47131]

svn path=/trunk/; revision=22077
This commit is contained in:
Antonio Xu
2003-08-04 12:50:11 +00:00
committed by Antonio Xu
parent 5d3d4d0d83
commit 3eb627ba99
2 changed files with 16 additions and 10 deletions

View File

@ -1,3 +1,9 @@
2003-07-31 Antonio Xu <antonio.xu@sun.com>
* e-msg-composer.c (drag_data_received): add the drop type of
mozilla browser link to make composer support to handle mozilla
DnD data. [#47131]
2003-07-28 Antonio Xu <antonio.xu@sun.com>
* e-msg-composer-attachment-bar.c (update): add

View File

@ -122,12 +122,14 @@ static guint signals[LAST_SIGNAL] = { 0 };
enum {
DND_TYPE_MESSAGE_RFC822,
DND_TYPE_TEXT_URI_LIST,
DND_TYPE_NETSCAPE_URL,
DND_TYPE_TEXT_VCARD,
};
static GtkTargetEntry drop_types[] = {
{ "message/rfc822", 0, DND_TYPE_MESSAGE_RFC822 },
{ "text/uri-list", 0, DND_TYPE_TEXT_URI_LIST },
{ "_NETSCAPE_URL", 0, DND_TYPE_NETSCAPE_URL },
{ "text/x-vcard", 0, DND_TYPE_TEXT_VCARD },
};
@ -2554,7 +2556,7 @@ drag_data_received (EMsgComposer *composer, GdkDragContext *context,
int x, int y, GtkSelectionData *selection,
guint info, guint time)
{
char *tmp, *str, *filename, **urls;
char *tmp, *str, **urls;
CamelMimePart *mime_part;
CamelStream *stream;
CamelURL *url;
@ -2572,6 +2574,7 @@ drag_data_received (EMsgComposer *composer, GdkDragContext *context,
camel_object_unref (stream);
break;
case DND_TYPE_TEXT_URI_LIST:
case DND_TYPE_NETSCAPE_URL:
d(printf ("dropping a text/uri-list\n"));
tmp = g_strndup (selection->data, selection->length);
urls = g_strsplit (tmp, "\n", 0);
@ -2589,16 +2592,13 @@ drag_data_received (EMsgComposer *composer, GdkDragContext *context,
if (url == NULL)
continue;
filename = url->path;
url->path = NULL;
if (!strcasecmp (url->protocol, "file"))
e_msg_composer_attachment_bar_attach
(E_MSG_COMPOSER_ATTACHMENT_BAR (composer->attachment_bar),
url->path);
camel_url_free (url);
e_msg_composer_attachment_bar_attach
(E_MSG_COMPOSER_ATTACHMENT_BAR (composer->attachment_bar),
filename);
g_free (filename);
}
}