diff options
author | Jeffrey Stedfast <fejj@ximian.com> | 2001-10-29 09:44:31 +0800 |
---|---|---|
committer | Jeffrey Stedfast <fejj@src.gnome.org> | 2001-10-29 09:44:31 +0800 |
commit | 9367415dc36546a74f29fa26f89e907bdcf6175e (patch) | |
tree | 3ac53d76c6e7a8a719f762a1afd7081c9d794e9f /mail | |
parent | 777dc4018ac11b565eeacd9967670989bd28d297 (diff) | |
download | gsoc2013-evolution-9367415dc36546a74f29fa26f89e907bdcf6175e.tar.gz gsoc2013-evolution-9367415dc36546a74f29fa26f89e907bdcf6175e.tar.zst gsoc2013-evolution-9367415dc36546a74f29fa26f89e907bdcf6175e.zip |
Move the message-list cursor to the next message. (transfer_msg): If we
2001-10-28 Jeffrey Stedfast <fejj@ximian.com>
* mail-callbacks.c (transfer_msg_done): Move the message-list
cursor to the next message.
(transfer_msg): If we are moving messages, then pass
transfer_msg_done() to mail_transfer_messages() so when it
finishes it can move the cursor to the next undeleted message.
svn path=/trunk/; revision=14313
Diffstat (limited to 'mail')
-rw-r--r-- | mail/ChangeLog | 6 | ||||
-rw-r--r-- | mail/mail-callbacks.c | 35 |
2 files changed, 39 insertions, 2 deletions
diff --git a/mail/ChangeLog b/mail/ChangeLog index 5683bfce01..ef8330367d 100644 --- a/mail/ChangeLog +++ b/mail/ChangeLog @@ -1,5 +1,11 @@ 2001-10-28 Jeffrey Stedfast <fejj@ximian.com> + * mail-callbacks.c (transfer_msg_done): Move the message-list + cursor to the next message. + (transfer_msg): If we are moving messages, then pass + transfer_msg_done() to mail_transfer_messages() so when it + finishes it can move the cursor to the next undeleted message. + * mail-format.c (try_inline_pgp): Check that the special PGP lines begin and end with \n so as to avoid matching against quoted PGP lines. diff --git a/mail/mail-callbacks.c b/mail/mail-callbacks.c index a37f2dd7ea..195715b383 100644 --- a/mail/mail-callbacks.c +++ b/mail/mail-callbacks.c @@ -1221,6 +1221,30 @@ forward (GtkWidget *widget, gpointer user_data) } static void +transfer_msg_done (gboolean ok, void *data) +{ + FolderBrowser *fb = data; + int row; + + if (ok && !FOLDER_BROWSER_IS_DESTROYED (fb)) { + row = e_tree_row_of_node (fb->message_list->tree, + e_tree_get_cursor (fb->message_list->tree)); + + /* If this is the last message and deleted messages + are hidden, select the previous */ + if ((row + 1 == e_tree_row_count (fb->message_list->tree)) + && mail_config_get_hide_deleted ()) + message_list_select (fb->message_list, row, MESSAGE_LIST_SELECT_PREVIOUS, + 0, CAMEL_MESSAGE_DELETED, FALSE); + else + message_list_select (fb->message_list, row, MESSAGE_LIST_SELECT_NEXT, + 0, 0, FALSE); + } + + gtk_object_unref (GTK_OBJECT (fb)); +} + +static void transfer_msg (FolderBrowser *fb, gboolean delete_from_source) { const char *allowed_types[] = { "mail", "vtrash", NULL }; @@ -1256,8 +1280,15 @@ transfer_msg (FolderBrowser *fb, gboolean delete_from_source) uids = g_ptr_array_new (); message_list_foreach (fb->message_list, enumerate_msg, uids); - mail_transfer_messages (fb->folder, uids, delete_from_source, - physical, 0, NULL, NULL); + + if (delete_from_source) { + gtk_object_ref (GTK_OBJECT (fb)); + mail_transfer_messages (fb->folder, uids, delete_from_source, + physical, 0, transfer_msg_done, fb); + } else { + mail_transfer_messages (fb->folder, uids, delete_from_source, + physical, 0, NULL, NULL); + } } void |