empathy r1205 - in trunk: data libempathy-gtk src



Author: xclaesse
Date: Tue Jul  8 10:58:19 2008
New Revision: 1205
URL: http://svn.gnome.org/viewvc/empathy?rev=1205&view=rev

Log:
Added support for the chat window to show the avatar as the icon. Fixes bug #526892 (Jonny Lamb)

Signed-off-by: Jonny Lamb <jonny lamb collabora co uk>


Modified:
   trunk/data/empathy.schemas.in
   trunk/libempathy-gtk/empathy-conf.h
   trunk/src/empathy-chat-window.c

Modified: trunk/data/empathy.schemas.in
==============================================================================
--- trunk/data/empathy.schemas.in	(original)
+++ trunk/data/empathy.schemas.in	Tue Jul  8 10:58:19 2008
@@ -247,6 +247,20 @@
     </schema>
 
     <schema>
+      <key>/schemas/apps/empathy/conversation/avatar_in_icon</key>
+      <applyto>/apps/empathy/conversation/avatar_in_icon</applyto>
+      <owner>empathy</owner>
+      <type>bool</type>
+      <default>false</default>
+      <locale name="C">
+        <short>Empathy should use the avatar of the contact as the chat window icon</short>
+	<long>
+	Whether or not Empathy should use the avatar of the contact as the chat window icon.
+        </long>
+      </locale>
+    </schema>
+
+    <schema>
       <key>/schemas/apps/empathy/hints/close_main_window</key>
       <applyto>/apps/empathy/hints/close_main_window</applyto>
       <owner>empathy</owner>

Modified: trunk/libempathy-gtk/empathy-conf.h
==============================================================================
--- trunk/libempathy-gtk/empathy-conf.h	(original)
+++ trunk/libempathy-gtk/empathy-conf.h	Tue Jul  8 10:58:19 2008
@@ -54,6 +54,7 @@
 #define EMPATHY_PREFS_CHAT_SPELL_CHECKER_LANGUAGES EMPATHY_PREFS_PATH "/conversation/spell_checker_languages"
 #define EMPATHY_PREFS_CHAT_SPELL_CHECKER_ENABLED   EMPATHY_PREFS_PATH "/conversation/spell_checker_enabled"
 #define EMPATHY_PREFS_CHAT_NICK_COMPLETION_CHAR    EMPATHY_PREFS_PATH "/conversation/nick_completion_char"
+#define EMPATHY_PREFS_CHAT_AVATAR_IN_ICON          EMPATHY_PREFS_PATH "/conversation/avatar_in_icon"
 #define EMPATHY_PREFS_UI_SEPARATE_CHAT_WINDOWS     EMPATHY_PREFS_PATH "/ui/separate_chat_windows"
 #define EMPATHY_PREFS_UI_MAIN_WINDOW_HIDDEN        EMPATHY_PREFS_PATH "/ui/main_window_hidden"
 #define EMPATHY_PREFS_UI_AVATAR_DIRECTORY          EMPATHY_PREFS_PATH "/ui/avatar_directory"

Modified: trunk/src/empathy-chat-window.c
==============================================================================
--- trunk/src/empathy-chat-window.c	(original)
+++ trunk/src/empathy-chat-window.c	Tue Jul  8 10:58:19 2008
@@ -287,6 +287,9 @@
 	gint                   page_num;
 	const gchar           *name;
 	guint                  n_chats;
+	GdkPixbuf             *icon;
+	EmpathyContact        *remote_contact;
+	gboolean               avatar_in_icon;
 
 	/* Get information */
 	page_num = gtk_notebook_get_current_page (GTK_NOTEBOOK (priv->notebook));
@@ -323,7 +326,18 @@
 		gtk_window_set_icon_name (GTK_WINDOW (priv->dialog),
 					  EMPATHY_IMAGE_MESSAGE);
 	} else {
-		gtk_window_set_icon_name (GTK_WINDOW (priv->dialog), NULL);
+		empathy_conf_get_bool (empathy_conf_get (),
+				       EMPATHY_PREFS_CHAT_AVATAR_IN_ICON,
+				       &avatar_in_icon);
+
+		if (n_chats == 1 && avatar_in_icon) {
+			remote_contact = empathy_chat_get_remote_contact (priv->current_chat);
+			icon = empathy_pixbuf_avatar_from_contact_scaled (remote_contact, 0, 0);
+			gtk_window_set_icon (GTK_WINDOW (priv->dialog), icon);
+			g_object_unref (icon);
+		} else {
+			gtk_window_set_icon_name (GTK_WINDOW (priv->dialog), NULL);
+		}
 	}
 }
 



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