From c48faceb78e6c8a8b7f536b8475e039858f703ed Mon Sep 17 00:00:00 2001 From: nobody Date: Sun, 31 Oct 1999 18:48:15 +0000 Subject: This commit was manufactured by cvs2svn to create tag 'BUG_BUDDY_0_2'. svn path=/tags/BUG_BUDDY_0_2/; revision=1359 --- tests/.cvsignore | 11 - tests/Makefile.am | 26 -- tests/test1.c | 67 ----- tests/test2.c | 46 ---- tests/test3.c | 29 --- tests/test4.c | 68 ------ tests/test5.c | 60 ----- tests/test6.c | 50 ---- tests/test7.c | 24 -- tests/test8.c | 78 ------ tests/ui-tests/.cvsignore | 5 - tests/ui-tests/Makefile.am | 17 -- tests/ui-tests/store_listing.c | 424 -------------------------------- tests/ui-tests/store_listing.glade | 489 ------------------------------------- 14 files changed, 1394 deletions(-) delete mode 100644 tests/.cvsignore delete mode 100644 tests/Makefile.am delete mode 100644 tests/test1.c delete mode 100644 tests/test2.c delete mode 100644 tests/test3.c delete mode 100644 tests/test4.c delete mode 100644 tests/test5.c delete mode 100644 tests/test6.c delete mode 100644 tests/test7.c delete mode 100644 tests/test8.c delete mode 100644 tests/ui-tests/.cvsignore delete mode 100644 tests/ui-tests/Makefile.am delete mode 100644 tests/ui-tests/store_listing.c delete mode 100644 tests/ui-tests/store_listing.glade (limited to 'tests') diff --git a/tests/.cvsignore b/tests/.cvsignore deleted file mode 100644 index 10cdebc6d6..0000000000 --- a/tests/.cvsignore +++ /dev/null @@ -1,11 +0,0 @@ -test1 -test2 -test3 -test4 -test5 -test6 -test7 -Makefile.in -Makefile -.deps -.libs diff --git a/tests/Makefile.am b/tests/Makefile.am deleted file mode 100644 index be6523dfbd..0000000000 --- a/tests/Makefile.am +++ /dev/null @@ -1,26 +0,0 @@ -# process this file with automake to create Makefile.in - -INCLUDES = -I$(top_srcdir)/intl -I$(top_srcdir)/camel \ - -I$(includedir) -I$(top_srcdir)/camel/providers/MH -LDADD = \ - $(top_builddir)/camel/libcamel.la \ - $(GNOME_LIBDIR) \ - $(GNOMEUI_LIBS) $(INTLLIBS) $(PTHREAD_LIB) $(EXTRA_GNOME_LIBS) -# $(BONOBO_LIBS) - - - - -#test4_LDADD = \ -# $(top_builddir)/camel/libcamel.la \ -# $(top_builddir)/camel/providers/MH/libcamelmh.la \ -# $(GNOME_LIBDIR) \ -# $(GNOMEUI_LIBS) $(INTLLIBS) $(PTHREAD_LIB) - - -noinst_PROGRAMS = \ - test1 \ - test2 \ - test3 \ - test7 \ - test8 diff --git a/tests/test1.c b/tests/test1.c deleted file mode 100644 index 2ee5241ad1..0000000000 --- a/tests/test1.c +++ /dev/null @@ -1,67 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -#include "camel-mime-message.h" -#include "camel-mime-body-part.h" -#include "camel-multipart.h" -#include "stdio.h" -#include "camel-stream.h" -#include "camel-stream-fs.h" -#include "camel-log.h" -#include "camel.h" - -int -main (int argc, char**argv) -{ - CamelMimeMessage *message; - CamelMultipart *multipart; - CamelMimeBodyPart *body_part; - - /* FILE *output_file; */ - CamelStream *stream; - - gtk_init (&argc, &argv); - camel_init (); - message = camel_mime_message_new_with_session ((CamelSession *)NULL); - - camel_mime_part_set_description (CAMEL_MIME_PART (message), "a test"); - - camel_medium_add_header (CAMEL_MEDIUM (message), "X-test1", "the value of a test"); - camel_medium_add_header (CAMEL_MEDIUM (message), "X-test2", "the value of another test"); - /*camel_mime_part_add_content_language (CAMEL_MIME_PART (message), g_string_new ("es-ca"));*/ - - camel_mime_message_set_received_date (message, g_strdup ("Thu, 20 May 1999, 10:39:14 +0200")); - camel_mime_message_set_subject (message, g_strdup ("A test message")); - camel_mime_message_set_reply_to (message, g_strdup ("toto@toto.com")); - camel_mime_message_set_from (message, g_strdup ("Bertrand.Guiheneuf@aful.org")); - - camel_mime_message_add_recipient (message, RECIPIENT_TYPE_TO, g_strdup ("franck.dechamps@alseve.fr")); - camel_mime_message_add_recipient (message, RECIPIENT_TYPE_TO, g_strdup ("mc@alseve.fr")); - camel_mime_message_add_recipient (message, RECIPIENT_TYPE_TO, g_strdup ("richard.lengagne@aful.org")); - camel_mime_message_add_recipient (message, RECIPIENT_TYPE_CC, g_strdup ("Francois.fleuret@aful.org")); - camel_mime_message_add_recipient (message, RECIPIENT_TYPE_CC, g_strdup ("maury@justmagic.com")); - camel_mime_message_add_recipient (message, RECIPIENT_TYPE_BCC, g_strdup ("Bertrand.Guiheneuf@aful.org")); - - - multipart = camel_multipart_new (); - body_part = camel_mime_body_part_new (); - camel_mime_part_set_text (CAMEL_MIME_PART (body_part), "This is a test.\nThis is only a test.\n"); - camel_multipart_add_part (multipart, body_part); - camel_medium_set_content_object (CAMEL_MEDIUM (message), CAMEL_DATA_WRAPPER (multipart)); - - stream = camel_stream_fs_new_with_name ("mail1.test", CAMEL_STREAM_FS_WRITE ); - if (!stream) { - CAMEL_LOG_FULL_DEBUG ("could not open output file"); - exit(2); - } - - camel_data_wrapper_write_to_stream (CAMEL_DATA_WRAPPER (message), stream); - camel_stream_close (stream); - gtk_object_unref (GTK_OBJECT (stream)); - - gtk_object_unref (GTK_OBJECT (message)); - gtk_object_unref (GTK_OBJECT (multipart)); - gtk_object_unref (GTK_OBJECT (body_part)); - - printf ("Test1 finished\n"); - return 1; -} - diff --git a/tests/test2.c b/tests/test2.c deleted file mode 100644 index 20e8b739b9..0000000000 --- a/tests/test2.c +++ /dev/null @@ -1,46 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* tests mime message file parsing */ -#include "gmime-utils.h" -#include "stdio.h" -#include "camel-log.h" -#include "camel-mime-message.h" -#include "camel-mime-part.h" -#include "camel-stream.h" -#include "camel-stream-fs.h" -#include "camel.h" - -int -main (int argc, char**argv) -{ - GHashTable *header_table; - CamelMimeMessage *message; - CamelStream *input_stream, *output_stream; - - gtk_init (&argc, &argv); - camel_init (); - camel_debug_level = CAMEL_LOG_LEVEL_FULL_DEBUG; - message = camel_mime_message_new_with_session( (CamelSession *)NULL); - - - input_stream = camel_stream_fs_new_with_name ("mail.test", CAMEL_STREAM_FS_READ); - if (!input_stream) { - perror ("could not open input file"); - printf ("You must create the file mail.test before running this test"); - exit(2); - } - - camel_data_wrapper_construct_from_stream ( CAMEL_DATA_WRAPPER (message), input_stream); - camel_medium_get_content_object (CAMEL_MEDIUM (message)); - camel_stream_close (input_stream); - gtk_object_unref (GTK_OBJECT (input_stream)); - - output_stream = camel_stream_fs_new_with_name ("mail2.test", CAMEL_STREAM_FS_WRITE); - camel_data_wrapper_write_to_stream (CAMEL_DATA_WRAPPER (message), output_stream); - camel_stream_close (output_stream); - gtk_object_unref (GTK_OBJECT (output_stream)); - - gtk_object_unref (GTK_OBJECT (message)); - - return 0; - -} diff --git a/tests/test3.c b/tests/test3.c deleted file mode 100644 index 9893e2e507..0000000000 --- a/tests/test3.c +++ /dev/null @@ -1,29 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -#include "camel.h" - -int -main (int argc, char**argv) -{ - GtkType type; - - gtk_init (&argc, &argv); - camel_init (); - - printf ("Test 3 : data wrapper repository\n"); - - printf ("\nMime type : \"multipart\"\n"); - type = data_wrapper_repository_get_data_wrapper_type ("multipart"); - printf ("Type found %s\n", gtk_type_name (type) ); - - printf ("\nMime type : \"multipart/alternative\"\n"); - type = data_wrapper_repository_get_data_wrapper_type ("multipart/alternative"); - printf ("Type found %s\n", gtk_type_name (type) ); - - printf ("\nMime type : \"toto/titi\"\n"); - type = data_wrapper_repository_get_data_wrapper_type ("toto/titi"); - printf ("Type found %s\n", gtk_type_name (type) ); - - printf ("Test3 finished\n"); - return 1; -} - diff --git a/tests/test4.c b/tests/test4.c deleted file mode 100644 index 99285cec43..0000000000 --- a/tests/test4.c +++ /dev/null @@ -1,68 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ - -/* testing mh providers - do not use CamelMhFolder and CamelMhStore directly. - We do it here for test purpose only */ - - - -#include "camel-folder.h" -#include "camel-mh-folder.h" -#include "camel-mh-store.h" -#include "camel.h" -#include "camel-log.h" - -int -main (int argc, char**argv) -{ - CamelStore *store; - CamelFolder *inbox_folder; - CamelFolder *root_mh_folder; - GList *mh_subfolders_name; - CamelMimeMessage *message_1; - gboolean inbox_exists; - - camel_debug_level = CAMEL_LOG_LEVEL_FULL_DEBUG; - - gtk_init (&argc, &argv); - camel_init (); - - - store = gtk_type_new (CAMEL_MH_STORE_TYPE); - camel_store_init (store, (CamelSession *)NULL, g_strdup ("mh:///root/Mail")); - - root_mh_folder = camel_store_get_folder (store, ""); - mh_subfolders_name = camel_folder_list_subfolders (root_mh_folder, NULL); - - printf ("\n------------- Listing root Mh folder subfolders --------\n"); - while (mh_subfolders_name) { - printf ("\t\"%s\"\n", (gchar *)mh_subfolders_name->data); - mh_subfolders_name = mh_subfolders_name->next; - } - printf ("--------------------------------------------------------\n\n"); - - inbox_folder = camel_store_get_folder (store, "inbox"); - if (!inbox_folder) { - printf ("** Error: could not get inbox folder from store\n"); - return 1; - } - - /* test existence */ - inbox_exists = camel_folder_exists (inbox_folder, NULL); - if (inbox_exists) - printf ("MH folder inbox exists, continuing tests\n"); - else { - printf ("MH folder inbox does not exist. Stopping \n"); - return 1; - } - - printf ("\n Inbox folder contains %d messages\n", camel_folder_get_message_count (inbox_folder, NULL)); - printf ("\n------------- Gettting message numer 3 in inbox --------\n"); - message_1 = camel_folder_get_message (inbox_folder, 3, NULL); - printf ("--------------------------------------------------------\n\n"); - - - return 1; - - -} diff --git a/tests/test5.c b/tests/test5.c deleted file mode 100644 index 2f47fda418..0000000000 --- a/tests/test5.c +++ /dev/null @@ -1,60 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ - -/* test for the RFC 2047 decoder */ - -#include -#include - -#include "gmime-utils.h" -#include "stdio.h" -#include "camel-log.h" -#include "camel-mime-message.h" -#include "camel-mime-part.h" -#include "camel-stream.h" -#include "camel-stream-fs.h" -#include "camel.h" -#include "gmime-rfc2047.h" - -#define TERMINAL_CHARSET "UTF-8" - -/* - * Info on many unicode issues, including, utf-8 xterms from : - * - * http://www.cl.cam.ac.uk/~mgk/unicode.html - * - */ - -const char *tests[] = -{ -/* these strings come from RFC 2047. Ought to add a few torture cases here. */ - "=?US-ASCII?Q?Keith_Moore?= ", - "=?ISO-8859-1?Q?Keld_J=F8rn_Simonsen?= ", - "=?ISO-8859-1?Q?Andr=E9?= Pirard ", - "=?ISO-8859-1?B?SWYgeW91IGNhbiByZWFkIHRoaXMgeW8=?= =?ISO-8859-2?B?dSB1bmRlcnN0YW5kIHRoZSBleGFtcGxlLg==?=", - "=?ISO-8859-1?Q?Olle_J=E4rnefors?= ", - "=?ISO-8859-1?Q?Patrik_F=E4ltstr=F6m?= ", - "Nathaniel Borenstein (=?iso-8859-8?b?7eXs+SDv4SDp7Oj08A==?=)", - "", - "(=?ISO-8859-1?Q?a?=)", /* should be displayed as (a) */ - "(=?ISO-8859-1?Q?a?= b)", /* (a b) */ - "(=?ISO-8859-1?Q?a?= =?ISO-8859-1?Q?b?=)", /* (ab) */ - "(=?ISO-8859-1?Q?a?= =?ISO-8859-1?Q?b?=)", /* (ab) */ - "(=?ISO-8859-1?Q?a?= \n=?ISO-8859-1?Q?b?=)", /* (ab) */ - "(=?ISO-8859-1?Q?a_b?=)", /* (a b) */ - "(=?ISO-8859-1?Q?a?= =?ISO-8859-2?Q?_b?=)", /* (ab) */ - NULL -}; - - -int -main (int argc, char**argv) -{ - const char **b = tests; - while (*b) { - printf("%s\n", gmime_rfc2047_decode(*b, TERMINAL_CHARSET)); - b++; - } - - return 0; - -} diff --git a/tests/test6.c b/tests/test6.c deleted file mode 100644 index ead8312c52..0000000000 --- a/tests/test6.c +++ /dev/null @@ -1,50 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ - -/* test for the RFC 2047 encoder */ - -#include -#include - -#include "gmime-utils.h" -#include "stdio.h" -#include "camel-log.h" -#include "camel-mime-message.h" -#include "camel-mime-part.h" -#include "camel-stream.h" -#include "camel-stream-fs.h" -#include "camel.h" -#include "gmime-rfc2047.h" - -#define TERMINAL_CHARSET "UTF-8" - -/* - * Info on many unicode issues, including, utf-8 xterms from : - * - * http://www.cl.cam.ac.uk/~mgk25/unicode.html - * - */ - -const char *tests[] = -{ - "is is a test", "ISO-8859-1", - "Itrtinlation", "ISO-8859-1", - "Καλημέρα κόσμε", "UTF-8", - "コンニチハ", "UTF-8", - "ði ıntəˈnæʃənəl fəˈnɛtık əsoʊsiˈeıʃn", "UTF-8", - NULL -}; - - -int -main (int argc, char**argv) -{ - const char **b = tests; - while (*b) { - char *e = gmime_rfc2047_encode(b[0], b[1]); - printf("%s\t%s\n", e, gmime_rfc2047_decode(e, TERMINAL_CHARSET)); - b+=2; - } - - return 0; - -} diff --git a/tests/test7.c b/tests/test7.c deleted file mode 100644 index 44c73d275b..0000000000 --- a/tests/test7.c +++ /dev/null @@ -1,24 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ - -/* test provider stuff */ - - -#include "camel.h" - - -int -main (int argc, char**argv) -{ - const CamelProvider *new_provider; - - camel_debug_level = CAMEL_LOG_LEVEL_FULL_DEBUG; - - gtk_init (&argc, &argv); - camel_init (); - - - new_provider = camel_provider_register_as_module ("../camel/providers/MH/.libs/libcamelmh.so"); - - - return 1; -} diff --git a/tests/test8.c b/tests/test8.c deleted file mode 100644 index 1f446e171d..0000000000 --- a/tests/test8.c +++ /dev/null @@ -1,78 +0,0 @@ -/* test posix thread folder proxy */ - - -#include "camel.h" -#include "camel-log.h" - -CamelThreadProxy *proxy; -CamelFuncDef *func_def; - - -void -test_sync_func (int num) -{ - printf ("Sync function number %d\n", num); - printf ("Sync function : current thread : %d\n", pthread_self ()); - -} - - -void -test_async_cb (int num) -{ - printf ("Callback number %d\n", num); - printf ("Callback : current thread : %d\n", pthread_self ()); -} - -void -test_async_func (int num) -{ - CamelOp *cb; - - printf ("Async function number %d\n", num); - printf ("Async function : current thread : %d\n", pthread_self ()); - sleep (1); - cb = camel_marshal_create_op (func_def, test_async_cb, num); - camel_thread_proxy_push_cb (proxy, cb); - - -} - -int -main (int argc, char **argv) -{ - int i; - CamelOp *op; - - camel_debug_level = CAMEL_LOG_LEVEL_WARNING; - - camel_init (); - - func_def = - camel_func_def_new (camel_marshal_NONE__INT, - 1, - GTK_TYPE_INT); - - printf ("--== Testing Simple marshalling system ==--\n"); - for (i=0; i<5; i++) { - printf ("Iterration number %d\n", i); - op = camel_marshal_create_op (func_def, test_sync_func, i); - camel_op_run (op); - camel_op_free (op); - - } - printf ("\n\n"); - - proxy = camel_thread_proxy_new (); - - printf ("--== Testing Asynchronous Operation System ==--\n"); - for (i=0; i<5; i++) { - printf ("Pushing async operation number %d for execution\n", i); - op = camel_marshal_create_op (func_def, test_async_func, i); - camel_thread_proxy_push_op (proxy, op); - } - printf ("\n\n"); - printf ("--== Operations execution planned ==--\n"); - gtk_main (); -} - diff --git a/tests/ui-tests/.cvsignore b/tests/ui-tests/.cvsignore deleted file mode 100644 index be569b9c4c..0000000000 --- a/tests/ui-tests/.cvsignore +++ /dev/null @@ -1,5 +0,0 @@ -Makefile.in -Makefile -.deps -.libs -store_listing diff --git a/tests/ui-tests/Makefile.am b/tests/ui-tests/Makefile.am deleted file mode 100644 index c4849e7c3c..0000000000 --- a/tests/ui-tests/Makefile.am +++ /dev/null @@ -1,17 +0,0 @@ -# process this file with automake to create Makefile.in - -INCLUDES = -I$(top_srcdir)/intl -I$(top_srcdir)/camel \ - -I$(includedir) -I$(top_srcdir)/camel/providers/MH \ - $(EXTRA_GNOME_CFLAGS) - -LDADD = \ - $(top_builddir)/camel/libcamel.la \ - $(top_builddir)/camel/providers/MH/libcamelmh.la \ - $(INTLLIBS) $(EXTRA_GNOME_LIBS) $(PTHREAD_LIB) - - - - - -noinst_PROGRAMS = \ - store_listing \ No newline at end of file diff --git a/tests/ui-tests/store_listing.c b/tests/ui-tests/store_listing.c deleted file mode 100644 index fb7c2ae0f7..0000000000 --- a/tests/ui-tests/store_listing.c +++ /dev/null @@ -1,424 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* Author : Bertrand.Guiheneuf@aful.org */ - - - -/* A simple and very dirty hack written to test - (and perhaps demonstrate) Camel */ - - -#include -#include - -#include "camel-folder.h" -#include "camel-mh-folder.h" -#include "camel-mh-store.h" -#include "camel.h" -#include "camel-folder-summary.h" - -static GladeXML *xml; -static CamelSession *_session; -static CamelFolder *currently_selected_folder = NULL; - -static GList *store_list; -static GList *folder_list; - -static void add_mail_store (const gchar *store_url); -static void show_folder_messages (CamelFolder *folder); - - - -static void -_destroy_menu (gpointer data) -{ - gtk_widget_destroy (GTK_WIDGET (data)); -} - -static void -_copy_message (GtkWidget *widget, gpointer data) -{ - CamelFolder *dest_folder = CAMEL_FOLDER (data); - GtkWidget *message_clist; - gint current_row; - GList *selected; - gint selected_row; - - CamelMimeMessage *message; - - printf ("Selected \"copy to folder\" with destination folder %s\n", camel_folder_get_name (dest_folder)); - message_clist = glade_xml_get_widget (xml, "message-clist"); - selected = GTK_CLIST (message_clist)->selection; - while (selected) { - selected_row = GPOINTER_TO_INT (selected->data); - message = CAMEL_MIME_MESSAGE (gtk_clist_get_row_data (GTK_CLIST (message_clist), selected_row)); - camel_folder_copy_message_to (currently_selected_folder, message, dest_folder); - selected = selected->next; - } - -} - -static GnomeUIInfo mailbox_popup_menu[] = { - GNOMEUIINFO_ITEM_STOCK ("_Copy selected message here", NULL, _copy_message, GNOME_STOCK_MENU_NEW), - GNOMEUIINFO_END -}; - -static void -_show_mailbox_context_menu (CamelFolder *folder) { - GtkWidget *menu; - GtkCTree *mailbox_and_store_tree; - - mailbox_and_store_tree = GTK_CTREE (glade_xml_get_widget (xml, "store-and-mailbox-tree")); - menu = gtk_object_get_data (GTK_OBJECT (mailbox_and_store_tree), "mailbox_popup_menu"); - if (!menu) { - menu = gnome_popup_menu_new (mailbox_popup_menu); - gtk_object_set_data_full (GTK_OBJECT (mailbox_and_store_tree), "mailbox_popup_menu", menu, _destroy_menu); - } - - gnome_popup_menu_do_popup (menu, NULL, NULL, NULL, folder); - - -} -static gboolean -mailbox_button_clicked_on_row (gint button, gint row) -{ - GtkCTreeNode *mailbox_node; - CamelFolder *folder; - GtkCTree *mailbox_and_store_tree; - const gchar *mailbox_name; - - mailbox_and_store_tree = GTK_CTREE (glade_xml_get_widget (xml, "store-and-mailbox-tree")); - - mailbox_node = gtk_ctree_node_nth (mailbox_and_store_tree, row); - - folder = gtk_ctree_node_get_row_data (mailbox_and_store_tree, mailbox_node); - if (folder && IS_CAMEL_FOLDER (folder)) { - - mailbox_name = camel_folder_get_name (folder); - printf ("mailbox %s clicked with button %d\n", mailbox_name, button); - switch (button) { - case 1: - currently_selected_folder = folder; - show_folder_messages (folder); - break; - case 2: - break; - case 3: - _show_mailbox_context_menu (folder); - } - return TRUE; - } else { - printf ("Node is a store\n"); - return FALSE; - } -} - - -static void -message_destroy_notify (gpointer data) -{ - CamelMimeMessage *message = CAMEL_MIME_MESSAGE (data); - - gtk_object_unref (GTK_OBJECT (message)); - -} - - - - - -static void -show_folder_messages (CamelFolder *folder) -{ - GtkWidget *message_clist; - gint folder_message_count; - CamelMimeMessage *message; - gint i; - const gchar *clist_row_text[3]; - const char *sent_date, *subject, *sender; - gint current_row; - CamelFolderSummary *summary; - - message_clist = glade_xml_get_widget (xml, "message-clist"); - - /* clear old message list */ - gtk_clist_clear (GTK_CLIST (message_clist)); - - if (camel_folder_has_summary_capability (folder)) { - const GList *message_info_list; - CamelMessageInfo *msg_info; - - printf ("Folder has summary. Good\n"); - summary = camel_folder_get_summary (folder); - message_info_list = camel_folder_summary_get_message_info_list (summary); - printf ("message_info_list = %p\n", message_info_list); - while (message_info_list) { - msg_info = (CamelMessageInfo *)message_info_list->data; - clist_row_text [0] = msg_info->date; - clist_row_text [1] = msg_info->sender; - clist_row_text [2] = msg_info->subject; - - current_row = gtk_clist_append (GTK_CLIST (message_clist), clist_row_text); - - message_info_list = message_info_list->next; - } - } else { - printf ("Folder does not have summary. Opening all messages\n"); - folder_message_count = camel_folder_get_message_count (folder); - - for (i=0; idata; - new_folder = camel_store_get_folder (store, subfolder_list->data); - camel_folder_open (new_folder, FOLDER_OPEN_RW); - folder_list = g_list_prepend (folder_list, new_folder); - - new_folder_node = gtk_ctree_insert_node (GTK_CTREE (mailbox_and_store_tree), - new_store_node, - NULL, - new_tree_text, - 0, - NULL, - NULL, - NULL, - NULL, - FALSE, - FALSE); - - - gtk_ctree_node_set_row_data (GTK_CTREE (mailbox_and_store_tree), new_folder_node, (gpointer)new_folder); - subfolder_list = subfolder_list->next; - } -} - -static void -delete_selected_messages () -{ - GtkWidget *message_clist; - gint current_row; - GList *selected; - gint selected_row; - - CamelMimeMessage *message; - message_clist = glade_xml_get_widget (xml, "message-clist"); - selected = GTK_CLIST (message_clist)->selection; - while (selected) { - selected_row = GPOINTER_TO_INT (selected->data); - message = CAMEL_MIME_MESSAGE (gtk_clist_get_row_data (GTK_CLIST (message_clist), selected_row)); - camel_mime_message_set_flag (message, "DELETED", TRUE); - selected = selected->next; - } - -} - - -static void -expunge_selected_folders () -{ - GtkWidget *mailbox_and_store_tree; - CamelFolder *folder; - GtkCTreeNode* selected_node; - GList *selected; - const gchar *folder_name; - - mailbox_and_store_tree = glade_xml_get_widget (xml, "store-and-mailbox-tree"); - - selected = GTK_CLIST (mailbox_and_store_tree)->selection; - while (selected) { - - selected_node= GTK_CTREE_NODE (selected->data); - folder = CAMEL_FOLDER (gtk_ctree_node_get_row_data (GTK_CTREE (mailbox_and_store_tree), - selected_node)); - if (folder && IS_CAMEL_FOLDER (folder)) { - folder_name = camel_folder_get_name (folder); - printf ("folder to expunge : %s\n", folder_name); - camel_folder_expunge (folder, FALSE); - /* reshowing the folder this way is uggly - but allows to check the message are - correctly renoved and the cache works correctly */ - show_folder_messages (folder); - - } else { - printf ("A selected node is a store\n"); - } - - selected = selected->next; - } - - -} - -void -close_all () -{ - while (folder_list) { - camel_folder_close (CAMEL_FOLDER (folder_list->data), TRUE); - folder_list = folder_list->next; - } - - while (store_list) { - //camel_store_close (CAMEL_STORE (store_list->data)); - store_list = store_list->next; - } - -} - -/* ----- libglade callbacks */ -void -on_exit_activate (GtkWidget *widget, void *data) -{ - close_all (); - gtk_main_quit (); -} - - -void -on_about_activate (GtkWidget *widget, void *data) -{ - GtkWidget *about_widget; - - about_widget = glade_xml_get_widget (xml, "about_widget"); - gtk_widget_show (about_widget); -} - -void -on_new_store_activate (GtkWidget *widget, void *data) -{ - GtkWidget *new_store_dialog; - GtkWidget *new_store_gnome_entry; - GtkWidget *new_store_entry; - gchar *url_text; - - - gint pressed_button; - - new_store_dialog = glade_xml_get_widget (xml, "new_store_dialog"); - pressed_button = gnome_dialog_run (GNOME_DIALOG (new_store_dialog)); - - if ((pressed_button != 0) && (pressed_button != 1)) - return; - - new_store_gnome_entry = glade_xml_get_widget (xml, "new-store-entry"); - new_store_entry = gnome_entry_gtk_entry (GNOME_ENTRY (new_store_gnome_entry)); - url_text = gtk_entry_get_text (GTK_ENTRY (new_store_entry)); - - if (url_text) - add_mail_store (url_text); - -} - - -void -on_expunge_activate (GtkWidget *widget, void *data) -{ - expunge_selected_folders (); -} - - -void -on_message_delete_activate (GtkWidget *widget, void *data) -{ - delete_selected_messages(); -} - -gboolean -on_store_and_mailbox_tree_button_press_event (GtkWidget *widget, GdkEventButton *event, void *data) -{ - gint row; - GtkCList *clist = GTK_CLIST (widget); - - if (!gtk_clist_get_selection_info (clist, event->x, event->y, &row, NULL)) - return FALSE; - if (!mailbox_button_clicked_on_row (event->button, row)) - return FALSE; - - return TRUE; - -} - -/* ----- init */ -int -main(int argc, char *argv[]) -{ - GtkWidget *new_store_gnome_entry; - - gnome_init ("store_listing", "1.0", argc, argv); - - glade_gnome_init (); - camel_init (); - xml = glade_xml_new ("store_listing.glade", NULL); - if (xml) glade_xml_signal_autoconnect (xml); - - _session = camel_session_new (); - camel_provider_register_as_module ("../../camel/providers/MH/.libs/libcamelmh.so"); - - new_store_gnome_entry = glade_xml_get_widget (xml, "new-store-entry"); - gnome_entry_load_history (GNOME_ENTRY (new_store_gnome_entry)); - gtk_main (); - gnome_entry_save_history (GNOME_ENTRY (new_store_gnome_entry)); - - return 0; -} - diff --git a/tests/ui-tests/store_listing.glade b/tests/ui-tests/store_listing.glade deleted file mode 100644 index d551c90dbb..0000000000 --- a/tests/ui-tests/store_listing.glade +++ /dev/null @@ -1,489 +0,0 @@ - - - - - store_listing - store_listing - - src - pixmaps - C - True - True - False - True - True - True - True - interface.c - interface.h - callbacks.c - callbacks.h - support.c - support.h - - - - - GnomeApp - app1 - 600 - 400 - store_listing - GTK_WINDOW_TOPLEVEL - GTK_WIN_POS_NONE - False - False - True - False - True - - - GnomeDock - GnomeApp:dock - dock1 - True - - 0 - True - True - - - - GnomeDockItem - dockitem1 - 2 - GNOME_DOCK_TOP - 0 - 0 - 0 - False - True - False - True - False - GTK_SHADOW_OUT - - - GtkMenuBar - menubar1 - GTK_SHADOW_NONE - - - GtkMenuItem - file1 - GNOMEUIINFO_MENU_FILE_TREE - - - GtkMenu - file1_menu - - - GtkMenuItem - separator1 - False - - - - GtkPixmapMenuItem - exit - - activate - on_exit_activate - Tue, 10 Aug 1999 12:06:35 GMT - - GNOMEUIINFO_MENU_EXIT_ITEM - - - - - - GtkMenuItem - store2 - - False - - - GtkMenu - store2_menu - - - GtkPixmapMenuItem - new_store - - activate - on_new_store_activate - Tue, 10 Aug 1999 10:29:12 GMT - - GNOMEUIINFO_MENU_NEW_ITEM - - - - - - - GtkMenuItem - folder1 - - activate - on_folder1_activate - Sat, 14 Aug 1999 17:23:25 GMT - - - False - - - GtkMenu - folder1_menu - - - GtkPixmapMenuItem - expunge - - activate - on_expunge_activate - Sat, 14 Aug 1999 16:36:03 GMT - - - False - GNOME_STOCK_MENU_CONVERT - - - - - - GtkMenuItem - message_menu - - False - - - GtkMenu - message_menu_menu - - - GtkPixmapMenuItem - message_delete - - activate - on_message_delete_activate - Sat, 14 Aug 1999 14:54:04 GMT - - - False - GNOME_STOCK_MENU_TRASH - - - - - - GtkMenuItem - help1 - GNOMEUIINFO_MENU_HELP_TREE - - - GtkMenu - help1_menu - - - GtkPixmapMenuItem - about - - activate - on_about_activate - Tue, 10 Aug 1999 12:06:58 GMT - - GNOMEUIINFO_MENU_ABOUT_ITEM - - - - - - - - GnomeDockItem - dockitem2 - 1 - GNOME_DOCK_TOP - 1 - 0 - 0 - False - True - False - False - False - GTK_SHADOW_OUT - - - GtkToolbar - toolbar1 - 1 - GTK_ORIENTATION_HORIZONTAL - GTK_TOOLBAR_BOTH - 16 - GTK_TOOLBAR_SPACE_LINE - GTK_RELIEF_NONE - True - - - GtkButton - Toolbar:button - new_store_button - - clicked - on_new_store_activate - Tue, 10 Aug 1999 12:17:17 GMT - - - GNOME_STOCK_PIXMAP_NEW - - - - - - GtkHPaned - GnomeDock:contents - hpaned1 - 10 - 6 - 0 - - - GtkCTree - store-and-mailbox-tree - 150 - True - - button_press_event - on_store_and_mailbox_tree_button_press_event - Mon, 16 Aug 1999 13:06:15 GMT - - 1 - 80 - GTK_SELECTION_SINGLE - True - GTK_SHADOW_IN - - True - False - - - - GtkLabel - CTree:title - store_and_inbox_name - - GTK_JUSTIFY_CENTER - False - 0.5 - 0.5 - 0 - 0 - - - - - GtkCList - message-clist - True - 3 - 80,80,80 - GTK_SELECTION_SINGLE - True - GTK_SHADOW_IN - - True - True - - - - GtkLabel - CList:title - message_date_label - - GTK_JUSTIFY_CENTER - False - 0.5 - 0.5 - 0 - 0 - - - - GtkLabel - CList:title - message_sender_label - - GTK_JUSTIFY_CENTER - False - 0.5 - 0.5 - 0 - 0 - - - - GtkLabel - CList:title - message_subject_label - - GTK_JUSTIFY_CENTER - False - 0.5 - 0.5 - 0 - 0 - - - - - - - GnomeAppBar - GnomeApp:appbar - appbar1 - True - True - - 0 - True - True - - - - - - GnomeAbout - about_widget - False - True - - Bertrand Guiheneuf <Bertrand.Guiheneuf@aful.org> - - This is a very simple program to test Camel - - - - GnomeDialog - new_store_dialog - False - New store - GTK_WINDOW_TOPLEVEL - GTK_WIN_POS_NONE - False - False - False - False - True - True - - - GtkVBox - GnomeDialog:vbox - dialog-vbox1 - False - 8 - - 4 - True - True - - - - GtkVBox - vbox1 - False - 0 - - 0 - True - True - - - - GtkLabel - new_store_label - - GTK_JUSTIFY_CENTER - False - 0.5 - 0.5 - 0 - 29 - - 0 - False - False - - - - - GnomeEntry - new-store-entry - store_name_history - 15 - - 0 - False - False - - - - GtkEntry - GnomeEntry:entry - new-store-dialog-combo-entry - True - True - True - 0 - - - - - - - GtkHButtonBox - GnomeDialog:action_area - dialog-action_area1 - GTK_BUTTONBOX_END - 8 - 85 - 27 - 7 - 0 - - 0 - False - True - GTK_PACK_END - - - - GtkButton - button1 - True - True - GNOME_STOCK_BUTTON_OK - - - - GtkButton - button2 - True - True - GNOME_STOCK_BUTTON_APPLY - - - - GtkButton - button3 - True - True - GNOME_STOCK_BUTTON_CANCEL - - - - - - -- cgit v1.2.3