changeset 18577:2a431f30af2a

merge of '2543d569f73fee46d4f4f92b5a5f2245ed4a07db' and '87267767c9fa7f05042d66d4147b0909e3262edb'
author Sadrul Habib Chowdhury <imadil@gmail.com>
date Fri, 20 Jul 2007 21:49:53 +0000
parents 65aef3c97d3a (current diff) 3c634117a7ef (diff)
children acd4ff9ddace dcb1d1af30a1
files
diffstat 4 files changed, 25 insertions(+), 24 deletions(-) [+]
line wrap: on
line diff
--- a/finch/gntblist.c	Fri Jul 20 18:38:24 2007 +0000
+++ b/finch/gntblist.c	Fri Jul 20 21:49:53 2007 +0000
@@ -759,7 +759,7 @@
 }
 
 static void
-chat_components_edit(PurpleChat *chat, PurpleBlistNode *selected)
+chat_components_edit(PurpleBlistNode *selected, PurpleChat *chat)
 {
 	PurpleRequestFields *fields = purple_request_fields_new();
 	PurpleRequestFieldGroup *group = purple_request_field_group_new(NULL);
@@ -820,19 +820,19 @@
 }
 
 static void
-finch_add_buddy(PurpleGroup *grp, PurpleBlistNode *selected)
+finch_add_buddy(PurpleBlistNode *selected, PurpleGroup *grp)
 {
 	purple_blist_request_add_buddy(NULL, NULL, grp ? grp->name : NULL, NULL);
 }
 
 static void
-finch_add_group(PurpleGroup *grp, PurpleBlistNode *selected)
+finch_add_group(PurpleBlistNode *selected, PurpleGroup *grp)
 {
 	purple_blist_request_add_group();
 }
 
 static void
-finch_add_chat(PurpleGroup *grp, PurpleBlistNode *selected)
+finch_add_chat(PurpleBlistNode *selected, PurpleGroup *grp)
 {
 	purple_blist_request_add_chat(NULL, grp, NULL, NULL);
 }
@@ -861,19 +861,19 @@
 }
 
 static void
-finch_blist_get_buddy_info_cb(PurpleBuddy *buddy, PurpleBlistNode *selected)
+finch_blist_get_buddy_info_cb(PurpleBlistNode *selected, PurpleBuddy *buddy)
 {
 	finch_retrieve_user_info(buddy->account->gc, purple_buddy_get_name(buddy));
 }
 
 static void
-finch_blist_menu_send_file_cb(PurpleBuddy *buddy, PurpleBlistNode *selected)
+finch_blist_menu_send_file_cb(PurpleBlistNode *selected, PurpleBuddy *buddy)
 {
 	serv_send_file(buddy->account->gc, buddy->name, NULL);
 }
 
 static void
-finch_blist_pounce_node_cb(PurpleBlistNode *node, PurpleBlistNode *selected)
+finch_blist_pounce_node_cb(PurpleBlistNode *selected, PurpleBlistNode *node)
 {
 	PurpleBuddy *b;
 	if (PURPLE_BLIST_NODE_IS_CONTACT(node))
@@ -971,7 +971,7 @@
 }
 
 static void
-finch_blist_rename_node_cb(PurpleBlistNode *node, PurpleBlistNode *selected)
+finch_blist_rename_node_cb(PurpleBlistNode *selected, PurpleBlistNode *node)
 {
 	const char *name = NULL;
 	char *prompt;
@@ -1056,7 +1056,7 @@
 }
 
 static void
