[empathy] tpaw-images: move the default avatar definition from Empathy to tp-aw



commit 6338748568d1a37c423568e91e60eb838188a3c2
Author: Marco Barisione <marco barisione collabora co uk>
Date:   Tue Jul 30 13:52:30 2013 +0100

    tpaw-images: move the default avatar definition from Empathy to tp-aw
    
    https://bugzilla.gnome.org/show_bug.cgi?id=699492

 libempathy-gtk/empathy-avatar-chooser.c |    4 ++--
 libempathy-gtk/empathy-images.h         |    1 -
 libempathy-gtk/empathy-log-window.c     |    3 ++-
 libempathy-gtk/empathy-roster-contact.c |    4 ++--
 libempathy-gtk/empathy-theme-adium.c    |    3 ++-
 src/empathy-call-observer.c             |    4 ++--
 src/empathy-call-window.c               |    3 ++-
 src/empathy-event-manager.c             |    5 +++--
 tp-account-widgets/Makefile.am          |    1 +
 tp-account-widgets/tpaw-images.h        |   31 +++++++++++++++++++++++++++++++
 10 files changed, 47 insertions(+), 12 deletions(-)
---
diff --git a/libempathy-gtk/empathy-avatar-chooser.c b/libempathy-gtk/empathy-avatar-chooser.c
index f6a423d..60556ff 100644
--- a/libempathy-gtk/empathy-avatar-chooser.c
+++ b/libempathy-gtk/empathy-avatar-chooser.c
@@ -26,12 +26,12 @@
 #include <glib/gi18n-lib.h>
 #include <tp-account-widgets/tpaw-camera-monitor.h>
 #include <tp-account-widgets/tpaw-gsettings.h>
+#include <tp-account-widgets/tpaw-images.h>
 
 #ifdef HAVE_CHEESE
 #include <cheese-avatar-chooser.h>
 #endif /* HAVE_CHEESE */
 
-#include "empathy-images.h"
 #include "empathy-ui-utils.h"
 #include "empathy-utils.h"
 
@@ -349,7 +349,7 @@ avatar_chooser_clear_image (EmpathyAvatarChooser *self)
   tp_clear_pointer (&self->priv->mime_type, g_free);
   self->priv->changed = TRUE;
 
-  image = gtk_image_new_from_icon_name (EMPATHY_IMAGE_AVATAR_DEFAULT,
+  image = gtk_image_new_from_icon_name (TPAW_IMAGE_AVATAR_DEFAULT,
     GTK_ICON_SIZE_DIALOG);
   gtk_button_set_image (GTK_BUTTON (self), image);
 }
diff --git a/libempathy-gtk/empathy-images.h b/libempathy-gtk/empathy-images.h
index 8ee40f2..3b7b8fd 100644
--- a/libempathy-gtk/empathy-images.h
+++ b/libempathy-gtk/empathy-images.h
@@ -45,7 +45,6 @@ G_BEGIN_DECLS
 #define EMPATHY_IMAGE_VIDEO_CALL          "camera-web"
 #define EMPATHY_IMAGE_LOG                 "document-open-recent"
 #define EMPATHY_IMAGE_DOCUMENT_SEND       "document-send"
-#define EMPATHY_IMAGE_AVATAR_DEFAULT      "avatar-default-symbolic"
 /* FIXME: need a better icon! */
 #define EMPATHY_IMAGE_EDIT_MESSAGE        "format-text-direction-ltr"
 #define EMPATHY_IMAGE_MIC                 "audio-input-microphone-symbolic"
diff --git a/libempathy-gtk/empathy-log-window.c b/libempathy-gtk/empathy-log-window.c
index 9094f69..f294502 100644
--- a/libempathy-gtk/empathy-log-window.c
+++ b/libempathy-gtk/empathy-log-window.c
@@ -28,6 +28,7 @@
 #include <glib/gi18n-lib.h>
 #include <telepathy-glib/proxy-subclass.h>
 #include <tp-account-widgets/tpaw-builder.h>
