diff options
author | Ettore Perazzoli <ettore@src.gnome.org> | 2003-12-01 10:48:53 +0800 |
---|---|---|
committer | Ettore Perazzoli <ettore@src.gnome.org> | 2003-12-01 10:48:53 +0800 |
commit | 81724738fc6c8a41485a2dcfc4671f10c47cbc1c (patch) | |
tree | d0cd44051b218792160debe7daa56e545533ec86 /widgets/misc/test-source-option-menu.c | |
parent | fae86d46d1328fad31ebf9b6b7840179d96b88a9 (diff) | |
download | gsoc2013-evolution-81724738fc6c8a41485a2dcfc4671f10c47cbc1c.tar gsoc2013-evolution-81724738fc6c8a41485a2dcfc4671f10c47cbc1c.tar.gz gsoc2013-evolution-81724738fc6c8a41485a2dcfc4671f10c47cbc1c.tar.bz2 gsoc2013-evolution-81724738fc6c8a41485a2dcfc4671f10c47cbc1c.tar.lz gsoc2013-evolution-81724738fc6c8a41485a2dcfc4671f10c47cbc1c.tar.xz gsoc2013-evolution-81724738fc6c8a41485a2dcfc4671f10c47cbc1c.tar.zst gsoc2013-evolution-81724738fc6c8a41485a2dcfc4671f10c47cbc1c.zip |
New test.
* test-source-option-menu.c: New test.
* e-source-option-menu.h: New.
* e-source-option-menu.c: New.
svn path=/trunk/; revision=23511
Diffstat (limited to 'widgets/misc/test-source-option-menu.c')
-rw-r--r-- | widgets/misc/test-source-option-menu.c | 78 |
1 files changed, 78 insertions, 0 deletions
diff --git a/widgets/misc/test-source-option-menu.c b/widgets/misc/test-source-option-menu.c new file mode 100644 index 0000000000..91a7941e29 --- /dev/null +++ b/widgets/misc/test-source-option-menu.c @@ -0,0 +1,78 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ +/* test-source-option-menu.c - Test for ESourceOptionMenu. + * + * Copyright (C) 2003 Novell, Inc. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of version 2 of the GNU General Public + * License as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this program; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + * + * Author: Ettore Perazzoli <ettore@ximian.com> + */ + +#ifdef HAVE_CONFIG_H +#include <config.h> +#endif + + +#include "e-source-option-menu.h" + +#include <gtk/gtkwindow.h> +#include <gtk/gtkmain.h> + +#include <libgnomeui/gnome-ui-init.h> + + +static int +on_idle_create_widget (const char *gconf_path) +{ + GtkWidget *window; + GtkWidget *option_menu; + ESourceList *source_list; + GConfClient *gconf_client; + + gconf_client = gconf_client_get_default (); + source_list = e_source_list_new_for_gconf (gconf_client, gconf_path); + + window = gtk_window_new (GTK_WINDOW_TOPLEVEL); + option_menu = e_source_option_menu_new (source_list); + + gtk_container_add (GTK_CONTAINER (window), option_menu); + gtk_widget_show_all (window); + + g_object_unref (gconf_client); + g_object_unref (source_list); + + return FALSE; +} + + +int +main (int argc, char **argv) +{ + GnomeProgram *program; + const char *gconf_path; + + program = gnome_program_init ("test-source-list", "0.0", LIBGNOMEUI_MODULE, argc, argv, NULL); + + if (argc < 2) + gconf_path = "/apps/evolution/calendar/sources"; + else + gconf_path = argv [1]; + + g_idle_add ((GSourceFunc) on_idle_create_widget, (void *) gconf_path); + + gtk_main (); + + return 0; +} |