[empathy] change empathy_misc_get_pixbuf_for_notification to empathy_notify_manager_get_pixbuf_for_notificatio



commit ab3c9ccb3c468f03ddc790bb2e5a84845684bfc5
Author: Guillaume Desmottes <guillaume desmottes collabora co uk>
Date:   Thu Nov 12 12:53:57 2009 +0000

    change empathy_misc_get_pixbuf_for_notification to empathy_notify_manager_get_pixbuf_for_notification
    
    Making this function a method of EmpathyNotifyManager would allow us to
    tweak the size of the icon depending on the notifications server as
    suggested in bug 588054.

 libempathy-gtk/empathy-notify-manager.c |    3 ++-
 libempathy-gtk/empathy-notify-manager.h |    6 ++++--
 src/empathy-chat-window.c               |    7 ++++++-
 src/empathy-status-icon.c               |    3 ++-
 4 files changed, 14 insertions(+), 5 deletions(-)
---
diff --git a/libempathy-gtk/empathy-notify-manager.c b/libempathy-gtk/empathy-notify-manager.c
index 44f7793..7954dd9 100644
--- a/libempathy-gtk/empathy-notify-manager.c
+++ b/libempathy-gtk/empathy-notify-manager.c
@@ -146,7 +146,8 @@ empathy_notify_manager_has_capability (EmpathyNotifyManager *self,
 }
 
 GdkPixbuf *
-empathy_misc_get_pixbuf_for_notification (EmpathyContact *contact,
+empathy_notify_manager_get_pixbuf_for_notification (EmpathyNotifyManager *self,
+    EmpathyContact *contact,
     const char *icon_name)
 {
   GdkPixbuf *pixbuf = NULL;
diff --git a/libempathy-gtk/empathy-notify-manager.h b/libempathy-gtk/empathy-notify-manager.h
index d56e508..1574046 100644
--- a/libempathy-gtk/empathy-notify-manager.h
+++ b/libempathy-gtk/empathy-notify-manager.h
@@ -83,9 +83,11 @@ gboolean empathy_notify_manager_has_capability (EmpathyNotifyManager *self,
     const gchar *capa);
 
 gboolean empathy_notification_is_enabled  (void);
-GdkPixbuf * empathy_misc_get_pixbuf_for_notification (EmpathyContact *contact,
-    const char *icon_name);
 
+GdkPixbuf * empathy_notify_manager_get_pixbuf_for_notification (
+    EmpathyNotifyManager *self,
+    EmpathyContact *contact,
+    const char *icon_name);
 
 G_END_DECLS
 
diff --git a/src/empathy-chat-window.c b/src/empathy-chat-window.c
index 6d69235..fc64d34 100644
--- a/src/empathy-chat-window.c
+++ b/src/empathy-chat-window.c
@@ -75,6 +75,7 @@ typedef struct {
 	gboolean     dnd_same_window;
 	guint        save_geometry_id;
 	EmpathyChatroomManager *chatroom_manager;
+	EmpathyNotifyManager *notify_mgr;
 	GtkWidget   *dialog;
 	GtkWidget   *notebook;
 	NotifyNotification *notification;
@@ -1111,7 +1112,8 @@ chat_window_show_or_update_notification (EmpathyChatWindow *window,
 				  G_CALLBACK (chat_window_notification_closed_cb), cb_data);
 	}
 
-	pixbuf = empathy_misc_get_pixbuf_for_notification (sender, EMPATHY_IMAGE_NEW_MESSAGE);
+	pixbuf = empathy_notify_manager_get_pixbuf_for_notification (priv->notify_mgr,
+		sender, EMPATHY_IMAGE_NEW_MESSAGE);
 
 	if (pixbuf != NULL) {
 		notify_notification_set_icon_from_pixbuf (priv->notification, pixbuf);
@@ -1508,6 +1510,7 @@ chat_window_finalize (GObject *object)
 
 	g_object_unref (priv->ui_manager);
 	g_object_unref (priv->chatroom_manager);
+	g_object_unref (priv->notify_mgr);
 	if (priv->save_geometry_id != 0) {
 		g_source_remove (priv->save_geometry_id);
 		chat_window_save_geometry_timeout_cb (window);
@@ -1690,6 +1693,8 @@ empathy_chat_window_init (EmpathyChatWindow *window)
 	priv->chats_new_msg = NULL;
 	priv->chats_composing = NULL;
 	priv->current_chat = NULL;
+
+	priv->notify_mgr = empathy_notify_manager_dup_singleton ();
 }
 
 EmpathyChatWindow *
diff --git a/src/empathy-status-icon.c b/src/empathy-status-icon.c
index aaf827d..76c549e 100644
--- a/src/empathy-status-icon.c
+++ b/src/empathy-status-icon.c
@@ -187,7 +187,8 @@ status_icon_update_notification (EmpathyStatusIcon *icon)
 					  G_CALLBACK (status_icon_notification_closed_cb), icon);
 		}
 
-		pixbuf = empathy_misc_get_pixbuf_for_notification (priv->event->contact,
+		pixbuf = empathy_notify_manager_get_pixbuf_for_notification (
+								   priv->notify_mgr, priv->event->contact,
 								   priv->event->icon_name);
 
 		if (pixbuf != NULL) {



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]