diff options
Diffstat (limited to 'mail')
-rw-r--r-- | mail/folder-browser-factory.c | 59 | ||||
-rw-r--r-- | mail/html-stream.c | 3 | ||||
-rw-r--r-- | mail/mail-display.c | 1 | ||||
-rw-r--r-- | mail/message-list.c | 105 |
4 files changed, 96 insertions, 72 deletions
diff --git a/mail/folder-browser-factory.c b/mail/folder-browser-factory.c index 45736e098e..9c22bfc2a8 100644 --- a/mail/folder-browser-factory.c +++ b/mail/folder-browser-factory.c @@ -1,3 +1,4 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ /* * folder-browser-factory.c: A Bonobo Control factory for Folder Browsers * @@ -17,6 +18,43 @@ #include "folder-browser.h" #include "main.h" + +static const gchar *warning_dialog_buttons[] = { + "Cancel", + "OK", + NULL +}; + +static int +development_warning () +{ + gint result; + GtkWidget *label, *warning_dialog; + + warning_dialog = gnome_dialog_new ("Don't do that", + "I know what I'm doing", + "I'll try it later", + NULL); + + label = gtk_label_new ("This is a developement version of Evolution.\n " + "Using the mail component on your mail files\n " + "is extremely hazardous. It could destroy all your\n" + "mails. Please backup all your mails before trying\n " + "this program. You have been warned\n"); + gtk_widget_show (label); + + gtk_box_pack_start (GTK_BOX (GNOME_DIALOG (warning_dialog)->vbox), + label, TRUE, TRUE, 0); + + result = gnome_dialog_run (GNOME_DIALOG (warning_dialog)); + + gtk_object_unref (GTK_OBJECT (label)); + gtk_object_unref (GTK_OBJECT (warning_dialog)); + + return result; + +} + /* * Creates the Folder Browser, wraps it in a Bonobo Control, and * sets the Bonobo Control properties to point to the Folder Browser @@ -27,13 +65,20 @@ folder_browser_factory (BonoboGenericFactory *factory, void *closure) { BonoboControl *control; GtkWidget *folder_browser; + gint warning_result; - folder_browser = folder_browser_new (); + warning_result = development_warning (); + + if (warning_result) + folder_browser = gtk_label_new ("This should be the mail component"); + else { + folder_browser = folder_browser_new (); + folder_browser_set_uri (FOLDER_BROWSER (folder_browser), "inbox"); + } + if (folder_browser == NULL) return NULL; - folder_browser_set_uri (FOLDER_BROWSER (folder_browser), "inbox"); - gtk_widget_show(folder_browser); control = bonobo_control_new (folder_browser); @@ -43,11 +88,11 @@ folder_browser_factory (BonoboGenericFactory *factory, void *closure) return NULL; } + if (!warning_result) + bonobo_control_set_property_bag ( + control, + FOLDER_BROWSER (folder_browser)->properties); - bonobo_control_set_property_bag ( - control, - FOLDER_BROWSER (folder_browser)->properties); - return BONOBO_OBJECT (control); } diff --git a/mail/html-stream.c b/mail/html-stream.c index 31afe4bd25..bf88823a33 100644 --- a/mail/html-stream.c +++ b/mail/html-stream.c @@ -2,8 +2,9 @@ /* * html-stream.c: A CamelStream class that feeds data into a GtkHTML widget * - * Author: + * Authors: * Miguel de Icaza (miguel@helixcode.com) + * Bertrand Guiheneuf (bg@aful.org) * * (C) 2000 Helix Code, Inc. */ diff --git a/mail/mail-display.c b/mail/mail-display.c index 01abcc008f..6665d8dd48 100644 --- a/mail/mail-display.c +++ b/mail/mail-display.c @@ -4,6 +4,7 @@ * * Author: * Miguel de Icaza + * Bertrand Guiheneuf (bg@aful.org) * * (C) 2000 Helix Code, Inc. */ diff --git a/mail/message-list.c b/mail/message-list.c index d3be8d36f0..caaede7d3a 100644 --- a/mail/message-list.c +++ b/mail/message-list.c @@ -5,6 +5,7 @@ * * Author: * Miguel de Icaza (miguel@helixcode.com) + * Bertrand Guiheneuf (bg@aful.org) * * (C) 2000 Helix Code, Inc. */ @@ -53,6 +54,43 @@ on_row_selection_cmd (ETable *table, +/* select a message and display it */ +static void +select_msg (MessageList *message_list, gint row) +{ + CamelException ex; + CamelMimeMessage *message = NULL; + + camel_exception_init (&ex); + + if (camel_folder_has_uid_capability (message_list->folder)) { + const GArray *msg_info_array; + CamelMessageInfo msg_info; + + msg_info_array = camel_folder_summary_get_message_info_list + (message_list->folder_summary); + + if (msg_info_array->len > 0 ) { + msg_info = g_array_index (msg_info_array, CamelMessageInfo, row); + + message = camel_folder_get_message_by_uid (message_list->folder, + msg_info.uid, + &ex); + if (camel_exception_get_id (&ex)) { + printf ("Unable to get message: %s\n", + ex.desc?ex.desc:"unknown_reason"); + return; + } + } + + printf ("Message = %p\n", message); + if (message) + mail_display_set_message (message_list->parent_folder_browser->mail_display, + CAMEL_MEDIUM (message)); + } + +} + /* * SimpleTableModel::col_count */ @@ -597,7 +635,6 @@ message_list_set_folder (MessageList *message_list, CamelFolder *camel_folder) { CamelException ex; gboolean folder_exists; - CamelMimeMessage *message; g_return_if_fail (message_list != NULL); g_return_if_fail (camel_folder != NULL); @@ -661,38 +698,7 @@ message_list_set_folder (MessageList *message_list, CamelFolder *camel_folder) printf ("Modelo cambio!\n"); e_table_model_changed (message_list->table_model); - /* FIXME : put that in a separate function */ - /* display the (first) message (in this case) */ - if (camel_folder_has_uid_capability (camel_folder)) { - const GArray *msg_info_array; - CamelMessageInfo msg_info; - - msg_info_array = camel_folder_summary_get_message_info_list - (message_list->folder_summary); - - if (msg_info_array->len > 0 ) { - msg_info = g_array_index (msg_info_array, CamelMessageInfo, 0); - - message = camel_folder_get_message_by_uid (message_list->folder, - msg_info.uid, - &ex); - if (camel_exception_get_id (&ex)) { - printf ("Unable to get message: %s\n", - ex.desc?ex.desc:"unknown_reason"); - return; - } - } - - printf ("Message = %p\n", message); - /*if (message) - mail_display_set_message (message_list->parent_folder_browser->mail_display, - CAMEL_MEDIUM (message));*/ - - - - } else - g_warning ("FIXME : folder does not support UIDS\n"); - + select_msg (message_list, 1); } GtkWidget * @@ -705,6 +711,7 @@ E_MAKE_TYPE (message_list, "MessageList", MessageList, message_list_class_init, + static void on_row_selection_cmd (ETable *table, int row, @@ -712,42 +719,12 @@ on_row_selection_cmd (ETable *table, gpointer user_data) { MessageList *message_list; - CamelException ex; - gboolean folder_exists; - CamelMimeMessage *message; message_list = MESSAGE_LIST (user_data); - camel_exception_init (&ex); if ( selected ) { g_print ("Row %d selected\n", row); - /* FIXME : put that in a separate function */ - /* display the (first) message (in this case) */ - if (camel_folder_has_uid_capability (message_list->folder)) { - const GArray *msg_info_array; - CamelMessageInfo msg_info; - - msg_info_array = camel_folder_summary_get_message_info_list - (message_list->folder_summary); - - if (msg_info_array->len > 0 ) { - msg_info = g_array_index (msg_info_array, CamelMessageInfo, row); - - message = camel_folder_get_message_by_uid (message_list->folder, - msg_info.uid, - &ex); - if (camel_exception_get_id (&ex)) { - printf ("Unable to get message: %s\n", - ex.desc?ex.desc:"unknown_reason"); - return; - } - } - - printf ("Message = %p\n", message); - if (message) - mail_display_set_message (message_list->parent_folder_browser->mail_display, - CAMEL_MEDIUM (message)); - } + select_msg (message_list, row); } else { g_print ("Row %d unselected\n", row); } |