enum
{
PROP_MANAGER = 1,
+ PROP_MODEL,
PROP_SHOW_OFFLINE,
PROP_SHOW_GROUPS,
PROP_EMPTY,
gboolean empty;
EmpathyLiveSearch *search;
+
+ EmpathyRosterModel *model;
};
typedef struct
case PROP_MANAGER:
g_value_set_object (value, self->priv->manager);
break;
+ case PROP_MODEL:
+ g_value_set_object (value, self->priv->model);
+ break;
case PROP_SHOW_OFFLINE:
g_value_set_boolean (value, self->priv->show_offline);
break;
g_assert (self->priv->manager == NULL); /* construct only */
self->priv->manager = g_value_dup_object (value);
break;
+ case PROP_MODEL:
+ g_assert (self->priv->model == NULL);
+ self->priv->model = g_value_dup_object (value);
+ break;
case PROP_SHOW_OFFLINE:
empathy_roster_view_show_offline (self, g_value_get_boolean (value));
break;
{
GList *individuals, *l;
- individuals = empathy_individual_manager_get_members (self->priv->manager);
+ individuals = empathy_roster_model_get_individuals (self->priv->model);
for (l = individuals; l != NULL; l = g_list_next (l))
{
FolksIndividual *individual = l->data;
chain_up (object);
g_assert (EMPATHY_IS_INDIVIDUAL_MANAGER (self->priv->manager));
+ g_assert (EMPATHY_IS_ROSTER_MODEL (self->priv->model));
populate_view (self);
empathy_roster_view_set_live_search (self, NULL);
g_clear_object (&self->priv->manager);
+ g_clear_object (&self->priv->model);
if (chain_up != NULL)
chain_up (object);
G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS);
g_object_class_install_property (oclass, PROP_MANAGER, spec);
+ spec = g_param_spec_object ("model", "Model",
+ "EmpathyRosterModel",
+ EMPATHY_TYPE_ROSTER_MODEL,
+ G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS);
+ g_object_class_install_property (oclass, PROP_MODEL, spec);
+
spec = g_param_spec_boolean ("show-offline", "Show Offline",
"Show offline contacts",
FALSE,
}
GtkWidget *
-empathy_roster_view_new (EmpathyIndividualManager *manager)
+empathy_roster_view_new (EmpathyIndividualManager *manager,
+ EmpathyRosterModel *model)
{
g_return_val_if_fail (EMPATHY_IS_INDIVIDUAL_MANAGER (manager), NULL);
-
+ g_return_val_if_fail (EMPATHY_IS_ROSTER_MODEL (model), NULL);
+
return g_object_new (EMPATHY_TYPE_ROSTER_VIEW,
"manager", manager,
+ "model", model,
NULL);
}
#include <libempathy-gtk/empathy-live-search.h>
#include <libempathy/empathy-individual-manager.h>
+#include <libempathy-gtk/empathy-roster-model.h>
G_BEGIN_DECLS
EMPATHY_TYPE_ROSTER_VIEW, \
EmpathyRosterViewClass))
-GtkWidget * empathy_roster_view_new (EmpathyIndividualManager *manager);
+GtkWidget * empathy_roster_view_new (EmpathyIndividualManager *manager,
+ EmpathyRosterModel *model);
EmpathyIndividualManager * empathy_roster_view_get_manager (
EmpathyRosterView *self);
#include <libempathy/empathy-ft-factory.h>
#include <libempathy/empathy-ft-handler.h>
+#include <libempathy-gtk/empathy-roster-model.h>
+#include <libempathy-gtk/empathy-roster-model-manager.h>
#include <libempathy-gtk/empathy-contact-chooser.h>
#include <libempathy-gtk/empathy-ui-utils.h>
#include <libempathy-gtk/empathy-roster-view.h>
{
GtkWidget *roster_view, *box, *scrolled;
EmpathyIndividualManager *mgr;
-
+ EmpathyRosterModel *model;
+
box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 8);
mgr = empathy_individual_manager_dup_singleton ();
- roster_view = empathy_roster_view_new (mgr);
+ model = EMPATHY_ROSTER_MODEL (empathy_roster_model_manager_new (mgr));
+ roster_view = empathy_roster_view_new (mgr, model);
+ g_object_unref (model);
+
scrolled = gtk_scrolled_window_new (NULL, NULL);
g_object_unref (mgr);
#include <libempathy-gtk/empathy-gtk-enum-types.h>
#include <libempathy-gtk/empathy-individual-dialogs.h>
#include <libempathy-gtk/empathy-individual-store-manager.h>
+#include <libempathy-gtk/empathy-roster-model.h>
+#include <libempathy-gtk/empathy-roster-model-manager.h>
#include <libempathy-gtk/empathy-roster-view.h>
#include <libempathy-gtk/empathy-new-message-dialog.h>
#include <libempathy-gtk/empathy-new-call-dialog.h>
gchar *filename;
GtkWidget *search_vbox;
guint i;
+ EmpathyRosterModel *model;
self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self,
EMPATHY_TYPE_ROSTER_WINDOW, EmpathyRosterWindowPriv);
self->priv->individual_manager = empathy_individual_manager_dup_singleton ();
+ model = EMPATHY_ROSTER_MODEL (empathy_roster_model_manager_new (self->priv->individual_manager));
+
if (!empathy_individual_manager_get_contacts_loaded (
self->priv->individual_manager))
{
}
self->priv->view = EMPATHY_ROSTER_VIEW (
- empathy_roster_view_new (self->priv->individual_manager));
+ empathy_roster_view_new (self->priv->individual_manager,
+ model));
+
+ g_object_unref (model);
gtk_widget_show (GTK_WIDGET (self->priv->view));
#include <config.h>
+#include <libempathy-gtk/empathy-roster-model.h>
+#include <libempathy-gtk/empathy-roster-model-manager.h>
+
#include <libempathy-gtk/empathy-roster-view.h>
#include <libempathy-gtk/empathy-ui-utils.h>
EmpathyIndividualManager *mgr;
GError *error = NULL;
GOptionContext *context;
+ EmpathyRosterModel *model;
gtk_init (&argc, &argv);
empathy_gtk_init ();
mgr = empathy_individual_manager_dup_singleton ();
- view = empathy_roster_view_new (mgr);
+ model = EMPATHY_ROSTER_MODEL (empathy_roster_model_manager_new (mgr));
+ view = empathy_roster_view_new (mgr, model);
+ g_object_unref (model);
g_signal_connect (view, "individual-activated",
G_CALLBACK (individual_activated_cb), NULL);
g_signal_connect (view, "popup-individual-menu",