pidgin: b289d83d: Fine tune the edit-settings dialog (e.g....

sadrul at pidgin.im sadrul at pidgin.im
Tue Apr 29 15:05:49 EDT 2008


-----------------------------------------------------------------
Revision: b289d83d45fef8cb54038b8cb54457530934e08a
Ancestor: cfd47fe5763a354f0c9e938ce1e829c7fb3af714
Author: sadrul at pidgin.im
Date: 2008-04-29T18:57:10
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/b289d83d45fef8cb54038b8cb54457530934e08a

Modified files:
        finch/gntblist.c pidgin/gtkblist.c

ChangeLog: 

Fine tune the edit-settings dialog (e.g., mark fields as masked or
required as appropriate), and avoid storing a NULL value in the
hash-table.

-------------- next part --------------
============================================================
--- finch/gntblist.c	371a337fff5ffd5944c958bd5345b30725c34f60
+++ finch/gntblist.c	3212db36a1fab4898eb40269ab13e7ec35d811ed
@@ -380,6 +380,27 @@ get_blist_node_flag(PurpleBlistNode *nod
 		fnode = FINCH_GET_DATA(node);
 		if (fnode && fnode->signed_timer)
 			flag |= GNT_TEXT_FLAG_BLINK;
+	} else if (PURPLE_BLIST_NODE_IS_GROUP(node)) {
+		/* If the node is collapsed, then check to see if any of the priority buddies of
+		 * any of the contacts within this group recently signed on/off, and set the blink
+		 * flag appropriately. */
+		/* XXX: Refs #5444 */
+		/* XXX: there's no way I can ask if the node is expanded or not? *sigh*
+		 * API addition would be necessary */
+#if 0
+		if (!gnt_tree_get_expanded(GNT_TREE(ggblist->tree), node)) {
+			for (node = purple_blist_node_get_first_child(node); node;
+					node = purple_blist_node_get_sibling_next(node)) {
+				PurpleBlistNode *pnode;
+				pnode = purple_contact_get_priority_buddy((PurpleContact*)node);
+				fnode = FINCH_GET_DATA(node);
+				if (fnode && fnode->signed_timer) {
+					flag |= GNT_TEXT_FLAG_BLINK;
+					break;
+				}
+			}
+		}
+#endif
 	}
 
 	return flag;
@@ -1034,7 +1055,11 @@ chat_components_edit_ok(PurpleChat *chat
 			else
 				val = g_strdup(purple_request_field_string_get_value(field));
 
-			g_hash_table_replace(purple_chat_get_components(chat), g_strdup(id), val);  /* val should not be free'd */
+			if (!val) {
+				g_hash_table_remove(purple_chat_get_components(chat), id);
+			} else {
+				g_hash_table_replace(purple_chat_get_components(chat), g_strdup(id), val);  /* val should not be free'd */
+			}
 		}
 	}
 }
@@ -1065,8 +1090,13 @@ chat_components_edit(PurpleBlistNode *se
 		} else {
 			field = purple_request_field_string_new(pce->identifier, pce->label,
 					g_hash_table_lookup(purple_chat_get_components(chat), pce->identifier), FALSE);
+			if (pce->secret)
+				purple_request_field_string_set_masked(field, TRUE);
 		}
 
+		if (pce->required)
+			purple_request_field_set_required(field, TRUE);
+
 		purple_request_field_group_add_field(group, field);
 		g_free(pce);
 	}
============================================================
--- pidgin/gtkblist.c	bc14e64f5a68bc9f109ef197a5b659822ff0286f
+++ pidgin/gtkblist.c	c785343d3a4ac3cc5bca399b9f6b7f7af1496a1c
@@ -632,7 +632,11 @@ chat_components_edit_ok(PurpleChat *chat
 			else
 				val = g_strdup(purple_request_field_string_get_value(field));
 
-			g_hash_table_replace(purple_chat_get_components(chat), g_strdup(id), val);  /* val should not be free'd */
+			if (!val) {
+				g_hash_table_remove(purple_chat_get_components(chat), id);
+			} else {
+				g_hash_table_replace(purple_chat_get_components(chat), g_strdup(id), val);  /* val should not be free'd */
+			}
 		}
 	}
 }
@@ -663,8 +667,13 @@ static void chat_components_edit(GtkWidg
 		} else {
 			field = purple_request_field_string_new(pce->identifier, pce->label,
 					g_hash_table_lookup(purple_chat_get_components(chat), pce->identifier), FALSE);
+			if (pce->secret)
+				purple_request_field_string_set_masked(field, TRUE);
 		}
 
+		if (pce->required)
+			purple_request_field_set_required(field, TRUE);
+
 		purple_request_field_group_add_field(group, field);
 		g_free(pce);
 	}


More information about the Commits mailing list