aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy-gtk
diff options
context:
space:
mode:
authorWill Thompson <will.thompson@collabora.co.uk>2012-06-27 17:42:56 +0800
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2012-06-28 16:56:30 +0800
commitdb4d1607aa0ee6988399f99efc09bed5e7133dc8 (patch)
tree2407273c29162274d2584ea550a047833d3186f3 /libempathy-gtk
parent13a16f024f65bdfd899298d0278e0166ca781e7e (diff)
downloadgsoc2013-empathy-db4d1607aa0ee6988399f99efc09bed5e7133dc8.tar.gz
gsoc2013-empathy-db4d1607aa0ee6988399f99efc09bed5e7133dc8.tar.zst
gsoc2013-empathy-db4d1607aa0ee6988399f99efc09bed5e7133dc8.zip
Adium themes: implement set_show_avatars()
https://bugzilla.gnome.org/show_bug.cgi?id=627948
Diffstat (limited to 'libempathy-gtk')
-rw-r--r--libempathy-gtk/empathy-theme-adium.c19
1 files changed, 16 insertions, 3 deletions
diff --git a/libempathy-gtk/empathy-theme-adium.c b/libempathy-gtk/empathy-theme-adium.c
index b77d1cf8b..485d361f6 100644
--- a/libempathy-gtk/empathy-theme-adium.c
+++ b/libempathy-gtk/empathy-theme-adium.c
@@ -74,6 +74,7 @@ typedef struct {
gboolean allow_scrolling;
gchar *variant;
gboolean in_construction;
+ gboolean show_avatars;
} EmpathyThemeAdiumPriv;
struct _EmpathyAdiumData {
@@ -642,9 +643,7 @@ theme_adium_append_html (EmpathyThemeAdium *theme,
* will become "Alternating_Messages_-_Blue_Red".
*/
} else if (theme_adium_match (&cur, "%userIcons%")) {
- /* FIXME: mus t be "hideIcons" if use preference is set
- * to hide avatars */
- replace = "showIcons";
+ replace = priv->show_avatars ? "showIcons" : "hideIcons";
} else if (theme_adium_match (&cur, "%messageClasses%")) {
replace = message_classes;
} else if (theme_adium_match (&cur, "%status%")) {
@@ -1314,6 +1313,16 @@ theme_adium_button_press_event (GtkWidget *widget, GdkEventButton *event)
}
static void
+theme_adium_set_show_avatars (EmpathyChatView *view,
+ gboolean show_avatars)
+{
+ EmpathyThemeAdium *theme = EMPATHY_THEME_ADIUM (view);
+ EmpathyThemeAdiumPriv *priv = GET_PRIV (theme);
+
+ priv->show_avatars = show_avatars;
+}
+
+static void
theme_adium_iface_init (EmpathyChatViewIface *iface)
{
iface->append_message = theme_adium_append_message;
@@ -1331,6 +1340,7 @@ theme_adium_iface_init (EmpathyChatViewIface *iface)
iface->copy_clipboard = theme_adium_copy_clipboard;
iface->focus_toggled = theme_adium_focus_toggled;
iface->message_acknowledged = theme_adium_message_acknowledged;
+ iface->set_show_avatars = theme_adium_set_show_avatars;
}
static void
@@ -1614,6 +1624,9 @@ empathy_theme_adium_init (EmpathyThemeAdium *theme)
priv->allow_scrolling = TRUE;
priv->smiley_manager = empathy_smiley_manager_dup_singleton ();
+ /* Show avatars by default. */
+ priv->show_avatars = TRUE;
+
g_signal_connect (theme, "load-finished",
G_CALLBACK (theme_adium_load_finished_cb),
NULL);