-finch_blist_remove_node_cb(PurpleBlistNode *node, PurpleBlistNode *selected)
+finch_blist_remove_node_cb(PurpleBlistNode *selected, PurpleBlistNode *node)
 {
 	PurpleAccount *account = NULL;
 	char *primary;
@@ -1210,13 +1210,14 @@
 
 	ggblist->context = context = gnt_menu_new(GNT_MENU_POPUP);
 	g_signal_connect(G_OBJECT(context), "destroy", G_CALLBACK(context_menu_destroyed), ggblist);
+	g_signal_connect(G_OBJECT(context), "hide", G_CALLBACK(gnt_widget_destroy), NULL);
 
 	if (!node) {
 		create_group_menu(GNT_MENU(context), NULL);
 		title = g_strdup(_("Buddy List"));
 	} else if (PURPLE_BLIST_NODE_IS_CONTACT(node)) {
-		create_buddy_menu(GNT_MENU(context),
-			purple_contact_get_priority_buddy((PurpleContact*)node));
+		ggblist->cnode = (PurpleBlistNode*)purple_contact_get_priority_buddy((PurpleContact*)node);
+		create_buddy_menu(GNT_MENU(context), (PurpleBuddy*)ggblist->cnode);
 		title = g_strdup(purple_contact_get_alias((PurpleContact*)node));
 	} else if (PURPLE_BLIST_NODE_IS_BUDDY(node)) {
 		PurpleBuddy *buddy = (PurpleBuddy *)node;
--- a/finch/libgnt/gnttree.c	Fri Jul 20 18:38:24 2007 +0000
+++ b/finch/libgnt/gnttree.c	Fri Jul 20 21:49:53 2007 +0000
@@ -804,6 +804,8 @@
 			redraw_tree(tree);
 			g_source_remove(tree->priv->search_timeout);
 			tree->priv->search_timeout = g_timeout_add(SEARCH_TIMEOUT, search_timeout, tree);
+		} else {
+			gnt_bindable_perform_action_key(GNT_BINDABLE(tree), text);
 		}
 		return TRUE;
 	} else if (text[0] == ' ' && text[1] == 0) {
@@ -914,6 +916,7 @@
 	GntTree *tree = GNT_TREE(bindable);
 	if (tree->priv->search)
 		return FALSE;
+	GNT_WIDGET_SET_FLAGS(GNT_WIDGET(tree), GNT_WIDGET_DISABLE_ACTIONS);
 	tree->priv->search = g_string_new(NULL);
 	tree->priv->search_timeout = g_timeout_add(SEARCH_TIMEOUT, search_timeout, tree);
 	return TRUE;
@@ -925,6 +928,7 @@
 	GntTree *tree = GNT_TREE(bindable);
 	if (tree->priv->search == NULL)
 		return FALSE;
+	GNT_WIDGET_UNSET_FLAGS(GNT_WIDGET(tree), GNT_WIDGET_DISABLE_ACTIONS);
 	end_search(tree);
 	redraw_tree(tree);
 	return TRUE;
--- a/finch/libgnt/gntwidget.c	Fri Jul 20 18:38:24 2007 +0000
+++ b/finch/libgnt/gntwidget.c	Fri Jul 20 21:49:53 2007 +0000
@@ -74,15 +74,7 @@
 gnt_widget_dispose(GObject *obj)
 {
 	GntWidget *self = GNT_WIDGET(obj);
-
-	if(!(GNT_WIDGET_FLAGS(self) & GNT_WIDGET_DESTROYING)) {
-		GNT_WIDGET_SET_FLAGS(self, GNT_WIDGET_DESTROYING);
-
-		g_signal_emit(self, signals[SIG_DESTROY], 0);
-
-		GNT_WIDGET_UNSET_FLAGS(self, GNT_WIDGET_DESTROYING);
-	}
-
+	g_signal_emit(self, signals[SIG_DESTROY], 0);
 	parent_class->dispose(obj);
 	GNTDEBUG;
 }
@@ -320,10 +312,12 @@
 {
 	g_return_if_fail(GNT_IS_WIDGET(obj));
 
-	gnt_widget_hide(obj);
-	delwin(obj->window);
-	if(!(GNT_WIDGET_FLAGS(obj) & GNT_WIDGET_DESTROYING))
+	if(!(GNT_WIDGET_FLAGS(obj) & GNT_WIDGET_DESTROYING)) {
+		GNT_WIDGET_SET_FLAGS(obj, GNT_WIDGET_DESTROYING);
+		gnt_widget_hide(obj);
+		delwin(obj->window);
 		g_object_run_dispose(G_OBJECT(obj));
+	}
 	GNTDEBUG;
 }
 
@@ -399,7 +393,8 @@
 	if (!GNT_WIDGET_IS_FLAG_SET(widget, GNT_WIDGET_CAN_TAKE_FOCUS))
 		return FALSE;
 
-	if (gnt_bindable_perform_action_key(GNT_BINDABLE(widget), keys))
+	if (!GNT_WIDGET_IS_FLAG_SET(widget, GNT_WIDGET_DISABLE_ACTIONS) &&
+			gnt_bindable_perform_action_key(GNT_BINDABLE(widget), keys))
 		return TRUE;
 
 	keys = gnt_bindable_remap_keys(GNT_BINDABLE(widget), keys);
--- a/finch/libgnt/gntwidget.h	Fri Jul 20 18:38:24 2007 +0000
+++ b/finch/libgnt/gntwidget.h	Fri Jul 20 21:49:53 2007 +0000
@@ -65,6 +65,7 @@
 	GNT_WIDGET_GROW_Y         = 1 << 9,
 	GNT_WIDGET_INVISIBLE      = 1 << 10,
 	GNT_WIDGET_TRANSIENT      = 1 << 11,
+	GNT_WIDGET_DISABLE_ACTIONS = 1 << 12,
 } GntWidgetFlags;
 
 /* XXX: This will probably move elsewhere */