changeset 11533:c9b815aeddc1

[gaim-migrate @ 13782] Pushing more of the userinfo stuff to the UI. Also, fixed a notify API warning in the perl plugin. committer: Tailor Script <tailor@pidgin.im>
author Richard Laager <rlaager@wiktel.com>
date Mon, 12 Sep 2005 20:04:37 +0000
parents 57439a383f4f
children 379490cbe014
files plugins/ChangeLog.API plugins/perl/common/Notify.xs plugins/perl/common/module.h plugins/perl/common/typemap src/gtknotify.c src/notify.c src/notify.h src/protocols/irc/msgs.c src/protocols/jabber/buddy.c src/protocols/msn/msn.c src/protocols/napster/napster.c src/protocols/novell/novell.c src/protocols/oscar/oscar.c src/protocols/sametime/sametime.c src/protocols/silc/ops.c src/protocols/yahoo/yahoo_profile.c src/protocols/zephyr/zephyr.c
diffstat 17 files changed, 49 insertions(+), 51 deletions(-) [+]
line wrap: on
line diff
--- a/plugins/ChangeLog.API	Mon Sep 12 18:52:53 2005 +0000
+++ b/plugins/ChangeLog.API	Mon Sep 12 20:04:37 2005 +0000
@@ -99,6 +99,9 @@
 	* Added:   CHAT_USERS_ALIAS_COLUMN, CHAT_USERS_COLOR_COLUMN,
 	           CHAT_USERS_BUDDY_COLUMN to the list of columns for the chat
 	           user list
+	* Changed: gaim_notify_userinfo, removed primary and secondary args
+	* Changed: GaimNotifyUiOps::notify_userinfo, removed title, primary,
+	           and secondary args
 
 	Signals:
 	* Changed: "received-im-msg" and "received-chat-msg" to match, both
--- a/plugins/perl/common/Notify.xs	Mon Sep 12 18:52:53 2005 +0000
+++ b/plugins/perl/common/Notify.xs	Mon Sep 12 20:04:37 2005 +0000
@@ -68,7 +68,7 @@
 	const char *title
 	const char *primary
 	const char *secondary
-	const char **results
+	Gaim::NotifySearchResults results
 	GCallback cb
 	void * user_data
 
@@ -82,12 +82,9 @@
 	const char *uri
 
 void *
-gaim_notify_userinfo(gc, who, title, primary, secondary, text, cb, user_data)
+gaim_notify_userinfo(gc, who, text, cb, user_data)
 	Gaim::Connection gc
 	const char *who
-	const char *title
-	const char *primary
-	const char *secondary
 	const char *text
 	GCallback cb
 	void * user_data
--- a/plugins/perl/common/module.h	Mon Sep 12 18:52:53 2005 +0000
+++ b/plugins/perl/common/module.h	Mon Sep 12 20:04:37 2005 +0000
@@ -161,7 +161,11 @@
 
 	/* notify.h */
 typedef GaimNotifyType          	Gaim__NotifyType;
-typedef GaimNotifyMsgType               Gaim__NotifyMsgType;	
+typedef GaimNotifyMsgType               Gaim__NotifyMsgType;
+typedef GaimNotifySearchButtonType	Gaim__NotifySearchButtonType;
+typedef GaimNotifySearchResults *	Gaim__NotifySearchResults;
+typedef GaimNotifySearchColumn *	Gaim__NotifySearchColumn;
+typedef GaimNotifySearchButton *	Gaim__NotifySearchButton;
 typedef GaimNotifyUiOps *		Gaim__NotifyUiOps;
 
 	/* plugin.h */
--- a/plugins/perl/common/typemap	Mon Sep 12 18:52:53 2005 +0000
+++ b/plugins/perl/common/typemap	Mon Sep 12 20:04:37 2005 +0000
@@ -100,6 +100,10 @@
 
 Gaim::NotifyType                	T_IV
 Gaim::NotifyMsgType            	 	T_IV
+Gaim::NotifySearchButtonType		T_IV
+Gaim::NotifySearchResults		T_GaimObj
+Gaim::NotifySearchColumn		T_GaimObj
+Gaim::NotifySearchButton		T_GaimObj
 Gaim::NotifyUiOps			T_GaimObj
 
 Gaim::Plugin             		T_GaimObj
