[empathy] Add a gsetting key to show/hide groups



commit b02e1667ba8c6e2af128ae461de082ea839dff56
Author: Guillaume Desmottes <guillaume desmottes collabora co uk>
Date:   Fri Nov 25 14:44:09 2011 +0100

    Add a gsetting key to show/hide groups
    
    https://bugzilla.gnome.org/show_bug.cgi?id=627658

 data/org.gnome.Empathy.gschema.xml.in |    5 +++++
 libempathy/empathy-gsettings.h        |    1 +
 src/empathy-roster-window.c           |    3 +++
 3 files changed, 9 insertions(+), 0 deletions(-)
---
diff --git a/data/org.gnome.Empathy.gschema.xml.in b/data/org.gnome.Empathy.gschema.xml.in
index 02020e7..d107a9b 100644
--- a/data/org.gnome.Empathy.gschema.xml.in
+++ b/data/org.gnome.Empathy.gschema.xml.in
@@ -88,6 +88,11 @@ present them to the user immediately.</_description>
       <_summary>The position for the chat window side pane</_summary>
       <_description>The stored position (in pixels) of the chat window side pane.</_description>
     </key>
+    <key name="show-groups" type="b">
+      <default>true</default>
+      <_summary>Show contact groups</_summary>
+      <_description>Whether to show groups in the contact list.</_description>
+    </key>
   </schema>
   <schema id="org.gnome.Empathy.contacts" path="/org/gnome/empathy/contacts/">
     <key name="sort-criterium" type="s">
diff --git a/libempathy/empathy-gsettings.h b/libempathy/empathy-gsettings.h
index ad55a94..6206a54 100644
--- a/libempathy/empathy-gsettings.h
+++ b/libempathy/empathy-gsettings.h
@@ -77,6 +77,7 @@ G_BEGIN_DECLS
 #define EMPATHY_PREFS_UI_COMPACT_CONTACT_LIST      "compact-contact-list"
 #define EMPATHY_PREFS_UI_CHAT_WINDOW_PANED_POS     "chat-window-paned-pos"
 #define EMPATHY_PREFS_UI_SHOW_OFFLINE              "show-offline"
+#define EMPATHY_PREFS_UI_SHOW_GROUPS               "show-groups"
 
 #define EMPATHY_PREFS_CONTACTS_SCHEMA EMPATHY_PREFS_SCHEMA ".contacts"
 #define EMPATHY_PREFS_CONTACTS_SORT_CRITERIUM      "sort-criterium"
diff --git a/src/empathy-roster-window.c b/src/empathy-roster-window.c
index 079ac51..8219f79 100644
--- a/src/empathy-roster-window.c
+++ b/src/empathy-roster-window.c
@@ -2634,6 +2634,9 @@ empathy_roster_window_init (EmpathyRosterWindow *self)
       self->priv->balance_vbox, "visible",
       G_BINDING_SYNC_CREATE);
 
+  g_settings_bind (self->priv->gsettings_ui, "show-groups",
+      self->priv->individual_store, "show-groups", G_SETTINGS_BIND_DEFAULT);
+
   /* Enable event handling */
   self->priv->call_observer = empathy_call_observer_dup_singleton ();
   self->priv->event_manager = empathy_event_manager_dup_singleton ();



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