From 3104dbf1c0c85dba347afcc409ee4e8d5cc16018 Mon Sep 17 00:00:00 2001 From: Xavier Claessens Date: Tue, 11 Mar 2008 08:29:04 +0000 Subject: Merge commit 'bari/disable-avatars-opt-if-compact' svn path=/trunk/; revision=732 --- libempathy-gtk/empathy-preferences.c | 40 ++++++++++++++++++++++++++------ libempathy-gtk/empathy-preferences.glade | 14 +++++------ 2 files changed, 40 insertions(+), 14 deletions(-) (limited to 'libempathy-gtk') diff --git a/libempathy-gtk/empathy-preferences.c b/libempathy-gtk/empathy-preferences.c index 50c9d5660..bd28ddd50 100644 --- a/libempathy-gtk/empathy-preferences.c +++ b/libempathy-gtk/empathy-preferences.c @@ -150,9 +150,31 @@ enum { COL_COMBO_COUNT }; +static void +preferences_add_id (EmpathyPreferences *preferences, guint id) +{ + preferences->notify_ids = g_list_prepend (preferences->notify_ids, + GUINT_TO_POINTER (id)); +} + +static void +preferences_compact_contact_list_changed_cb (EmpathyConf *conf, + const gchar *key, + gpointer user_data) +{ + EmpathyPreferences *preferences = user_data; + gboolean value; + + if (empathy_conf_get_bool (empathy_conf_get (), key, &value)) { + gtk_widget_set_sensitive (preferences->checkbutton_show_avatars, !value); + } +} + static void preferences_setup_widgets (EmpathyPreferences *preferences) { + guint id; + preferences_hookup_toggle_button (preferences, EMPATHY_PREFS_SOUNDS_FOR_MESSAGES, preferences->checkbutton_sounds_for_messages); @@ -204,6 +226,17 @@ preferences_setup_widgets (EmpathyPreferences *preferences) preferences_hookup_toggle_button (preferences, EMPATHY_PREFS_AUTOCONNECT, preferences->checkbutton_autoconnect); + + id = empathy_conf_notify_add (empathy_conf_get (), + EMPATHY_PREFS_UI_COMPACT_CONTACT_LIST, + preferences_compact_contact_list_changed_cb, + preferences); + if (id) { + preferences_add_id (preferences, id); + } + preferences_compact_contact_list_changed_cb (empathy_conf_get (), + EMPATHY_PREFS_UI_COMPACT_CONTACT_LIST, + preferences); } static void @@ -623,13 +656,6 @@ preferences_notify_sensitivity_cb (EmpathyConf *conf, } } -static void -preferences_add_id (EmpathyPreferences *preferences, guint id) -{ - preferences->notify_ids = g_list_prepend (preferences->notify_ids, - GUINT_TO_POINTER (id)); -} - static void preferences_hookup_spin_button (EmpathyPreferences *preferences, const gchar *key, diff --git a/libempathy-gtk/empathy-preferences.glade b/libempathy-gtk/empathy-preferences.glade index 725844491..cc27e48b6 100644 --- a/libempathy-gtk/empathy-preferences.glade +++ b/libempathy-gtk/empathy-preferences.glade @@ -97,15 +97,14 @@ 6 - + True - Avatars are user chosen images shown in the contact list True - Show _avatars + Show co_mpact contact list True GTK_RELIEF_NORMAL True - True + False False True @@ -117,14 +116,15 @@ - + True + Avatars are user chosen images shown in the contact list True - Show co_mpact contact list + Show _avatars True GTK_RELIEF_NORMAL True - False + True False True -- cgit v1.2.3