diff src/gtkconv.c @ 4702:cb5b23dfd82b

[gaim-migrate @ 5013] Started on buddy list drag-n-drop. This will be useful mostly for editing the buddy list but I decided to sleep before doing that. You can drag a buddy into a conversation window now, though. Which is cool. But, even that's not complete yet. I'll have fun tomorrow. committer: Tailor Script <tailor@pidgin.im>
author Sean Egan <seanegan@gmail.com>
date Tue, 11 Mar 2003 07:57:53 +0000
parents 69b19e132df0
children 0c85078fd371
line wrap: on
line diff
--- a/src/gtkconv.c	Tue Mar 11 03:59:42 2003 +0000
+++ b/src/gtkconv.c	Tue Mar 11 07:57:53 2003 +0000
@@ -3198,10 +3198,16 @@
 
 static void
 conv_dnd_recv(GtkWidget *widget, GdkDragContext *dc, guint x, guint y,
-			  GtkSelectionData *sd, guint info, guint t, gpointer data)
+			  GtkSelectionData *sd, guint info, guint t)
 {
-	do_error_dialog("MWAHAHAHA! I AM A TROLL! I AM GOING TO EAT YOU!",
-					NULL, GAIM_WARNING);
+	if (sd->target == gdk_atom_intern("GAIM_BUDDY", FALSE)) {
+		struct buddy *b = NULL;
+		memcpy(&b, sd->data, sizeof(b));
+		gaim_conversation_new(GAIM_CONV_IM, b->account, b->name);
+	}
+
+		/* do_error_dialog("MWAHAHAHA! I AM A TROLL! I AM GOING TO EAT YOU!",
+		   NULL, GAIM_WARNING); */
 }
 
 /**************************************************************************
@@ -3335,8 +3341,9 @@
 static const GtkTargetEntry te[] =
 {
 	{"text/plain", 0, 0},
-	{"text/uri-list", 1, 0},
-	{"STRING", 2, 0}
+	{"text/uri-list", 0, 1},
+	{"GAIM_BUDDY", 0, 2},
+	{"STRING", 0, 3}
 };
 
 static void
@@ -3407,8 +3414,7 @@
 						  GDK_ACTION_COPY);
 		gtk_drag_dest_set(gtkconv->imhtml,
 						  GTK_DEST_DEFAULT_MOTION |
-						  GTK_DEST_DEFAULT_HIGHLIGHT |
-						  GTK_DEST_DEFAULT_DROP,
+				                  GTK_DEST_DEFAULT_DROP,
 						  te, sizeof(te) / sizeof(GtkTargetEntry),
 						  GDK_ACTION_DEFAULT | GDK_ACTION_COPY | GDK_ACTION_MOVE);
 		gtk_drag_dest_set(gtkconv->entry,