aboutsummaryrefslogtreecommitdiffstats
path: root/mail/mail-callbacks.c
diff options
context:
space:
mode:
authorJeffrey Stedfast <fejj@helixcode.com>2000-11-06 08:53:20 +0800
committerJeffrey Stedfast <fejj@src.gnome.org>2000-11-06 08:53:20 +0800
commit9ca299b427db9febb37208a33d238463f7a9b3bd (patch)
treeb4ef8ff94113c5d81a800d45ed605f1739f3d49d /mail/mail-callbacks.c
parent2e53ea5326b120e26d3e062897b955d95988ff4f (diff)
downloadgsoc2013-evolution-9ca299b427db9febb37208a33d238463f7a9b3bd.tar.gz
gsoc2013-evolution-9ca299b427db9febb37208a33d238463f7a9b3bd.tar.zst
gsoc2013-evolution-9ca299b427db9febb37208a33d238463f7a9b3bd.zip
Added an "Undelete" option to the right-click menu and also set a mask so
2000-11-05 Jeffrey Stedfast <fejj@helixcode.com> * folder-browser.c (on_right_click): Added an "Undelete" option to the right-click menu and also set a mask so it was only selectable if the message is marked as deleted. Also set a mask for "Mark as Read" and "Mark as Unread". * mail-callbacks.c (undelete_msg): New callback to undelete messages. svn path=/trunk/; revision=6407
Diffstat (limited to 'mail/mail-callbacks.c')
-rw-r--r--mail/mail-callbacks.c36
1 files changed, 35 insertions, 1 deletions
diff --git a/mail/mail-callbacks.c b/mail/mail-callbacks.c
index e283a02d5c..114b906c78 100644
--- a/mail/mail-callbacks.c
+++ b/mail/mail-callbacks.c
@@ -663,6 +663,8 @@ edit_msg (GtkWidget *widget, gpointer user_data)
mail_do_edit_messages (fb->folder, uids, (GtkSignalFunc) composer_send_cb);
}
+/* FIXME: now that we have an undelete_msg, we should make this only
+ set the deleted flag? */
void
delete_msg (GtkWidget *button, gpointer user_data)
{
@@ -672,7 +674,7 @@ delete_msg (GtkWidget *button, gpointer user_data)
uids = g_ptr_array_new ();
message_list_foreach (ml, enumerate_msg, uids);
-
+
/*
* Toggling a flag is an "instantaneous" operation, so if
* we're only doing one, just do it and return, rather than
@@ -698,6 +700,38 @@ delete_msg (GtkWidget *button, gpointer user_data)
}
void
+undelete_msg (GtkWidget *button, gpointer user_data)
+{
+ FolderBrowser *fb = user_data;
+ MessageList *ml = fb->message_list;
+ GPtrArray *uids;
+
+ uids = g_ptr_array_new ();
+ message_list_foreach (ml, enumerate_msg, uids);
+
+ /*
+ * Toggling a flag is an "instantaneous" operation, so if
+ * we're only doing one, just do it and return, rather than
+ * queueing it for the other thread. This makes the "Delete"
+ * key work correctly (move to the next message) again.
+ * - Dan
+ */
+ if (uids->len == 1) {
+ char *uid = uids->pdata[0];
+
+ mail_tool_camel_lock_up ();
+ camel_folder_set_message_flags (ml->folder, uid,
+ CAMEL_MESSAGE_DELETED,
+ 0);
+ mail_tool_camel_lock_down ();
+ } else {
+ mail_do_flag_messages (ml->folder, uids, TRUE,
+ CAMEL_MESSAGE_DELETED,
+ 0);
+ }
+}
+
+void
expunge_folder (BonoboUIComponent *uih, void *user_data, const char *path)
{
FolderBrowser *fb = FOLDER_BROWSER(user_data);