diff pidgin/gtkconv.c @ 19335:770b04e551a7

If you have the buddy notes plugin loaded, when you right click a chat's infopane, it will show an empty Send To menu along with the "Edit Note" menu item, because the logic assumes that if there are additional menu items, a Send To menu is implicit. This fixes that.
author Kevin Stange <kevin@simguy.net>
date Sat, 18 Aug 2007 08:16:37 +0000
parents 6cec9e871ad2
children 272d08484f7d 7a118cacd4b0
line wrap: on
line diff
--- a/pidgin/gtkconv.c	Sat Aug 18 05:57:52 2007 +0000
+++ b/pidgin/gtkconv.c	Sat Aug 18 08:16:37 2007 +0000
@@ -7805,25 +7805,20 @@
 	if (e->button == 3) {
 		/* Right click was pressed. Popup the Send To menu. */
 		GtkWidget *menu = gtk_menu_new(), *sub;
+		gboolean populated = populate_menu_with_options(menu, gtkconv, TRUE);
 		sub = gtk_menu_item_get_submenu(GTK_MENU_ITEM(gtkconv->win->menu.send_to));
 
-		if (populate_menu_with_options(menu, gtkconv, TRUE))
-			pidgin_separator(menu);
-		else if (!sub ||
-				!GTK_WIDGET_IS_SENSITIVE(gtkconv->win->menu.send_to)) {
-			gtk_widget_destroy(menu);
-			return FALSE;
-		} else {
-			menu = sub;
-			sub = NULL;
-		}
-
-		if (sub) {
+		if (sub && GTK_WIDGET_IS_SENSITIVE(gtkconv->win->menu.send_to)) {
 			GtkWidget *item = gtk_menu_item_new_with_mnemonic(_("_Send To"));
+			if (populated)
+				pidgin_separator(menu);
 			gtk_menu_shell_append(GTK_MENU_SHELL(menu), item);
 			gtk_menu_item_set_submenu(GTK_MENU_ITEM(item), sub);
 			gtk_widget_show(item);
 			gtk_widget_show_all(sub);
+		} else if (!populated) {
+			gtk_widget_destroy(menu);
+			return FALSE;
 		}
 
 		gtk_widget_show_all(menu);