--- a/src/gtknotify.c	Mon Sep 12 18:52:53 2005 +0000
+++ b/src/gtknotify.c	Mon Sep 12 20:04:37 2005 +0000
@@ -632,12 +632,17 @@
 
 static void *
 gaim_gtk_notify_userinfo(GaimConnection *gc, const char *who,
-						 const char *title, const char *primary,
-						 const char *secondary, const char *text,
+						 const char *text,
 						 GCallback cb, void *user_data)
 {
-	return gaim_gtk_notify_formatted(title, primary, secondary,
+	char *primary;
+	void *ui_handle;
+
+	primary = g_strdup_printf(_("Info for %s"), who);
+	ui_handle = gaim_gtk_notify_formatted(_("Buddy Information"), primary, NULL,
 									  text, cb, user_data);
+	g_free(primary);
+	return ui_handle;
 }
 
 static void
--- a/src/notify.c	Mon Sep 12 18:52:53 2005 +0000
+++ b/src/notify.c	Mon Sep 12 20:04:37 2005 +0000
@@ -22,7 +22,6 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
-#include "internal.h"
 #include "notify.h"
 
 static GaimNotifyUiOps *notify_ui_ops = NULL;
@@ -330,15 +329,11 @@
 
 void *
 gaim_notify_userinfo(GaimConnection *gc, const char *who,
-						   const char *primary, const char *secondary,
 						   const char *text, GCallback cb, void *user_data)
 {
 	GaimNotifyUiOps *ops;
-	char title[256];
 
-	g_snprintf(title, sizeof(title), _("Info for %s"), who);
-
-	g_return_val_if_fail(primary != NULL, NULL);
+	g_return_val_if_fail(who != NULL, NULL);
 
 	ops = gaim_notify_get_ui_ops();
 
@@ -348,8 +343,8 @@
 		info            = g_new0(GaimNotifyInfo, 1);
 		info->type      = GAIM_NOTIFY_USERINFO;
 		info->handle    = gc;
-		info->ui_handle = ops->notify_userinfo(gc, who, title, primary,
-											   secondary, text, cb, user_data);
+		info->ui_handle = ops->notify_userinfo(gc, who,
+											   text, cb, user_data);
 
 		handles = g_list_append(handles, info);
 
--- a/src/notify.h	Mon Sep 12 18:52:53 2005 +0000
+++ b/src/notify.h	Mon Sep 12 20:04:37 2005 +0000
@@ -126,8 +126,7 @@
 										  GaimNotifySearchResults *results,
 										  void *data, void *user_data);
 	void *(*notify_userinfo)(GaimConnection *gc, const char *who,
-							  const char *title, const char *primary,
-							  const char *secondary, const char *text,
+							  const char *text,
 							  GCallback cb, void *user_data);
 	void *(*notify_uri)(const char *uri);
 
@@ -360,10 +359,8 @@
  * The text is essentially a stripped-down format of HTML, the same that
  * IMs may send.
  *
- * @param gc		The GaimConnection handle associated with the information.
- * @param who		The username associated with the information.
- * @param primary   The main point of the message.
- * @param secondary The secondary information.
+ * @param gc	    The GaimConnection handle associated with the information.
+ * @param who	    The username associated with the information.
  * @param text      The formatted text.
  * @param cb        The callback to call when the user closes
  *                  the notification.
@@ -372,7 +369,6 @@
  * @return A UI-specific handle.
  */
 void *gaim_notify_userinfo(GaimConnection *gc, const char *who,
-						   const char *primary, const char *secondary,
 						   const char *text, GCallback cb,
 						   void *user_data);
 
--- a/src/protocols/irc/msgs.c	Mon Sep 12 18:52:53 2005 +0000
+++ b/src/protocols/irc/msgs.c	Mon Sep 12 20:04:37 2005 +0000
@@ -252,7 +252,7 @@
 	gc = gaim_account_get_connection(irc->account);
 	str = g_string_free(info, FALSE);
 
-	gaim_notify_userinfo(gc, irc->whois.nick, _("Buddy Information"), NULL, str, NULL, NULL);
+	gaim_notify_userinfo(gc, irc->whois.nick, str, NULL, NULL);
 
 	g_free(irc->whois.nick);
 	g_free(str);
--- a/src/protocols/jabber/buddy.c	Mon Sep 12 18:52:53 2005 +0000
+++ b/src/protocols/jabber/buddy.c	Mon Sep 12 20:04:37 2005 +0000
@@ -851,8 +851,7 @@
 
 	text = gaim_strdup_withhtml(info_text->str);
 
-	gaim_notify_userinfo(js->gc, from, _("Jabber Profile"),
-			NULL, text, NULL, NULL);
+	gaim_notify_userinfo(js->gc, from, text, NULL, NULL);
 
 	while(imgids) {
 		gaim_imgstore_unref(GPOINTER_TO_INT(imgids->data));
--- a/src/protocols/msn/msn.c	Mon Sep 12 18:52:53 2005 +0000
+++ b/src/protocols/msn/msn.c	Mon Sep 12 20:04:37 2005 +0000
@@ -1483,7 +1483,7 @@
 		g_snprintf(buf, 1024, "<html><body>%s<b>%s</b></body></html>",
 				tooltip_text, _("Error retrieving profile"));
 
-		gaim_notify_userinfo(info_data->gc, info_data->name, title, NULL, buf, NULL, NULL);
+		gaim_notify_userinfo(info_data->gc, info_data->name, buf, NULL, NULL);
 
 		g_free(tooltip_text);
 		return;
@@ -1792,7 +1792,6 @@
 	GString *s = info2_data->s;
 	char *photo_url_text = info2_data->photo_url_text;
 	char *tooltip_text = info2_data->tooltip_text;
-	const char *title = info2_data->title;
 
 	/* Try to put the photo in there too, if there's one and is readable */
 	if (data && url_text && len != 0)
@@ -1819,7 +1818,7 @@
 #endif
 
 	g_string_prepend(s, tooltip_text);
-	gaim_notify_userinfo(info_data->gc, info_data->name, title, NULL, s->str, NULL, NULL);
+	gaim_notify_userinfo(info_data->gc, info_data->name, s->str, NULL, NULL);
 
 	g_free(stripped);
 	g_free(url_buffer);
--- a/src/protocols/napster/napster.c	Mon Sep 12 18:52:53 2005 +0000
+++ b/src/protocols/napster/napster.c	Mon Sep 12 20:04:37 2005 +0000
@@ -420,7 +420,7 @@
 		/* XXX - Format is:   "Elite" 37 " " "Active" 0 0 0 0 "gaim 0.63cvs" 0 0 192.168.1.41 32798 0 unknown flounder */
 		res = g_strsplit(buf, " ", 2);
 		/* res[0] == username */
-		gaim_notify_userinfo(gc, res[0], NULL, _("Buddy Information"), res[1], NULL, NULL);
+		gaim_notify_userinfo(gc, res[0], res[1], NULL, NULL);
 		g_strfreev(res);
 		break;
 
--- a/src/protocols/novell/novell.c	Mon Sep 12 18:52:53 2005 +0000
+++ b/src/protocols/novell/novell.c	Mon Sep 12 20:04:37 2005 +0000
@@ -1512,8 +1512,7 @@
 	}
 
 	gaim_notify_userinfo(gc, nm_user_record_get_userid(user_record), 
-						 _("User Properties"), NULL, info_text->str,
-						 NULL, NULL);
+						 info_text->str, NULL, NULL);
 
 	g_string_free(info_text, TRUE);
 }
