pidgin: 27f42a91: Make "Show when offline" work on group n...

nosnilmot at pidgin.im nosnilmot at pidgin.im
Sun Mar 9 12:55:55 EDT 2008


-----------------------------------------------------------------
Revision: 27f42a916b4ccc5fb352aa24fbdabc9e70b5523f
Ancestor: d0643697991f682f5e5690538d45225f6504c37e
Author: nosnilmot at pidgin.im
Date: 2008-03-09T16:46:04
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/27f42a916b4ccc5fb352aa24fbdabc9e70b5523f

Modified files:
        pidgin/gtkblist.c

ChangeLog: 

Make "Show when offline" work on group nodes too, which sets the flag for
all group members. Fixes #5141.

-------------- next part --------------
============================================================
--- pidgin/gtkblist.c	92dfab1ca6fc84185382e4df461a8205dacf242a
+++ pidgin/gtkblist.c	40b00b9f87f4d081cfcc0243cc8056bb0b6cc0ec
@@ -705,6 +705,17 @@ static void gtk_blist_menu_showoffline_c
 		for (bnode = node->child; bnode != NULL; bnode = bnode->next) {
 			purple_blist_node_set_bool(bnode, "show_offline", setting);
 		}
+	} else if (PURPLE_BLIST_NODE_IS_GROUP(node)) {
+		PurpleBlistNode *cnode, *bnode;
+		gboolean setting = !purple_blist_node_get_bool(node, "show_offline");
+
+		purple_blist_node_set_bool(node, "show_offline", setting);
+		for (cnode = node->child; cnode != NULL; cnode = cnode->next) {
+			purple_blist_node_set_bool(cnode, "show_offline", setting);
+			for (bnode = cnode->child; bnode != NULL; bnode = bnode->next) {
+				purple_blist_node_set_bool(bnode, "show_offline", setting);
+			}
+		}
 	}
 	pidgin_blist_update(purple_get_blist(), node);
 }
@@ -1459,6 +1470,11 @@ create_group_menu (PurpleBlistNode *node
 				 G_CALLBACK(pidgin_blist_remove_cb), node, 0, 0, NULL);
 	pidgin_new_item_from_stock(menu, _("_Rename"), NULL,
 				 G_CALLBACK(gtk_blist_menu_alias_cb), node, 0, 0, NULL);
+	if (!(purple_blist_node_get_flags(node) & PURPLE_BLIST_NODE_FLAG_NO_SAVE)) {
+		gboolean show_offline = purple_blist_node_get_bool(node, "show_offline");
+		pidgin_new_item_from_stock(menu, show_offline ? _("Hide when offline") : _("Show when offline"),
+				NULL, G_CALLBACK(gtk_blist_menu_showoffline_cb), node, 0, 0, NULL);
+	}
 
 	pidgin_append_blist_node_extended_menu(menu, node);
 


More information about the Commits mailing list