From 8f36eb3772ad0aca0a88e5181b22ec44430d1c64 Mon Sep 17 00:00:00 2001 From: Guillaume Desmottes Date: Fri, 25 May 2012 11:21:01 +0200 Subject: test-empathy-roster-view: add option to display offline contacts --- tests/interactive/test-empathy-roster-view.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'tests/interactive') diff --git a/tests/interactive/test-empathy-roster-view.c b/tests/interactive/test-empathy-roster-view.c index 20515d9e6..f01b8b6ad 100644 --- a/tests/interactive/test-empathy-roster-view.c +++ b/tests/interactive/test-empathy-roster-view.c @@ -3,16 +3,35 @@ #include #include +static gboolean show_offline = FALSE; + +static GOptionEntry entries[] = +{ + { "offline", 0, 0, G_OPTION_ARG_NONE, &show_offline, "Show offline contacts", NULL }, + { NULL } +}; + int main (int argc, char **argv) { GtkWidget *window, *view, *scrolled; EmpathyIndividualManager *mgr; + GError *error = NULL; + GOptionContext *context; gtk_init (&argc, &argv); empathy_gtk_init (); + context = g_option_context_new ("- test tree model performance"); + g_option_context_add_main_entries (context, entries, GETTEXT_PACKAGE); + g_option_context_add_group (context, gtk_get_option_group (TRUE)); + if (!g_option_context_parse (context, &argc, &argv, &error)) + { + g_print ("option parsing failed: %s\n", error->message); + return 1; + } + window = gtk_window_new (GTK_WINDOW_TOPLEVEL); empathy_set_css_provider (window); @@ -21,6 +40,8 @@ main (int argc, view = empathy_roster_view_new (mgr); + empathy_roster_view_show_offline (EMPATHY_ROSTER_VIEW (view), show_offline); + g_object_unref (mgr); scrolled = gtk_scrolled_window_new (NULL, NULL); -- cgit v1.2.3