# HG changeset patch # User Evan Schoenberg # Date 1165719234 0 # Node ID 94adee1cba70d03280c14b91feb3baf5e3b05833 # Parent b81e4e44b50949167105edb7bdd52d755b3ff67a [gaim-migrate @ 17930] gtkgaim changes for GaimNotifyUserInfo introduced in [17929] committer: Tailor Script diff -r b81e4e44b509 -r 94adee1cba70 gtk/gtkblist.c --- a/gtk/gtkblist.c Sun Dec 10 02:53:09 2006 +0000 +++ b/gtk/gtkblist.c Sun Dec 10 02:53:54 2006 +0000 @@ -2601,11 +2601,14 @@ else if (GAIM_BLIST_NODE_IS_CONTACT(node) || GAIM_BLIST_NODE_IS_BUDDY(node)) { /* NOTE: THIS FUNCTION IS NO LONGER CALLED FOR CONTACTS - * See create_tip_for_node(). */ + * See create_tip_for_node(). + * + * create_tip_for_node() calls this function - what does the above mean? -evands */ GaimContact *c; GaimBuddy *b; GaimPresence *presence; + GaimNotifyUserInfo *user_info; char *tmp; time_t idle_secs, signon; @@ -2627,15 +2630,17 @@ /* Buddy Name */ tmp = g_markup_escape_text(gaim_buddy_get_name(b), -1); - g_string_append_printf(str, "%s", tmp); + g_string_append_printf(str, "%s\n", tmp); g_free(tmp); + user_info = gaim_notify_user_info_new(); + /* Account */ if (full && g_list_length(gaim_connections_get_all()) > 1) { tmp = g_markup_escape_text(gaim_account_get_username( gaim_buddy_get_account(b)), -1); - g_string_append_printf(str, _("\nAccount: %s"), tmp); + gaim_notify_user_info_add_pair(user_info, _("Account"), tmp); g_free(tmp); } @@ -2647,7 +2652,7 @@ strcmp(c->alias, b->alias) != 0) { tmp = g_markup_escape_text(b->alias, -1); - g_string_append_printf(str, _("\nBuddy Alias: %s"), tmp); + gaim_notify_user_info_add_pair(user_info, _("Buddy Alias"), tmp); g_free(tmp); } @@ -2659,7 +2664,7 @@ if (full && b->server_alias != NULL && b->server_alias[0] != '\0') { tmp = g_markup_escape_text(b->server_alias, -1); - g_string_append_printf(str, _("\nNickname: %s"), tmp); + gaim_notify_user_info_add_pair(user_info, _("Nickname"), tmp); g_free(tmp); } @@ -2668,7 +2673,7 @@ if (full && GAIM_BUDDY_IS_ONLINE(b) && signon > 0) { tmp = gaim_str_seconds_to_string(time(NULL) - signon); - g_string_append_printf(str, _("\nLogged In: %s"), tmp); + gaim_notify_user_info_add_pair(user_info, _("Logged In"), tmp); g_free(tmp); } @@ -2679,7 +2684,7 @@ if (idle_secs > 0) { tmp = gaim_str_seconds_to_string(time(NULL) - idle_secs); - g_string_append_printf(str, _("\nIdle: %s"), tmp); + gaim_notify_user_info_add_pair(user_info, _("Idle"), tmp); g_free(tmp); } } @@ -2714,7 +2719,7 @@ if (lastseen > 0) { tmp = gaim_str_seconds_to_string(time(NULL) - lastseen); - g_string_append_printf(str, _("\nLast Seen: %s ago"), tmp); + gaim_notify_user_info_add_pair(user_info, _("Last Seen"), tmp); g_free(tmp); } } @@ -2723,22 +2728,28 @@ /* Offline? */ /* FIXME: Why is this status special-cased by the core? -- rlaager */ if (!GAIM_BUDDY_IS_ONLINE(b)) { - g_string_append_printf(str, _("\nStatus: Offline")); + gaim_notify_user_info_add_pair(user_info, _("Status"), _("Offline")); } if (prpl_info && prpl_info->tooltip_text) { /* Additional text from the PRPL */ - prpl_info->tooltip_text(b, str, full); + prpl_info->tooltip_text(b, user_info, full); } /* These are Easter Eggs. Patches to remove them will be rejected. */ if (!g_ascii_strcasecmp(b->name, "robflynn")) - g_string_append(str, _("\nDescription: Spooky")); + gaim_notify_user_info_add_pair(user_info, _("Description"), _("Spooky")); if (!g_ascii_strcasecmp(b->name, "seanegn")) - g_string_append(str, _("\nStatus: Awesome")); + gaim_notify_user_info_add_pair(user_info, _("Status"), _("Awesome")); if (!g_ascii_strcasecmp(b->name, "chipx86")) - g_string_append(str, _("\nStatus: Rockin'")); + gaim_notify_user_info_add_pair(user_info, _("Status"), _("Rockin'")); + + tmp = gaim_notify_user_info_get_text_with_newline(user_info, "\n"); + g_string_append(str, tmp); + g_free(tmp); + + gaim_notify_user_info_destroy(user_info); } gaim_signal_emit(gaim_gtk_blist_get_handle(), diff -r b81e4e44b509 -r 94adee1cba70 gtk/gtknotify.c --- a/gtk/gtknotify.c Sun Dec 10 02:53:09 2006 +0000 +++ b/gtk/gtknotify.c Sun Dec 10 02:53:54 2006 +0000 @@ -841,13 +841,15 @@ static void * gaim_gtk_notify_userinfo(GaimConnection *gc, const char *who, - const char *text) + GaimNotifyUserInfo *user_info) { - char *primary; + char *primary, *info; void *ui_handle; primary = g_strdup_printf(_("Info for %s"), who); - ui_handle = gaim_gtk_notify_formatted(_("Buddy Information"), primary, NULL, text); + info = gaim_notify_user_info_get_text_with_newline(user_info, "
"); + ui_handle = gaim_gtk_notify_formatted(_("Buddy Information"), primary, NULL, info); + g_free(info); g_free(primary); return ui_handle; }