aboutsummaryrefslogtreecommitdiffstats
path: root/mail/mail-callbacks.c
diff options
context:
space:
mode:
authorDan Winship <danw@src.gnome.org>2001-05-11 00:16:06 +0800
committerDan Winship <danw@src.gnome.org>2001-05-11 00:16:06 +0800
commitdd04e750f24f2e0300bc45e4916dddf6d492024c (patch)
treeac6f49d91f1e4a00b0c3893bbbce742f82d1a550 /mail/mail-callbacks.c
parentc414a3739a0ff56590b093c64ff27122949c5ee3 (diff)
downloadgsoc2013-evolution-dd04e750f24f2e0300bc45e4916dddf6d492024c.tar
gsoc2013-evolution-dd04e750f24f2e0300bc45e4916dddf6d492024c.tar.gz
gsoc2013-evolution-dd04e750f24f2e0300bc45e4916dddf6d492024c.tar.bz2
gsoc2013-evolution-dd04e750f24f2e0300bc45e4916dddf6d492024c.tar.lz
gsoc2013-evolution-dd04e750f24f2e0300bc45e4916dddf6d492024c.tar.xz
gsoc2013-evolution-dd04e750f24f2e0300bc45e4916dddf6d492024c.tar.zst
gsoc2013-evolution-dd04e750f24f2e0300bc45e4916dddf6d492024c.zip
Don't advance to the next undeleted message after "Delete"...
* folder-browser.c (on_key_press): Don't advance to the next undeleted message after "Delete"... * mail-callbacks.c (delete_msg): ...instead, do it here, whether the user used Delete, Alt+D, or the toolbar. (But only if they only deleted a single message.) * message-list.c (message_list_select): Don't clear the display on failure. (build_tree): Clear the display when the currently-selected message stops existing and we don't have an obvious message to select instead of it. (Eg, when deleting the last message with "hide deleted messages" set, or expunging while a deleted message is selected.) svn path=/trunk/; revision=9744
Diffstat (limited to 'mail/mail-callbacks.c')
-rw-r--r--mail/mail-callbacks.c18
1 files changed, 14 insertions, 4 deletions
diff --git a/mail/mail-callbacks.c b/mail/mail-callbacks.c
index 4e1741db63..0f60037da5 100644
--- a/mail/mail-callbacks.c
+++ b/mail/mail-callbacks.c
@@ -945,8 +945,8 @@ invert_selection (BonoboUIComponent *uih, void *user_data, const char *path)
e_tree_invert_selection (ml->tree);
}
-/* flag all selected messages */
-static void
+/* flag all selected messages. Return number flagged */
+static int
flag_messages(FolderBrowser *fb, guint32 mask, guint32 set)
{
MessageList *ml = fb->message_list;
@@ -954,7 +954,7 @@ flag_messages(FolderBrowser *fb, guint32 mask, guint32 set)
int i;
if (ml->folder == NULL)
- return;
+ return 0;
/* could just use specific callback but i'm lazy */
uids = g_ptr_array_new ();
@@ -967,6 +967,8 @@ flag_messages(FolderBrowser *fb, guint32 mask, guint32 set)
camel_folder_thaw (ml->folder);
g_ptr_array_free (uids, TRUE);
+
+ return i;
}
void
@@ -1338,7 +1340,15 @@ save_msg (GtkWidget *widget, gpointer user_data)
void
delete_msg (GtkWidget *button, gpointer user_data)
{
- flag_messages(FOLDER_BROWSER(user_data), CAMEL_MESSAGE_DELETED | CAMEL_MESSAGE_SEEN, CAMEL_MESSAGE_DELETED | CAMEL_MESSAGE_SEEN);
+ FolderBrowser *fb = FOLDER_BROWSER (user_data);
+ int deleted, row;
+
+ deleted = flag_messages (fb, CAMEL_MESSAGE_DELETED | CAMEL_MESSAGE_SEEN,
+ CAMEL_MESSAGE_DELETED | CAMEL_MESSAGE_SEEN);
+ if (deleted == 1) {
+ row = e_tree_row_of_node (fb->message_list->tree, e_tree_get_cursor (fb->message_list->tree));
+ message_list_select (fb->message_list, row, MESSAGE_LIST_SELECT_NEXT, 0, CAMEL_MESSAGE_DELETED);
+ }
}
void