changeset 22307:d270b6aebabc

Right-clicking on a widget should trigger the context-menu.
author Sadrul Habib Chowdhury <imadil@gmail.com>
date Sun, 17 Feb 2008 17:14:29 +0000
parents cccdcc7e5642
children 3867cef6a0d5
files finch/gntblist.c finch/libgnt/gntwidget.c
diffstat 2 files changed, 4 insertions(+), 13 deletions(-) [+]
line wrap: on
line diff
--- a/finch/gntblist.c	Sat Feb 16 18:17:32 2008 +0000
+++ b/finch/gntblist.c	Sun Feb 17 17:14:29 2008 +0000
@@ -601,10 +601,10 @@
 	field = purple_request_field_string_new("screenname", _("Screen Name"), username, FALSE);
 	purple_request_field_group_add_field(group, field);
 
-	field = purple_request_field_string_new("alias", _("Alias"), alias, FALSE);
+	field = purple_request_field_string_new("alias", _("Alias (optional)"), alias, FALSE);
 	purple_request_field_group_add_field(group, field);
 
-	field = purple_request_field_string_new("group", _("Group"), grp, FALSE);
+	field = purple_request_field_string_new("group", _("Add in group"), grp, FALSE);
 	purple_request_field_group_add_field(group, field);
 	purple_request_field_set_type_hint(field, "group");
 
@@ -1408,7 +1408,6 @@
 	char *primary;
 	const char *name, *sec = NULL;
 
-	/* XXX: could be a contact */
 	if (PURPLE_BLIST_NODE_IS_CONTACT(node)) {
 		PurpleContact *c = (PurpleContact*)node;
 		name = purple_contact_get_alias(c);
@@ -2349,15 +2348,6 @@
 	return ret;
 }
 
-static gboolean
-blist_clicked(GntTree *tree, GntMouseEvent event, int x, int y, gpointer ggblist)
-{
-	if (event == GNT_RIGHT_MOUSE_DOWN) {
-		draw_context_menu(ggblist);
-	}
-	return FALSE;
-}
-
 static void
 plugin_action(GntMenuItem *item, gpointer data)
 {
@@ -2940,7 +2930,6 @@
 	g_signal_connect(G_OBJECT(ggblist->tree), "key_pressed", G_CALLBACK(key_pressed), ggblist);
 	g_signal_connect(G_OBJECT(ggblist->tree), "context-menu", G_CALLBACK(context_menu), ggblist);
 	g_signal_connect(G_OBJECT(ggblist->tree), "collapse-toggled", G_CALLBACK(group_collapsed), NULL);
-	g_signal_connect_after(G_OBJECT(ggblist->tree), "clicked", G_CALLBACK(blist_clicked), ggblist);
 	g_signal_connect(G_OBJECT(ggblist->tree), "activate", G_CALLBACK(selection_activate), ggblist);
 	g_signal_connect_data(G_OBJECT(ggblist->tree), "gained-focus", G_CALLBACK(draw_tooltip),
 				ggblist, 0, G_CONNECT_AFTER | G_CONNECT_SWAPPED);
--- a/finch/libgnt/gntwidget.c	Sat Feb 16 18:17:32 2008 +0000
+++ b/finch/libgnt/gntwidget.c	Sun Feb 17 17:14:29 2008 +0000
@@ -407,6 +407,8 @@
 {
 	gboolean ret;
 	g_signal_emit(widget, signals[SIG_CLICKED], 0, event, x, y, &ret);
+	if (!ret && event == GNT_RIGHT_MOUSE_DOWN)
+		ret = gnt_bindable_perform_action_named(GNT_BINDABLE(widget), "context-menu", NULL);
 	return ret;
 }