--- a/src/protocols/oscar/oscar.c	Mon Sep 12 18:52:53 2005 +0000
+++ b/src/protocols/oscar/oscar.c	Mon Sep 12 20:04:37 2005 +0000
@@ -4874,7 +4874,7 @@
 			g_free(statusmsg);
 			g_strfreev(splitmsg);
 
-			gaim_notify_userinfo(gc, who, _("Buddy Information"), NULL, dialogmsg, NULL, NULL);
+			gaim_notify_userinfo(gc, who, dialogmsg, NULL, NULL);
 
 			g_free(title);
 			g_free(dialogmsg);
@@ -5099,7 +5099,7 @@
 
 	tmp = gaim_str_sub_away_formatters(str->str, gaim_account_get_username(account));
 	g_string_free(str, TRUE);
-	gaim_notify_userinfo(gc, userinfo->sn, _("Buddy Information"), NULL, tmp, NULL, NULL);
+	gaim_notify_userinfo(gc, userinfo->sn, tmp, NULL, NULL);
 	g_free(tmp);
 
 	return 1;
@@ -5925,7 +5925,7 @@
 	struct buddyinfo *bi = NULL;
 	gchar who[16];
 	GString *str;
-	gchar *primary, *utf8;
+	gchar *utf8;
 	const gchar *alias;
 	va_list ap;
 	struct aim_icq_info *info;
@@ -6027,9 +6027,7 @@
 		alias = gaim_buddy_get_alias(buddy);
 	else
 		alias = who;
-	primary = g_strdup_printf(_("ICQ Info for %s"), alias);
-	gaim_notify_userinfo(gc, who, primary, NULL, str->str, NULL, NULL);
-	g_free(primary);
+	gaim_notify_userinfo(gc, who, str->str, NULL, NULL);
 	g_string_free(str, TRUE);
 
 	return 1;
