diff options
author | Michael Zucci <zucchi@src.gnome.org> | 2000-05-02 11:33:55 +0800 |
---|---|---|
committer | Michael Zucci <zucchi@src.gnome.org> | 2000-05-02 11:33:55 +0800 |
commit | 56f4dd919f5ab860dfafe79ce6db3a9567de254f (patch) | |
tree | 2b5f089d95128a27f424aa3100762069c74882b5 /mail | |
parent | e3215000495de098a56e76be3c71eca7db4bd61d (diff) | |
download | gsoc2013-evolution-56f4dd919f5ab860dfafe79ce6db3a9567de254f.tar.gz gsoc2013-evolution-56f4dd919f5ab860dfafe79ce6db3a9567de254f.tar.zst gsoc2013-evolution-56f4dd919f5ab860dfafe79ce6db3a9567de254f.zip |
Added a deleted message icon whcih shows when messages are
deleted (takes a while to update the gui for some reason).
Updates the gui when expunged, via a signal.
* pixmaps.h: Added envelope-deleted state.
(message_list_init_renderers): Added a 3rd state to message_status
= deleted.
(ml_value_at): Show the message state as deleted, if it is marked
for deletion.
(folder_changed): When the folder changes, update the display.
(message_list_set_folder): Connect to the folder_changed event
here.
(message_changed): Callback to update the display when the message
changes.
(select_msg): And connect to the message_changed signal so we know
when it cahgnes.
svn path=/trunk/; revision=2746
Diffstat (limited to 'mail')
-rw-r--r-- | mail/ChangeLog | 13 | ||||
-rw-r--r-- | mail/message-list.c | 33 | ||||
-rw-r--r-- | mail/message-list.h | 1 | ||||
-rw-r--r-- | mail/pixmaps.h | 1 | ||||
-rw-r--r-- | mail/pixmaps/envelope-deleted.xpm | 54 |
5 files changed, 96 insertions, 6 deletions
diff --git a/mail/ChangeLog b/mail/ChangeLog index 0f47f2f001..a42d24dcac 100644 --- a/mail/ChangeLog +++ b/mail/ChangeLog @@ -1,5 +1,7 @@ 2000-05-01 NotZed <NotZed@HelixCode.com> + * pixmaps.h: Added envelope-deleted state. + * folder-browser-factory.c: Setup callback for actual delete op. (control_activate): Setup a tool menu item to expnge deleted messages. @@ -25,6 +27,17 @@ result. (select_msg): Changed to use get_message_info, so searches work. (ml_value_at): And same here. + (message_list_init_renderers): Added a 3rd state to message_status + = deleted. + (ml_value_at): Show the message state as deleted, if it is marked + for deletion. + (folder_changed): When the folder changes, update the display. + (message_list_set_folder): Connect to the folder_changed event + here. + (message_changed): Callback to update the display when the message + changes. + (select_msg): And connect to the message_changed signal so we know + when it cahgnes. * mail-display.c: Include missing errno.h. diff --git a/mail/message-list.c b/mail/message-list.c index d1a87201f8..9a535975dd 100644 --- a/mail/message-list.c +++ b/mail/message-list.c @@ -80,6 +80,12 @@ CamelMessageInfo *get_message_info(MessageList *message_list, gint row) return info; } +static void +message_changed(CamelMimeMessage *m, enum _MessageChangeType type, MessageList *message_list) +{ + e_table_model_changed (message_list->table_model); +} + /* select a message and display it */ static void select_msg (MessageList *message_list, gint row) @@ -104,9 +110,11 @@ select_msg (MessageList *message_list, gint row) } } - if (message) + if (message) { + gtk_signal_connect((GtkObject *)message, "message_changed", message_changed, message_list); mail_display_set_message (message_list->parent_folder_browser->mail_display, CAMEL_MEDIUM (message)); + } } } @@ -183,7 +191,10 @@ ml_value_at (ETableModel *etm, int col, int row, void *data) break; case COL_MESSAGE_STATUS: - retval = GINT_TO_POINTER (1); + if (msg_info->flags & CAMEL_MESSAGE_DELETED) + retval = GINT_TO_POINTER (2); + else + retval = GINT_TO_POINTER (1); break; case COL_PRIORITY: @@ -321,6 +332,7 @@ static struct { { attachment_header_xpm, NULL }, { online_status_xpm, NULL }, { message_status_xpm, NULL }, + { envelope_deleted_xpm, NULL }, { NULL, NULL }, }; @@ -357,12 +369,13 @@ message_list_init_renderers (MessageList *message_list) * Message status */ { - GdkPixbuf *images [2]; + GdkPixbuf *images [3]; images [0] = states_pixmaps [0].pixbuf; images [1] = states_pixmaps [1].pixbuf; + images [2] = states_pixmaps [7].pixbuf; - message_list->render_message_status = e_cell_toggle_new (0, 2, images); + message_list->render_message_status = e_cell_toggle_new (0, 3, images); } /* @@ -688,6 +701,13 @@ message_list_set_search (MessageList *message_list, const char *search) select_msg (message_list, 0); } +static void +folder_changed(CamelFolder *f, int type, MessageList *message_list) +{ + e_table_model_changed (message_list->table_model); + select_msg (message_list, 0); +} + void message_list_set_folder (MessageList *message_list, CamelFolder *camel_folder) { @@ -736,14 +756,15 @@ message_list_set_folder (MessageList *message_list, CamelFolder *camel_folder) } - camel_folder_open (camel_folder, FOLDER_OPEN_RW, &ex); if (camel_exception_get_id (&ex)) { printf ("Unable to open folder: %s\n", ex.desc?ex.desc:"unknown_reason"); return; } - + + gtk_signal_connect((GtkObject *)camel_folder, "folder_changed", folder_changed, message_list); + gtk_object_ref (GTK_OBJECT (camel_folder)); e_table_model_changed (message_list->table_model); diff --git a/mail/message-list.h b/mail/message-list.h index fc20302b25..e4d7189278 100644 --- a/mail/message-list.h +++ b/mail/message-list.h @@ -75,6 +75,7 @@ GtkType message_list_get_type (void); BonoboObject *message_list_new (FolderBrowser *parent_folder_browser); void message_list_set_folder (MessageList *message_list, CamelFolder *camel_folder); +void message_list_set_search (MessageList *message_list, const char *search); GtkWidget *message_list_get_widget (MessageList *message_list); #endif /* _MESSAGE_LIST_H_ */ diff --git a/mail/pixmaps.h b/mail/pixmaps.h index f41e3e0086..fdbb932771 100644 --- a/mail/pixmaps.h +++ b/mail/pixmaps.h @@ -8,6 +8,7 @@ #include "pixmaps/attachment-header.xpm" #include "pixmaps/online-status.xpm" #include "pixmaps/message-status.xpm" +#include "pixmaps/envelope-deleted.xpm" #endif /* EVOLUTION_PIXMAPS_H */ diff --git a/mail/pixmaps/envelope-deleted.xpm b/mail/pixmaps/envelope-deleted.xpm new file mode 100644 index 0000000000..9588ad2f0b --- /dev/null +++ b/mail/pixmaps/envelope-deleted.xpm @@ -0,0 +1,54 @@ +/* XPM */ +static char * envelope_deleted_xpm[] = { +"16 16 35 1", +" c None", +". c #FF0000", +"+ c #000000", +"@ c #837D71", +"# c #FFFFFF", +"$ c #4E4B42", +"% c #767165", +"& c #FFFEFE", +"* c #FFF4DB", +"= c #F4E9D1", +"- c #625D54", +"; c #D0C7B2", +"> c #767166", +", c #FFFDFA", +"' c #666257", +") c #F2E7CF", +"! c #C8BFAB", +"~ c #FFFEFC", +"{ c #F6EBD3", +"] c #EEE3CC", +"^ c #918A7C", +"/ c #E0D6C0", +"( c #C7BEAA", +"_ c #8A8476", +": c #F9EED5", +"< c #F1E6CE", +"[ c #F7ECD3", +"} c #EFE4CD", +"| c #D1C7B2", +"1 c #C1B8A5", +"2 c #C2B9A6", +"3 c #C0B7A4", +"4 c #C3BAA7", +"5 c #C4BBA8", +"6 c #CAC1AD", +" ", +" ", +" . ", +" ... ... ", +" ... .. ", +" ++..++..+++ ", +" +@###...###$+ ", +" +#%&*...*=-;+ ", +" +#*>..,..')!+ ", +" +#*..~*{.*]!+ ", +" +#..^'#'../(+ ", +" +#._**'{{..(+ ", +" +..*]:<[}|..+ ", +" +.122234456.+ ", +" +++++++++++ ", +" "}; |