diff options
author | Michael Zucci <zucchi@src.gnome.org> | 2000-05-02 11:00:56 +0800 |
---|---|---|
committer | Michael Zucci <zucchi@src.gnome.org> | 2000-05-02 11:00:56 +0800 |
commit | 0cb506a96abd31962280e8c1f4372c5163489a48 (patch) | |
tree | b07e10f61b942e6f6ff4cb5f9c3e51495b078603 /mail/mail-ops.c | |
parent | 2cc9dabf78074ba6dfa4f3c84285b607fdf8cc54 (diff) | |
download | gsoc2013-evolution-0cb506a96abd31962280e8c1f4372c5163489a48.tar.gz gsoc2013-evolution-0cb506a96abd31962280e8c1f4372c5163489a48.tar.zst gsoc2013-evolution-0cb506a96abd31962280e8c1f4372c5163489a48.zip |
Ok, you can now delete and expunge messages ... not really pretty
(gui wise), but it works, after a fashion.
> * folder-browser-factory.c: Setup callback for actual delete op.
> (control_activate): Setup a tool menu item to expnge deleted
> messages.
>
> * mail-ops.c (delete_msg): Toggle the delete flag on a message.
> (expunge_folder): New function to expunge deleted messages from
> the current folder.
svn path=/trunk/; revision=2744
Diffstat (limited to 'mail/mail-ops.c')
-rw-r--r-- | mail/mail-ops.c | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/mail/mail-ops.c b/mail/mail-ops.c index 961f82304e..d9a5b6c113 100644 --- a/mail/mail-ops.c +++ b/mail/mail-ops.c @@ -329,3 +329,45 @@ forward_msg (GtkWidget *button, gpointer user_data) gtk_widget_show (GTK_WIDGET (composer)); } + +void +delete_msg (GtkWidget *button, gpointer user_data) +{ + FolderBrowser *fb = user_data; + + if (fb->mail_display->current_message) { + guint32 flags; + + /* FIXME: table should watch the message with a signal and update display! */ + + flags = camel_mime_message_get_flags(fb->mail_display->current_message); + camel_mime_message_set_flags(fb->mail_display->current_message, CAMEL_MESSAGE_DELETED, ~flags); + printf("Message %s set to %s\n", fb->mail_display->current_message->message_uid, flags&CAMEL_MESSAGE_DELETED?"UNDELETED":"DELETED"); + } +} + +void +expunge_folder (GtkWidget *button, gpointer user_data) +{ + FolderBrowser *fb = FOLDER_BROWSER(user_data); + CamelException ex; + + if (fb->message_list->folder) { + camel_exception_init(&ex); + + camel_folder_expunge(fb->message_list->folder, &ex); + + /* FIXME: is there a better way to force an update? */ + /* FIXME: Folder should raise a signal to say its contents has changed ... */ + e_table_model_changed (fb->message_list->table_model); + +/* this always throws an error, when it shouldn't? */ +#if 0 + if (camel_exception_get_id (&ex) != CAMEL_EXCEPTION_NONE) { + GtkWindow *window = GTK_WINDOW (gtk_widget_get_ancestor (GTK_WIDGET (fb), GTK_TYPE_WINDOW)); + mail_exception_dialog ("Unable to expunge deleted messages", &ex, window); + } +#endif + } +} + |