diff console/gntblist.c @ 15640:35fa1d1c4ef2

Patch from Richard 'wabz' Nelson to add file-transfer ui. Amazing stuff\!
author Sadrul Habib Chowdhury <imadil@gmail.com>
date Thu, 15 Feb 2007 22:43:24 +0000
parents 704d40050800
children d318c6672011
line wrap: on
line diff
--- a/console/gntblist.c	Thu Feb 15 19:25:28 2007 +0000
+++ b/console/gntblist.c	Thu Feb 15 22:43:24 2007 +0000
@@ -37,15 +37,16 @@
 #include "gntbox.h"
 #include "gntcombobox.h"
 #include "gntentry.h"
+#include "gntft.h"
 #include "gntlabel.h"
 #include "gntline.h"
 #include "gntmenu.h"
 #include "gntmenuitem.h"
 #include "gntmenuitemcheck.h"
+#include "gntpounce.h"
 #include "gnttree.h"
 #include "gntutils.h"
 #include "gntwindow.h"
-#include "gntpounce.h"
 
 #include "gntblist.h"
 #include "gntconv.h"
@@ -797,6 +798,24 @@
 }
 
 static void
+gg_blist_menu_send_file_cb(GaimBuddy *buddy, GaimBlistNode *selected)
+{
+	serv_send_file(buddy->account->gc, buddy->name, NULL);
+}
+
+static void
+gg_blist_pounce_node_cb(GaimBlistNode *node, GaimBlistNode *selected)
+{
+	GaimBuddy *b;
+	if (GAIM_BLIST_NODE_IS_CONTACT(node))
+		b = gaim_contact_get_priority_buddy((GaimContact *)node);
+	else
+		b = (GaimBuddy *)node;
+	gg_pounce_editor_show(b->account, b->name, NULL);
+}
+
+
+static void
 create_buddy_menu(GntMenu *menu, GaimBuddy *buddy)
 {
 	GaimPluginProtocolInfo *prpl_info;
@@ -808,18 +827,17 @@
 				GAIM_CALLBACK(gg_blist_get_buddy_info_cb), buddy);
 	}
 
-#if 0
-	add_custom_action(tree, _("Add Buddy Pounce"),
-			GAIM_CALLBACK(gg_blist_add_buddy_pounce_cb)), buddy);
+	add_custom_action(menu, _("Add Buddy Pounce"),
+			GAIM_CALLBACK(gg_blist_pounce_node_cb), buddy);
 
 	if (prpl_info && prpl_info->send_file)
 	{
 		if (!prpl_info->can_receive_file ||
 			prpl_info->can_receive_file(buddy->account->gc, buddy->name))
-			add_custom_action(tree, _("Send File"),
-					GAIM_CALLBACK(gg_blist_show_file_cb)), buddy);
+			add_custom_action(menu, _("Send File"),
+					GAIM_CALLBACK(gg_blist_menu_send_file_cb), buddy);
 	}
-
+#if 0
 	add_custom_action(tree, _("View Log"),
 			GAIM_CALLBACK(gg_blist_view_log_cb)), buddy);
 #endif
@@ -884,17 +902,6 @@
 }
 
 static void
-gg_blist_pounce_node_cb(GaimBlistNode *node, GaimBlistNode *selected)
-{
-	GaimBuddy *b;
-	if (GAIM_BLIST_NODE_IS_CONTACT(node))
-		b = gaim_contact_get_priority_buddy((GaimContact *)node);
-	else
-		b = (GaimBuddy *)node;
-	gg_pounce_editor_show(b->account, b->name, NULL);
-}
-
-static void
 gg_blist_rename_node_cb(GaimBlistNode *node, GaimBlistNode *selected)
 {
 	const char *name = NULL;
@@ -1137,8 +1144,6 @@
 		}
 
 		if (GAIM_BLIST_NODE_IS_BUDDY(node) || GAIM_BLIST_NODE_IS_CONTACT(node)) {
-			add_custom_action(GNT_MENU(context), _("Add Buddy Pounce"),
-					GAIM_CALLBACK(gg_blist_pounce_node_cb), node);
 			add_custom_action(GNT_MENU(context), _("Toggle Tag"),
 					GAIM_CALLBACK(gg_blist_toggle_tag_buddy), node);
 		}