changeset 21279:47118f6062e9

Enable auto-complete in the pounce dialog.
author Sadrul Habib Chowdhury <imadil@gmail.com>
date Mon, 05 Nov 2007 18:29:20 +0000
parents ebb46dea479a
children cfbff4a9b2b6
files finch/gntpounce.c
diffstat 1 files changed, 13 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/finch/gntpounce.c	Wed Oct 31 18:13:53 2007 +0000
+++ b/finch/gntpounce.c	Mon Nov 05 18:29:20 2007 +0000
@@ -168,6 +168,17 @@
 }
 
 static void
+setup_buddy_list_suggestion(GntEntry *entry, gboolean offline)
+{
+	PurpleBlistNode *node = purple_blist_get_root();
+	for (; node; node = purple_blist_node_next(node, offline)) {
+		if (!PURPLE_BLIST_NODE_IS_BUDDY(node))
+			continue;
+		gnt_entry_add_suggest(entry, purple_buddy_get_name((PurpleBuddy*)node));
+	}
+}
+
+static void
 save_pounce_cb(GntWidget *w, PurpleGntPounceDialog *dialog)
 {
 	const char *name;
@@ -360,6 +371,8 @@
 	dialog->buddy_entry = gnt_entry_new(NULL);
 	gnt_box_add_widget(GNT_BOX(hbox), dialog->buddy_entry);
 
+	setup_buddy_list_suggestion(GNT_ENTRY(dialog->buddy_entry), TRUE);
+
 	gnt_box_add_widget(GNT_BOX(window), hbox);
 
 	if (cur_pounce != NULL) {