diff options
author | Guillaume Desmottes <guillaume.desmottes@collabora.co.uk> | 2012-05-25 19:25:15 +0800 |
---|---|---|
committer | Guillaume Desmottes <guillaume.desmottes@collabora.co.uk> | 2012-06-14 15:21:48 +0800 |
commit | cfeb597b9cafbf61b950a0a3a76daff7ccf03f90 (patch) | |
tree | 8f9352b1eb16c4b7d9724261ba9933f44aa40f82 /libempathy-gtk | |
parent | 9b6edadbcbf706fe6d856d84e1631aaa74669625 (diff) | |
download | gsoc2013-empathy-cfeb597b9cafbf61b950a0a3a76daff7ccf03f90.tar gsoc2013-empathy-cfeb597b9cafbf61b950a0a3a76daff7ccf03f90.tar.gz gsoc2013-empathy-cfeb597b9cafbf61b950a0a3a76daff7ccf03f90.tar.bz2 gsoc2013-empathy-cfeb597b9cafbf61b950a0a3a76daff7ccf03f90.tar.lz gsoc2013-empathy-cfeb597b9cafbf61b950a0a3a76daff7ccf03f90.tar.xz gsoc2013-empathy-cfeb597b9cafbf61b950a0a3a76daff7ccf03f90.tar.zst gsoc2013-empathy-cfeb597b9cafbf61b950a0a3a76daff7ccf03f90.zip |
roster-view: add 'show-groups' property
Not implemented yet.
Diffstat (limited to 'libempathy-gtk')
-rw-r--r-- | libempathy-gtk/empathy-roster-view.c | 38 | ||||
-rw-r--r-- | libempathy-gtk/empathy-roster-view.h | 3 |
2 files changed, 41 insertions, 0 deletions
diff --git a/libempathy-gtk/empathy-roster-view.c b/libempathy-gtk/empathy-roster-view.c index 95b1498d2..793832ad6 100644 --- a/libempathy-gtk/empathy-roster-view.c +++ b/libempathy-gtk/empathy-roster-view.c @@ -11,6 +11,7 @@ enum { PROP_MANAGER = 1, PROP_SHOW_OFFLINE, + PROP_SHOW_GROUPS, N_PROPS }; @@ -31,6 +32,7 @@ struct _EmpathyRosterViewPriv GHashTable *items; gboolean show_offline; + gboolean show_groups; }; static void @@ -49,6 +51,9 @@ empathy_roster_view_get_property (GObject *object, case PROP_SHOW_OFFLINE: g_value_set_boolean (value, self->priv->show_offline); break; + case PROP_SHOW_GROUPS: + g_value_set_boolean (value, self->priv->show_groups); + break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; @@ -72,6 +77,9 @@ empathy_roster_view_set_property (GObject *object, case PROP_SHOW_OFFLINE: empathy_roster_view_show_offline (self, g_value_get_boolean (value)); break; + case PROP_SHOW_GROUPS: + empathy_roster_view_show_groups (self, g_value_get_boolean (value)); + break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; @@ -295,6 +303,12 @@ empathy_roster_view_class_init ( G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (oclass, PROP_SHOW_OFFLINE, spec); + spec = g_param_spec_boolean ("show-groups", "Show Groups", + "Show groups", + FALSE, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); + g_object_class_install_property (oclass, PROP_SHOW_GROUPS, spec); + g_type_class_add_private (klass, sizeof (EmpathyRosterViewPriv)); } @@ -335,3 +349,27 @@ empathy_roster_view_show_offline (EmpathyRosterView *self, g_object_notify (G_OBJECT (self), "show-offline"); } + +static void +clear_view (EmpathyRosterView *self) +{ + gtk_container_foreach (GTK_CONTAINER (self), + (GtkCallback) gtk_widget_destroy, NULL); + + g_hash_table_remove_all (self->priv->items); +} + +void +empathy_roster_view_show_groups (EmpathyRosterView *self, + gboolean show) +{ + if (self->priv->show_groups == show) + return; + + self->priv->show_groups = show; + + clear_view (self); + populate_view (self); + + g_object_notify (G_OBJECT (self), "show-groups"); +} diff --git a/libempathy-gtk/empathy-roster-view.h b/libempathy-gtk/empathy-roster-view.h index 57fb8094b..8706da351 100644 --- a/libempathy-gtk/empathy-roster-view.h +++ b/libempathy-gtk/empathy-roster-view.h @@ -56,6 +56,9 @@ EmpathyIndividualManager * empathy_roster_view_get_manager ( void empathy_roster_view_show_offline (EmpathyRosterView *self, gboolean show); +void empathy_roster_view_show_groups (EmpathyRosterView *self, + gboolean show); + G_END_DECLS #endif /* #ifndef __EMPATHY_ROSTER_VIEW_H__*/ |