changeset 32660:1c1317a2d471

Enable the menu-refreshing logic in the conversation menu, now that the signal (un)blocking affects the correct widget.
author Elliott Sales de Andrade <qulogic@pidgin.im>
date Mon, 14 Mar 2011 06:45:05 +0000
parents 50f4d84e0660
children fa4662e64fc3
files pidgin/gtkconv.c
diffstat 1 files changed, 5 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/pidgin/gtkconv.c	Mon Mar 14 06:41:44 2011 +0000
+++ b/pidgin/gtkconv.c	Mon Mar 14 06:45:05 2011 +0000
@@ -3501,7 +3501,6 @@
 	g_object_set_data(G_OBJECT(win->window), "plugin-actions", action_items);
 }
 
-#if 0
 static void menubar_activated(GtkWidget *item, gpointer data)
 {
 	PidginWindow *win = data;
@@ -3520,12 +3519,11 @@
 {
 	/* The menubar has been deactivated. Make sure the 'More' submenu is regenerated next time
 	 * the 'Conversation' menu pops up. */
-	GtkWidget *menuitem = gtk_item_factory_get_item(win->menu.item_factory, N_("/Conversation"));
+	GtkWidget *menuitem = gtk_ui_manager_get_widget(win->menu.ui, "/Conversation/ConversationMenu");
 	g_signal_handlers_unblock_by_func(G_OBJECT(menuitem), G_CALLBACK(menubar_activated), win);
 	g_signal_handlers_disconnect_by_func(G_OBJECT(win->menu.menubar),
 				G_CALLBACK(focus_out_from_menubar), win);
 }
-#endif
 
 static GtkWidget *
 setup_menubar(PidginWindow *win)
@@ -3534,6 +3532,7 @@
 	const char *method;
 	GtkActionGroup *action_group;
 	GError *error;
+	GtkWidget *menuitem;
 
 	action_group = gtk_action_group_new("ConversationActions");
 	gtk_action_group_add_actions(action_group,
@@ -3568,6 +3567,9 @@
 	win->menu.menubar =
 		gtk_ui_manager_get_widget(win->menu.ui, "/Conversation");
 
+	menuitem = gtk_ui_manager_get_widget(win->menu.ui, "/Conversation/ConversationMenu");
+	g_signal_connect(G_OBJECT(menuitem), "activate", G_CALLBACK(menubar_activated), win);
+
 	win->menu.view_log =
 		gtk_ui_manager_get_action(win->menu.ui,
 		                          "/Conversation/ConversationMenu/ViewLog");