-#include <config.h>
+#include "config.h"
-#include <libempathy-gtk/empathy-roster-view.h>
-#include <libempathy-gtk/empathy-ui-utils.h>
+#include "empathy-roster-model.h"
+#include "empathy-roster-model-manager.h"
+#include "empathy-roster-view.h"
+#include "empathy-ui-utils.h"
static gboolean show_offline = FALSE;
static gboolean show_groups = FALSE;
static void
popup_individual_menu_cb (EmpathyRosterView *self,
+ const gchar *group,
FolksIndividual *individual,
guint button,
guint time,
{
GtkWidget *menu, *item;
- g_print ("'%s' popup menu\n",
- folks_alias_details_get_alias (FOLKS_ALIAS_DETAILS (individual)));
+ g_print ("'%s' (group: %s) popup menu\n",
+ folks_alias_details_get_alias (FOLKS_ALIAS_DETAILS (individual)), group);
menu = gtk_menu_new ();
return TRUE;
}
+static void
+empty_cb (EmpathyRosterView *view,
+ GParamSpec *spec,
+ gpointer user_data)
+{
+ if (empathy_roster_view_is_empty (view))
+ g_print ("view is now empty\n");
+ else
+ g_print ("view is no longer empty\n");
+}
+
int
main (int argc,
char **argv)
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 (model);
+ g_object_unref (model);
g_signal_connect (view, "individual-activated",
G_CALLBACK (individual_activated_cb), NULL);
g_signal_connect (view, "popup-individual-menu",
G_CALLBACK (popup_individual_menu_cb), NULL);
+ g_signal_connect (view, "notify::empty",
+ G_CALLBACK (empty_cb), NULL);
+ g_signal_connect (view, "individual-tooltip",
+ G_CALLBACK (individual_tooltip_cb), NULL);
+
+ gtk_widget_set_has_tooltip (view, TRUE);
empathy_roster_view_show_offline (EMPATHY_ROSTER_VIEW (view), show_offline);
empathy_roster_view_show_groups (EMPATHY_ROSTER_VIEW (view), show_groups);
- empathy_roster_view_set_individual_tooltip_cb (EMPATHY_ROSTER_VIEW (view),
- individual_tooltip_cb, NULL);
-
g_object_unref (mgr);
- search = empathy_live_search_new (view);
+ search = tpaw_live_search_new (view);
empathy_roster_view_set_live_search (EMPATHY_ROSTER_VIEW (view),
- EMPATHY_LIVE_SEARCH (search));
+ TPAW_LIVE_SEARCH (search));
scrolled = gtk_scrolled_window_new (NULL, NULL);
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolled),
GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC);
- egg_list_box_add_to_scrolled (EGG_LIST_BOX (view),
- GTK_SCROLLED_WINDOW (scrolled));
+ gtk_container_add (GTK_CONTAINER (scrolled), view);
gtk_box_pack_start (GTK_BOX (box), search, FALSE, TRUE, 0);
gtk_box_pack_start (GTK_BOX (box), scrolled, TRUE, TRUE, 0);