diff options
author | Bertrand Guiheneuf <bertrand@src.gnome.org> | 2000-03-07 02:57:33 +0800 |
---|---|---|
committer | Bertrand Guiheneuf <bertrand@src.gnome.org> | 2000-03-07 02:57:33 +0800 |
commit | 34ddede07c695d6cedb80be5f45cc76f917e34ad (patch) | |
tree | bcbafc07dd635b723c10ae134f8999576f30b45d /mail/message-list.c | |
parent | 201f2eb86e81772a9979652c6371024b2da4c8f6 (diff) | |
download | gsoc2013-evolution-34ddede07c695d6cedb80be5f45cc76f917e34ad.tar gsoc2013-evolution-34ddede07c695d6cedb80be5f45cc76f917e34ad.tar.gz gsoc2013-evolution-34ddede07c695d6cedb80be5f45cc76f917e34ad.tar.bz2 gsoc2013-evolution-34ddede07c695d6cedb80be5f45cc76f917e34ad.tar.lz gsoc2013-evolution-34ddede07c695d6cedb80be5f45cc76f917e34ad.tar.xz gsoc2013-evolution-34ddede07c695d6cedb80be5f45cc76f917e34ad.tar.zst gsoc2013-evolution-34ddede07c695d6cedb80be5f45cc76f917e34ad.zip |
missing file
svn path=/trunk/; revision=2076
Diffstat (limited to 'mail/message-list.c')
-rw-r--r-- | mail/message-list.c | 68 |
1 files changed, 65 insertions, 3 deletions
diff --git a/mail/message-list.c b/mail/message-list.c index 3870b412a7..d3be8d36f0 100644 --- a/mail/message-list.c +++ b/mail/message-list.c @@ -45,6 +45,14 @@ static BonoboObjectClass *message_list_parent_class; static POA_Evolution_MessageList__vepv evolution_message_list_vepv; +static void +on_row_selection_cmd (ETable *table, + int row, + gboolean selected, + gpointer user_data); + + + /* * SimpleTableModel::col_count */ @@ -440,6 +448,9 @@ message_list_init (GtkObject *object) */ message_list->etable = e_table_new (message_list->header_model, message_list->table_model, "<ETableSpecification> <columns-shown> <column> 0 </column> <column> 1 </column> <column> 2 </column> <column> 3 </column> <column> 4 </column> <column> 5 </column> <column> 6 </column> <column> 7 </column> <column> 8 </column> <column> 9 </column> </columns-shown> <grouping> <group column=\"4\" ascending=\"1\"> <leaf column=\"5\" ascending=\"1\"/> </group> </grouping> </ETableSpecification>"); + + gtk_signal_connect(GTK_OBJECT(message_list->etable), "row_selection", + GTK_SIGNAL_FUNC(on_row_selection_cmd), message_list); gtk_widget_show(message_list->etable); @@ -662,7 +673,7 @@ message_list_set_folder (MessageList *message_list, CamelFolder *camel_folder) if (msg_info_array->len > 0 ) { msg_info = g_array_index (msg_info_array, CamelMessageInfo, 0); - message = camel_folder_get_message_by_uid (camel_folder, + message = camel_folder_get_message_by_uid (message_list->folder, msg_info.uid, &ex); if (camel_exception_get_id (&ex)) { @@ -673,9 +684,9 @@ message_list_set_folder (MessageList *message_list, CamelFolder *camel_folder) } printf ("Message = %p\n", message); - if (message) + /*if (message) mail_display_set_message (message_list->parent_folder_browser->mail_display, - CAMEL_MEDIUM (message)); + CAMEL_MEDIUM (message));*/ @@ -691,3 +702,54 @@ message_list_get_widget (MessageList *message_list) } E_MAKE_TYPE (message_list, "MessageList", MessageList, message_list_class_init, message_list_init, PARENT_TYPE); + + + +static void +on_row_selection_cmd (ETable *table, + int row, + gboolean selected, + 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)); + } + } else { + g_print ("Row %d unselected\n", row); + } +} + |