# HG changeset patch # User Sadrul Habib Chowdhury # Date 1188787423 0 # Node ID 7f7f2f4806d904a5bd412c2b78b55bee897ea1b6 # Parent d4fb44035799b521494cbe4be11a60674a9ee556# Parent f69e7fb8a449838493556d07ce2e9b11761b2ba2 merge of 'e227a655c6a9f079748dafa19d46fcb9d99bf20a' and 'f049878920b7b8305fe3d05b429899d96ace0742' diff -r d4fb44035799 -r 7f7f2f4806d9 ChangeLog.API --- a/ChangeLog.API Mon Sep 03 02:19:23 2007 +0000 +++ b/ChangeLog.API Mon Sep 03 02:43:43 2007 +0000 @@ -14,6 +14,10 @@ The UI no longer needs to call it. Pidgin: + Changed: + * pidgin_conversations_fill_menu now also adds a separator and a 'Show + All' item if there are more than one conversations in the list. + Added: * pidgin_set_accessible_relations, sets up label-for and labelled-by ATK relations (broken out from pidgin_set_accessible_label) diff -r d4fb44035799 -r 7f7f2f4806d9 pidgin/gtkconv.c --- a/pidgin/gtkconv.c Mon Sep 03 02:19:23 2007 +0000 +++ b/pidgin/gtkconv.c Mon Sep 03 02:43:43 2007 +0000 @@ -2768,6 +2768,18 @@ pidgin_conv_present_conversation(conv); } +static void +unseen_all_conv_menu_cb(GtkMenuItem *item, GList *list) +{ + g_return_if_fail(list != NULL); + /* Do not free the list from here. It will be freed from the + * 'destroy' callback on the menuitem. */ + while (list) { + pidgin_conv_present_conversation(list->data); + list = list->next; + } +} + guint pidgin_conversations_fill_menu(GtkWidget *menu, GList *convs) { @@ -2799,6 +2811,19 @@ ret++; } + if (convs->next) { + /* There are more than one conversation. Add an option to show all conversations. */ + GtkWidget *item; + GList *list = g_list_copy(convs); + + pidgin_separator(menu); + + item = gtk_menu_item_new_with_label(_("Show All")); + g_signal_connect(G_OBJECT(item), "activate", G_CALLBACK(unseen_all_conv_menu_cb), list); + g_signal_connect_swapped(G_OBJECT(item), "destroy", G_CALLBACK(g_list_free), list); + gtk_menu_shell_append(GTK_MENU_SHELL(menu), item); + } + return ret; }