diff libgaim/util.c @ 15143:b81e4e44b509

[gaim-migrate @ 17929] User Info and Tooltips now use the GaimNotifyUserInfo object and methods defined in notify.h. GaimNotifyUserInfo objects encapsulate a list of GaimNotifyUserInfoEntry objects, each of which may have a label, a value, and be specified to be a section header. This moves the burden of UI generation of user information from the various prpls to the UI. The UI can choose how to display the information rather than being fenced into a particular HTML formatting. Consistency across the prpls' information presentation is now enforced, as well. gaim_notify_user_info_get_text_with_newline() generates text in the: <b>label</b>: value <b>label</b>: value format as was passed by convention from prpls in the past. committer: Tailor Script <tailor@pidgin.im>
author Evan Schoenberg <evan.s@dreskin.net>
date Sun, 10 Dec 2006 02:53:09 +0000
parents 9a69964d8c18
children
line wrap: on
line diff
--- a/libgaim/util.c	Sat Dec 09 20:20:17 2006 +0000
+++ b/libgaim/util.c	Sun Dec 10 02:53:09 2006 +0000
@@ -1061,7 +1061,7 @@
 }
 
 gboolean
-gaim_markup_extract_info_field(const char *str, int len, GString *dest,
+gaim_markup_extract_info_field(const char *str, int len, GaimNotifyUserInfo *user_info,
 							   const char *start_token, int skip,
 							   const char *end_token, char check_value,
 							   const char *no_value_token,
@@ -1072,7 +1072,7 @@
 	const char *p, *q;
 
 	g_return_val_if_fail(str          != NULL, FALSE);
-	g_return_val_if_fail(dest  != NULL, FALSE);
+	g_return_val_if_fail(user_info    != NULL, FALSE);
 	g_return_val_if_fail(start_token  != NULL, FALSE);
 	g_return_val_if_fail(end_token    != NULL, FALSE);
 	g_return_val_if_fail(display_name != NULL, FALSE);
@@ -1110,11 +1110,11 @@
 					  (no_value_token && strncmp(p, no_value_token,
 												 strlen(no_value_token)))))
 	{
-		g_string_append_printf(dest, _("<b>%s:</b> "), display_name);
+		GString *dest = g_string_new("");
 
 		if (is_link)
 		{
-			g_string_append(dest, "<br><a href=\"");
+			g_string_append(dest, "<a href=\"");
 
 			if (link_prefix)
 				g_string_append(dest, link_prefix);
@@ -1147,7 +1147,8 @@
 				g_string_append_len(dest, p, q - p);
 		}
 
-		g_string_append(dest, "<br>\n");
+		gaim_notify_user_info_add_pair(user_info, display_name, dest->str);
+		g_string_free(dest, TRUE);
 
 		return TRUE;
 	}