changeset 25547:2fda71133800

Some UI ;)
author Sean Egan <seanegan@gmail.com>
date Wed, 05 Sep 2007 01:55:16 +0000
parents 5150d8b576be
children 70cdff43ec76
files libpurple/mediamanager.c pidgin/gtkconv.c
diffstat 2 files changed, 14 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/mediamanager.c	Wed Sep 05 00:48:34 2007 +0000
+++ b/libpurple/mediamanager.c	Wed Sep 05 01:55:16 2007 +0000
@@ -98,12 +98,14 @@
 		0, NULL, NULL,
 		g_cclosure_marshal_VOID__OBJECT,
 		G_TYPE_NONE, 1, PURPLE_TYPE_MEDIA);
+	g_type_class_add_private(klass, sizeof(PurpleMediaManagerPrivate));
 }
 
 static void
 purple_media_manager_init (PurpleMediaManager *media)
 {
 	media->priv = PURPLE_MEDIA_MANAGER_GET_PRIVATE(media);
+	media->priv->medias = NULL;
 }
 
 static void
@@ -128,10 +130,10 @@
 				  const char *screenname)
 {
 	PurpleMedia *media = PURPLE_MEDIA(g_object_new(purple_media_get_type(),
-					  PROP_NAME, screenname,	
-					  PROP_CONNECTION, gc, NULL));
+					  "screenname", screenname,
+					  "connection", gc, NULL));
 	manager->priv->medias = g_list_append(manager->priv->medias, media);
-	g_signal_emit(manager, purple_media_manager_signals[NEW_MEDIA], 1, media);
+	g_signal_emit(manager, purple_media_manager_signals[NEW_MEDIA], 0, media);
 	return media;
 }
 
--- a/pidgin/gtkconv.c	Wed Sep 05 00:48:34 2007 +0000
+++ b/pidgin/gtkconv.c	Wed Sep 05 01:55:16 2007 +0000
@@ -45,6 +45,7 @@
 #include "idle.h"
 #include "imgstore.h"
 #include "log.h"
+#include "mediamanager.h"
 #include "notify.h"
 #include "prpl.h"
 #include "request.h"
@@ -7161,6 +7162,12 @@
 	pidgin_conv_update_fields(conv, PIDGIN_CONV_TOPIC);
 }
 
+static void
+pidgin_conv_new_media_cb(PurpleMedia *media, gpointer nul)
+{
+	purple_notify_info(pidgin_conversations_get_handle(), "Media!", "New Media!", "You got new media!\n");
+}
+
 void *
 pidgin_conversations_get_handle(void)
 {
@@ -7257,6 +7264,8 @@
 	purple_prefs_connect_callback(handle, PIDGIN_PREFS_ROOT "/conversations/im/hide_new",
                                 hide_new_pref_cb, NULL);
 
+	g_signal_connect(G_OBJECT(purple_media_manager_get()), "new-media",
+			 G_CALLBACK(pidgin_conv_new_media_cb), NULL);
 
 
 	/**********************************************************************