aboutsummaryrefslogtreecommitdiffstats
path: root/mail
diff options
context:
space:
mode:
authorChristopher James Lahey <clahey@ximian.com>2001-08-20 10:13:12 +0800
committerChris Lahey <clahey@src.gnome.org>2001-08-20 10:13:12 +0800
commit8c156210fe4b6efef6252d877f8e0d471df3f03a (patch)
treea036ee9f92ea419733acf5c4b735f734ef8ac6d9 /mail
parenta17f785245005c80614e6c027cdf1a3f49518fac (diff)
downloadgsoc2013-evolution-8c156210fe4b6efef6252d877f8e0d471df3f03a.tar
gsoc2013-evolution-8c156210fe4b6efef6252d877f8e0d471df3f03a.tar.gz
gsoc2013-evolution-8c156210fe4b6efef6252d877f8e0d471df3f03a.tar.bz2
gsoc2013-evolution-8c156210fe4b6efef6252d877f8e0d471df3f03a.tar.lz
gsoc2013-evolution-8c156210fe4b6efef6252d877f8e0d471df3f03a.tar.xz
gsoc2013-evolution-8c156210fe4b6efef6252d877f8e0d471df3f03a.tar.zst
gsoc2013-evolution-8c156210fe4b6efef6252d877f8e0d471df3f03a.zip
Made delete make the cursor go backwards if the user is sorting by
2001-08-19 Christopher James Lahey <clahey@ximian.com> * mail-callbacks.c (delete_msg): Made delete make the cursor go backwards if the user is sorting by descending date. svn path=/trunk/; revision=12236
Diffstat (limited to 'mail')
-rw-r--r--mail/ChangeLog5
-rw-r--r--mail/mail-callbacks.c34
2 files changed, 33 insertions, 6 deletions
diff --git a/mail/ChangeLog b/mail/ChangeLog
index 810aa19e33..ae9435b565 100644
--- a/mail/ChangeLog
+++ b/mail/ChangeLog
@@ -1,3 +1,8 @@
+2001-08-19 Christopher James Lahey <clahey@ximian.com>
+
+ * mail-callbacks.c (delete_msg): Made delete make the cursor go
+ backwards if the user is sorting by descending date.
+
2001-08-19 Jeffrey Stedfast <fejj@ximian.com>
Note: The following changes were based on Zbigniew Chyla's fixes.
diff --git a/mail/mail-callbacks.c b/mail/mail-callbacks.c
index 3ff8e00a1d..429f5928f2 100644
--- a/mail/mail-callbacks.c
+++ b/mail/mail-callbacks.c
@@ -1566,17 +1566,39 @@ delete_msg (GtkWidget *button, gpointer user_data)
/* Select the next message if we are only deleting one message */
if (deleted) {
+ MessageListSelectDirection direction = MESSAGE_LIST_SELECT_NEXT;
+ ETableState *state;
+
+ state = e_tree_get_state_object (fb->message_list->tree);
+ if (e_table_sort_info_grouping_get_count(state->sort_info) == 0 &&
+ e_table_sort_info_sorting_get_count(state->sort_info) == 1) {
+ ETableSortColumn column;
+
+ column = e_table_sort_info_sorting_get_nth (state->sort_info, 0);
+ if ((column.column == COL_SENT ||
+ column.column == COL_RECEIVED) &&
+ column.ascending == FALSE) {
+ direction = MESSAGE_LIST_SELECT_PREVIOUS;
+ }
+ }
+ gtk_object_unref (GTK_OBJECT (state));
+
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,
+ if (((direction == MESSAGE_LIST_SELECT_NEXT && (row+1 == e_tree_row_count (fb->message_list->tree))) ||
+ (direction == MESSAGE_LIST_SELECT_PREVIOUS && (row == 0)))
+ && mail_config_get_hide_deleted ()) {
+ if (direction == MESSAGE_LIST_SELECT_NEXT)
+ direction = MESSAGE_LIST_SELECT_PREVIOUS;
+ else
+ direction = MESSAGE_LIST_SELECT_NEXT;
+ message_list_select (fb->message_list, row, direction,
0, CAMEL_MESSAGE_DELETED, FALSE);
- else
- message_list_select (fb->message_list, row, MESSAGE_LIST_SELECT_NEXT,
+ } else
+ message_list_select (fb->message_list, row, direction,
0, 0, FALSE);
}
}