comparison src/gtkconv.c @ 10229:9aa0b6d11bbf

[gaim-migrate @ 11364] This is a heavily warmenhoved patch from Alceste Scalas. Here's what it changes: If the user drags an image file into the buddy list or conversation, it presents three options (when applicable): Set as buddy icon - sets this image to be the buddy icon for this buddy Send image file - Initiates a file transfer to send this image. Insert in message - Inserts in the gtkimhtml for use as an IM image. If the user drags a .desktop web link, it will insert a hyperlink in the conversation. All other types of .desktop files fail with an error dialog. If anyone can think of better ways to handle any of them, let me know. This also happens to implement gaim_request_choice, which had previously been unimplemented. committer: Tailor Script <tailor@pidgin.im>
author Sean Egan <seanegan@gmail.com>
date Mon, 22 Nov 2004 02:57:34 +0000
parents ef7f9e69f03e
children a66cf83552dc
comparison
equal deleted inserted replaced
10228:37c411c8cde3 10229:9aa0b6d11bbf
4363 if (protocol != NULL) g_free(protocol); 4363 if (protocol != NULL) g_free(protocol);
4364 4364
4365 gtk_drag_finish(dc, TRUE, (dc->action == GDK_ACTION_MOVE), t); 4365 gtk_drag_finish(dc, TRUE, (dc->action == GDK_ACTION_MOVE), t);
4366 } 4366 }
4367 else if (sd->target == gdk_atom_intern("text/uri-list", FALSE)) { 4367 else if (sd->target == gdk_atom_intern("text/uri-list", FALSE)) {
4368 GList *tmp; 4368 if (gaim_conversation_get_type(conv) == GAIM_CONV_IM)
4369 GList *files = gaim_uri_list_extract_filenames(sd->data); 4369 gaim_dnd_file_manage(sd, gaim_conversation_get_account(conv), gaim_conversation_get_name(conv));
4370 for(tmp = files; tmp != NULL ; tmp = g_list_next(tmp)) {
4371 gchar *filename = tmp->data;
4372 /* XXX - Make ft API support creating a transfer with more than one file */
4373 if (g_file_test(filename, G_FILE_TEST_EXISTS)
4374 && !g_file_test(filename, G_FILE_TEST_IS_DIR)
4375 && gaim_conversation_get_type(conv) == GAIM_CONV_IM) {
4376 serv_send_file(gaim_conversation_get_gc(conv),
4377 gaim_conversation_get_name(conv), filename);
4378 }
4379 g_free(filename);
4380 }
4381 g_list_free(files);
4382 /* XXX - Attempt to load this file into gdk_pixbuf, or otherwise determine if it is an image. If it is, offer
4383 * the choice of a) sending this file b) inserting this file as an IM image or c) setting this file as a custom
4384 * buddy icon for this buddy */
4385 gtk_drag_finish(dc, TRUE, (dc->action == GDK_ACTION_MOVE), t); 4370 gtk_drag_finish(dc, TRUE, (dc->action == GDK_ACTION_MOVE), t);
4386 } 4371 }
4387 else 4372 else
4388 gtk_drag_finish(dc, FALSE, FALSE, t); 4373 gtk_drag_finish(dc, FALSE, FALSE, t);
4389 } 4374 }