changeset 22310:f463d54e606b

merge of '27ebb66171c1a1a757cd8d3e325c91e159b1d048' and '777b92c3aa5b0886b34c80a50a7e8e08f735894d'
author Jeffrey Connelly <jaconnel@calpoly.edu>
date Mon, 18 Feb 2008 19:22:39 +0000
parents 7d0e93198c39 (current diff) 07073da46dd5 (diff)
children c1e754d1d884 7287cf8dbbca 9479cf89a97d 02eda4bd2b22
files
diffstat 3 files changed, 17 insertions(+), 13 deletions(-) [+]
line wrap: on
line diff
--- a/finch/gntblist.c	Mon Feb 18 19:20:39 2008 +0000
+++ b/finch/gntblist.c	Mon Feb 18 19:22:39 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/gntmenu.c	Mon Feb 18 19:20:39 2008 +0000
+++ b/finch/libgnt/gntmenu.c	Mon Feb 18 19:22:39 2008 +0000
@@ -46,6 +46,7 @@
 static void (*org_map)(GntWidget *wid);
 static void (*org_size_request)(GntWidget *wid);
 static gboolean (*org_key_pressed)(GntWidget *w, const char *t);
+static gboolean (*org_clicked)(GntWidget *w, GntMouseEvent event, int x, int y);
 
 static void menuitem_activate(GntMenu *menu, GntMenuItem *item);
 
@@ -390,6 +391,16 @@
 		menu->parentmenu->submenu = NULL;
 }
 
+static gboolean
+gnt_menu_clicked(GntWidget *widget, GntMouseEvent event, int x, int y)
+{
+	if (!org_clicked || !org_clicked(widget, event, x, y) ||
+			!GNT_MENU(widget)->type == GNT_MENU_TOPLEVEL)
+			return FALSE;
+	gnt_widget_activate(widget);
+	return TRUE;
+}
+
 static void
 gnt_menu_class_init(GntMenuClass *klass)
 {
@@ -401,6 +412,7 @@
 	org_draw = wid_class->draw;
 	org_key_pressed = wid_class->key_pressed;
 	org_size_request = wid_class->size_request;
+	org_clicked = wid_class->clicked;
 
 	wid_class->destroy = gnt_menu_destroy;
 	wid_class->draw = gnt_menu_draw;
@@ -409,6 +421,7 @@
 	wid_class->key_pressed = gnt_menu_key_pressed;
 	wid_class->activate = gnt_menu_activate;
 	wid_class->hide = gnt_menu_hide;
+	wid_class->clicked = gnt_menu_clicked;
 
 	parent_class->toggled = gnt_menu_toggled;
 
--- a/finch/libgnt/gntwidget.c	Mon Feb 18 19:20:39 2008 +0000
+++ b/finch/libgnt/gntwidget.c	Mon Feb 18 19:22:39 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;
 }