+#include <tp-account-widgets/tpaw-images.h>
 #include <tp-account-widgets/tpaw-camera-monitor.h>
 
 #include "action-chain-internal.h"
@@ -1875,7 +1876,7 @@ add_event_to_store (EmpathyLogWindow *self,
   gtk_list_store_insert_with_values (store, NULL, -1,
       COL_WHO_TYPE, COL_TYPE_NORMAL,
       COL_WHO_ICON, room ? EMPATHY_IMAGE_GROUP_MESSAGE
-                         : EMPATHY_IMAGE_AVATAR_DEFAULT,
+                         : TPAW_IMAGE_AVATAR_DEFAULT,
       COL_WHO_NAME, name,
       COL_WHO_NAME_SORT_KEY, sort_key,
       COL_WHO_ID, tpl_entity_get_identifier (entity),
diff --git a/libempathy-gtk/empathy-roster-contact.c b/libempathy-gtk/empathy-roster-contact.c
index 2db024a..22b3600 100644
--- a/libempathy-gtk/empathy-roster-contact.c
+++ b/libempathy-gtk/empathy-roster-contact.c
@@ -2,8 +2,8 @@
 #include "empathy-roster-contact.h"
 
 #include <glib/gi18n-lib.h>
+#include <tp-account-widgets/tpaw-images.h>
 
-#include "empathy-images.h"
 #include "empathy-ui-utils.h"
 #include "empathy-utils.h"
 
@@ -125,7 +125,7 @@ avatar_loaded_cb (GObject *source,
   if (pixbuf == NULL)
     {
       pixbuf = empathy_pixbuf_from_icon_name_sized (
-          EMPATHY_IMAGE_AVATAR_DEFAULT, AVATAR_SIZE);
+          TPAW_IMAGE_AVATAR_DEFAULT, AVATAR_SIZE);
     }
 
   gtk_image_set_from_pixbuf (GTK_IMAGE (self->priv->avatar), pixbuf);
diff --git a/libempathy-gtk/empathy-theme-adium.c b/libempathy-gtk/empathy-theme-adium.c
index 721a0b4..5fd61d3 100644
--- a/libempathy-gtk/empathy-theme-adium.c
+++ b/libempathy-gtk/empathy-theme-adium.c
@@ -23,6 +23,7 @@
 #include "empathy-theme-adium.h"
 
 #include <glib/gi18n-lib.h>
+#include <tp-account-widgets/tpaw-images.h>
 #include <tp-account-widgets/tpaw-time.h>
 #include <tp-account-widgets/tpaw-utils.h>
 
@@ -953,7 +954,7 @@ theme_adium_add_message (EmpathyThemeAdium *self,
         {
           if (!self->priv->data->default_avatar_filename)
             self->priv->data->default_avatar_filename =
-              empathy_filename_from_icon_name (EMPATHY_IMAGE_AVATAR_DEFAULT,
+              empathy_filename_from_icon_name (TPAW_IMAGE_AVATAR_DEFAULT,
                        GTK_ICON_SIZE_DIALOG);
 
           avatar_filename = self->priv->data->default_avatar_filename;
diff --git a/src/empathy-call-observer.c b/src/empathy-call-observer.c
index 41e9bdf..733199c 100644
--- a/src/empathy-call-observer.c
+++ b/src/empathy-call-observer.c
@@ -22,8 +22,8 @@
 #include "empathy-call-observer.h"
 
 #include <glib/gi18n-lib.h>
+#include <tp-account-widgets/tpaw-images.h>
 
-#include "empathy-images.h"
 #include "empathy-notify-manager.h"
 
 #define DEBUG_FLAG EMPATHY_DEBUG_VOIP
@@ -115,7 +115,7 @@ display_reject_notification (EmpathyCallObserver *self,
 
   emp_contact = empathy_contact_dup_from_tp_contact (contact);
   pixbuf = empathy_notify_manager_get_pixbuf_for_notification (
-      self->priv->notify_mgr, emp_contact, EMPATHY_IMAGE_AVATAR_DEFAULT);
+      self->priv->notify_mgr, emp_contact, TPAW_IMAGE_AVATAR_DEFAULT);
 
   if (pixbuf != NULL)
     {
diff --git a/src/empathy-call-window.c b/src/empathy-call-window.c
index cac15bc..5f10d91 100644
--- a/src/empathy-call-window.c
+++ b/src/empathy-call-window.c
@@ -27,6 +27,7 @@
 #include <farstream/fs-utils.h>
 #include <tp-account-widgets/tpaw-builder.h>
 #include <tp-account-widgets/tpaw-camera-monitor.h>
+#include <tp-account-widgets/tpaw-images.h>
 
 #include "empathy-about-dialog.h"
 #include "empathy-audio-sink.h"
@@ -1892,7 +1893,7 @@ init_contact_avatar_with_size (EmpathyContact *contact,
   if (pixbuf_avatar == NULL)
     {
       pixbuf_avatar = empathy_pixbuf_from_icon_name_sized (
-          EMPATHY_IMAGE_AVATAR_DEFAULT, size);
+          TPAW_IMAGE_AVATAR_DEFAULT, size);
     }
 
   gtk_image_set_from_pixbuf (GTK_IMAGE (image_widget), pixbuf_avatar);
diff --git a/src/empathy-event-manager.c b/src/empathy-event-manager.c
index fd6e659..f2d1975 100644
--- a/src/empathy-event-manager.c
+++ b/src/empathy-event-manager.c
@@ -23,6 +23,7 @@
 #include "empathy-event-manager.h"
 
 #include <glib/gi18n.h>
+#include <tp-account-widgets/tpaw-images.h>
 
 #include "empathy-call-utils.h"
 #include "empathy-connection-aggregator.h"
@@ -1165,7 +1166,7 @@ check_presence (EmpathyEventManager *manager,
             {
               event_manager_add (manager, NULL, contact,
                   EMPATHY_EVENT_TYPE_PRESENCE_OFFLINE,
-                  EMPATHY_IMAGE_AVATAR_DEFAULT,
+                  TPAW_IMAGE_AVATAR_DEFAULT,
                   empathy_contact_get_alias (contact), _("Disconnected"),
                   NULL, NULL, NULL);
             }
@@ -1186,7 +1187,7 @@ check_presence (EmpathyEventManager *manager,
             {
               event_manager_add (manager, NULL, contact,
                   EMPATHY_EVENT_TYPE_PRESENCE_ONLINE,
-                  EMPATHY_IMAGE_AVATAR_DEFAULT,
+                  TPAW_IMAGE_AVATAR_DEFAULT,
                   empathy_contact_get_alias (contact), _("Connected"),
                   NULL, NULL, NULL);
             }
diff --git a/tp-account-widgets/Makefile.am b/tp-account-widgets/Makefile.am
index 89e9a51..8ef8b4a 100644
--- a/tp-account-widgets/Makefile.am
+++ b/tp-account-widgets/Makefile.am
@@ -56,6 +56,7 @@ libtp_account_widgets_headers =                       \
        tpaw-connection-managers.h              \
        tpaw-contactinfo-utils.h                \
        tpaw-gsettings.h                        \
+       tpaw-images.h                           \
        tpaw-keyring.h                          \
        tpaw-irc-network-chooser-dialog.h       \
        tpaw-irc-network-chooser.h              \
diff --git a/tp-account-widgets/tpaw-images.h b/tp-account-widgets/tpaw-images.h
new file mode 100644
index 0000000..48bc4cb
--- /dev/null
+++ b/tp-account-widgets/tpaw-images.h
@@ -0,0 +1,31 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+/*
+ * Copyright (C) 2007-2008 Collabora Ltd.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ *
+ * Authors: Xavier Claessens <xclaesse gmail com>
+ */
+
+#ifndef __TPAW_IMAGES_H__
+#define __TPAW_IMAGES_H__
+
+G_BEGIN_DECLS
+
+#define TPAW_IMAGE_AVATAR_DEFAULT      "avatar-default-symbolic"
+
+G_END_DECLS
+
+#endif /* __TPAW_IMAGES_ICONS_H__ */


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