]> git.0d.be Git - empathy.git/commitdiff
Merge commit 'bari/disable-avatars-opt-if-compact'
authorXavier Claessens <xclaesse@src.gnome.org>
Tue, 11 Mar 2008 08:29:04 +0000 (08:29 +0000)
committerXavier Claessens <xclaesse@src.gnome.org>
Tue, 11 Mar 2008 08:29:04 +0000 (08:29 +0000)
svn path=/trunk/; revision=732

libempathy-gtk/empathy-preferences.c
libempathy-gtk/empathy-preferences.glade

index 50c9d566090d84e3ac31edf3dee392006906ee09..bd28ddd503c8a6e01dbc7c74a7a88472cd58dd79 100644 (file)
@@ -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,
index 725844491f3c8ea630b47c9fa9e019cb06338782..cc27e48b6a63d254701f94d38248aae92b48fda7 100644 (file)
                          <property name="spacing">6</property>
 
                          <child>
-                           <widget class="GtkCheckButton" id="checkbutton_show_avatars">
+                           <widget class="GtkCheckButton" id="checkbutton_compact_contact_list">
                              <property name="visible">True</property>
-                             <property name="tooltip" translatable="yes">Avatars are user chosen images shown in the contact list</property>
                              <property name="can_focus">True</property>
-                             <property name="label" translatable="yes">Show _avatars</property>
+                             <property name="label" translatable="yes">Show co_mpact contact list</property>
                              <property name="use_underline">True</property>
                              <property name="relief">GTK_RELIEF_NORMAL</property>
                              <property name="focus_on_click">True</property>
-                             <property name="active">True</property>
+                             <property name="active">False</property>
                              <property name="inconsistent">False</property>
                              <property name="draw_indicator">True</property>
                            </widget>
                          </child>
 
                          <child>
-                           <widget class="GtkCheckButton" id="checkbutton_compact_contact_list">
+                           <widget class="GtkCheckButton" id="checkbutton_show_avatars">
                              <property name="visible">True</property>
+                             <property name="tooltip" translatable="yes">Avatars are user chosen images shown in the contact list</property>
                              <property name="can_focus">True</property>
-                             <property name="label" translatable="yes">Show co_mpact contact list</property>
+                             <property name="label" translatable="yes">Show _avatars</property>
                              <property name="use_underline">True</property>
                              <property name="relief">GTK_RELIEF_NORMAL</property>
                              <property name="focus_on_click">True</property>
-                             <property name="active">False</property>
+                             <property name="active">True</property>
                              <property name="inconsistent">False</property>
                              <property name="draw_indicator">True</property>
                            </widget>