--- a/src/protocols/sametime/sametime.c	Mon Sep 12 18:52:53 2005 +0000
+++ b/src/protocols/sametime/sametime.c	Mon Sep 12 20:04:37 2005 +0000
@@ -3454,7 +3454,7 @@
   /* @todo emit a signal to allow a plugin to override the display of
      this notification, so that it can create its own */
 
-  gaim_notify_userinfo(gc, who, "Meanwhile User Status", NULL, str->str, NULL, NULL);
+  gaim_notify_userinfo(gc, who, str->str, NULL, NULL);
 
   g_string_free(str, TRUE);
 }
--- a/src/protocols/silc/ops.c	Mon Sep 12 18:52:53 2005 +0000
+++ b/src/protocols/silc/ops.c	Mon Sep 12 20:04:37 2005 +0000
@@ -1084,7 +1084,7 @@
 						_("More..."), G_CALLBACK(silcgaim_whois_more));
 			else
 #endif
-			gaim_notify_userinfo(gc, client_entry->nickname, _("Buddy Information"), NULL, buf, NULL, NULL);
+			gaim_notify_userinfo(gc, client_entry->nickname, buf, NULL, NULL);
 			g_free(buf);
 		}
 		break;
@@ -1145,7 +1145,7 @@
 			}
 
 			buf = g_string_free(s, FALSE);
-			gaim_notify_userinfo(gc, client_entry->nickname, _("Buddy Information"), NULL, buf, NULL, NULL);
+			gaim_notify_userinfo(gc, client_entry->nickname, buf, NULL, NULL);
 			g_free(buf);
 		}
 		break;
--- a/src/protocols/yahoo/yahoo_profile.c	Mon Sep 12 18:52:53 2005 +0000
+++ b/src/protocols/yahoo/yahoo_profile.c	Mon Sep 12 20:04:37 2005 +0000
@@ -764,8 +764,8 @@
 		g_snprintf(buf, 1024, "<html><body>%s<b>%s</b></body></html>",
 				tooltip_text, _("Error retrieving profile"));
 
-		gaim_notify_userinfo(info_data->gc, info_data->name, title,
-			NULL, buf, NULL, NULL);
+		gaim_notify_userinfo(info_data->gc, info_data->name, 
+			buf, NULL, NULL);
 
 		g_free(profile_url_text);
 		g_free(tooltip_text);
@@ -801,8 +801,8 @@
 				  "you will need to visit this link in your web browser"),
 				profile_url_text, profile_url_text);
 
-		gaim_notify_userinfo(info_data->gc, info_data->name, title, 
-				NULL, buf, NULL, NULL);
+		gaim_notify_userinfo(info_data->gc, info_data->name, 
+				buf, NULL, NULL);
 
 		g_free(profile_url_text);
 		g_free(tooltip_text);
@@ -917,7 +917,6 @@
 	char *tooltip_text = info2_data->tooltip_text;
 	const profile_strings_node_t *strings = info2_data->strings;
 	const char *last_updated_string = info2_data->last_updated_string;
-	const char *title = info2_data->title;
 	profile_state_t profile_state = info2_data->profile_state;
 
 	/* We continue here from yahoo_got_info, as if nothing has happened */
@@ -1188,8 +1187,8 @@
 	g_string_prepend(s, "<html><body>\n");
 
 	/* show it to the user */
-	gaim_notify_userinfo(info_data->gc, info_data->name,title,
-						  NULL, s->str, NULL, NULL);
+	gaim_notify_userinfo(info_data->gc, info_data->name,
+						  s->str, NULL, NULL);
 
 	g_free(last_updated_utf8_string);
 	g_free(url_buffer);
--- a/src/protocols/zephyr/zephyr.c	Mon Sep 12 18:52:53 2005 +0000
+++ b/src/protocols/zephyr/zephyr.c	Mon Sep 12 20:04:37 2005 +0000
@@ -727,7 +727,7 @@
 					ZGetLocations(&locs, &one);
 					g_string_append_printf(str, _("<br>At %s since %s"), locs.host, locs.time);
 				}
-				gaim_notify_userinfo(gc, b ? b->name : user, _("Buddy Information"), NULL, 
+				gaim_notify_userinfo(gc, b ? b->name : user, 
 						     str->str, NULL, NULL);
 				g_string_free(str, TRUE);
 			} else {
@@ -1142,7 +1142,7 @@
 								       tree_child(tree_child(tree_child(tree_child(locations,2),0),2),2)->contents);
 					}
 
-					gaim_notify_userinfo(gc, b ? b->name : user, _("Buddy Information"), NULL, 
+					gaim_notify_userinfo(gc, b ? b->name : user,
 							     str->str, NULL, NULL);
 					g_string_free(str, TRUE);
 				} else {