extend 'default selection when entering a folder'
authorPaul <paul@claws-mail.org>
Tue, 19 Dec 2017 11:40:33 +0000 (11:40 +0000)
committerPaul <paul@claws-mail.org>
Tue, 19 Dec 2017 11:40:33 +0000 (11:40 +0000)
Renamed 'first ...' to 'oldest ...', and added 'newest ...' in GUI

src/folderview.c
src/prefs_common.c
src/prefs_common.h
src/prefs_summary_open.c
src/prefs_summary_open.h
src/summaryview.c

index 31a8cea..ff84755 100644 (file)
@@ -995,16 +995,16 @@ void folderview_select_next_with_flag(FolderView *folderview,
        
        switch (flag) {
        case MSG_UNREAD:
-               prefs_common.summary_select_prio[0] = ACTION_UNREAD;
+               prefs_common.summary_select_prio[0] = ACTION_OLDEST_UNREAD;
                break;
        case MSG_NEW:
-               prefs_common.summary_select_prio[0] = ACTION_NEW;
+               prefs_common.summary_select_prio[0] = ACTION_OLDEST_NEW;
                break;
        case MSG_MARKED:
-               prefs_common.summary_select_prio[0] = ACTION_MARKED;
+               prefs_common.summary_select_prio[0] = ACTION_OLDEST_MARKED;
                break;
        default:
-               prefs_common.summary_select_prio[0] = ACTION_FIRST_LIST;
+               prefs_common.summary_select_prio[0] = ACTION_OLDEST_LIST;
                break;
        }
 
index 5a5ee4f..4b42e65 100644 (file)
@@ -836,6 +836,12 @@ static PrefParam param[] = {
         NULL, NULL, NULL},
        {"summary_select_prio7", "0", &prefs_common.summary_select_prio[6], P_ENUM,
         NULL, NULL, NULL},
+       {"summary_select_prio8", "0", &prefs_common.summary_select_prio[7], P_ENUM,
+        NULL, NULL, NULL},
+       {"summary_select_prio9", "0", &prefs_common.summary_select_prio[8], P_ENUM,
+        NULL, NULL, NULL},
+       {"summary_select_prio10", "0", &prefs_common.summary_select_prio[9], P_ENUM,
+        NULL, NULL, NULL},
 
        {"mark_as_read_on_new_window", "FALSE",
         &prefs_common.mark_as_read_on_new_window,
index b94d34c..702db3d 100644 (file)
@@ -74,13 +74,16 @@ typedef enum
 typedef enum
 {
        ACTION_UNSET = 0, /* for backward compatibility */
-       ACTION_MARKED,
-       ACTION_NEW,
-       ACTION_UNREAD,
+       ACTION_OLDEST_MARKED,
+       ACTION_OLDEST_NEW,
+       ACTION_OLDEST_UNREAD,
        ACTION_LAST_OPENED,
-       ACTION_LAST_LIST,
+       ACTION_NEWEST_LIST,
        ACTION_NOTHING,
-       ACTION_FIRST_LIST
+       ACTION_OLDEST_LIST,
+       ACTION_NEWEST_MARKED,
+       ACTION_NEWEST_NEW,
+       ACTION_NEWEST_UNREAD
 } EntryAction;
 
 typedef enum
index 00dfecd..9331e45 100644 (file)
@@ -106,13 +106,16 @@ static EntryAction saved_summary_select_prio[SUMMARY_OPEN_ACTIONS-1];
 
 static gchar *action_name[SUMMARY_OPEN_ACTIONS] = 
 {        ("UNSET (!)"),
-        N_("first marked email"),
-        N_("first new email"),
-        N_("first unread email"),
+        N_("oldest marked email"),
+        N_("oldest new email"),
+        N_("oldest unread email"),
         N_("last opened email"),
-        N_("last email in the list"),
+        N_("newest email in the list"),
         N_("none"),
-        N_("first email in the list")
+        N_("oldest email in the list"),
+        N_("newest marked email"),
+        N_("newest new email"),
+        N_("newest unread email")
 };
 
 void prefs_summary_open_open(void)
@@ -314,27 +317,30 @@ static void prefs_summary_open_create(void)
        prefs_common.summary_select_prio[4] = ACTION_UNSET;             \
        prefs_common.summary_select_prio[5] = ACTION_UNSET;             \
        prefs_common.summary_select_prio[6] = ACTION_UNSET;             \
-}                                                      
+       prefs_common.summary_select_prio[7] = ACTION_UNSET;             \
+       prefs_common.summary_select_prio[8] = ACTION_UNSET;             \
+       prefs_common.summary_select_prio[9] = ACTION_UNSET;             \
+}
 
 void prefs_summary_open_set_defaults(void)
 {
        switch (prefs_common.select_on_entry) {
                case SELECTONENTRY_MNU:
-                       SET_PRIO(ACTION_MARKED, ACTION_NEW, ACTION_UNREAD, ACTION_LAST_LIST); break;
+                       SET_PRIO(ACTION_OLDEST_MARKED, ACTION_OLDEST_NEW, ACTION_OLDEST_UNREAD, ACTION_NEWEST_LIST); break;
                case SELECTONENTRY_MUN:
-                       SET_PRIO(ACTION_MARKED, ACTION_UNREAD, ACTION_NEW, ACTION_LAST_LIST); break;
+                       SET_PRIO(ACTION_OLDEST_MARKED, ACTION_OLDEST_UNREAD, ACTION_OLDEST_NEW, ACTION_NEWEST_LIST); break;
                case SELECTONENTRY_NMU:
-                       SET_PRIO(ACTION_NEW, ACTION_MARKED, ACTION_UNREAD, ACTION_LAST_LIST); break;
+                       SET_PRIO(ACTION_OLDEST_NEW, ACTION_OLDEST_MARKED, ACTION_OLDEST_UNREAD, ACTION_NEWEST_LIST); break;
                case SELECTONENTRY_NUM:
-                       SET_PRIO(ACTION_NEW, ACTION_UNREAD, ACTION_MARKED, ACTION_LAST_LIST); break;
+                       SET_PRIO(ACTION_OLDEST_NEW, ACTION_OLDEST_UNREAD, ACTION_OLDEST_MARKED, ACTION_NEWEST_LIST); break;
                case SELECTONENTRY_UNM:
-                       SET_PRIO(ACTION_UNREAD, ACTION_NEW, ACTION_MARKED, ACTION_LAST_LIST); break;
+                       SET_PRIO(ACTION_OLDEST_UNREAD, ACTION_OLDEST_NEW, ACTION_OLDEST_MARKED, ACTION_NEWEST_LIST); break;
                case SELECTONENTRY_UMN:
-                       SET_PRIO(ACTION_UNREAD, ACTION_MARKED, ACTION_NEW, ACTION_LAST_LIST); break;
+                       SET_PRIO(ACTION_OLDEST_UNREAD, ACTION_OLDEST_MARKED, ACTION_OLDEST_NEW, ACTION_NEWEST_LIST); break;
                case SELECTONENTRY_LAST:
-                       SET_PRIO(ACTION_LAST_OPENED, ACTION_LAST_LIST, ACTION_UNSET, ACTION_UNSET); break;
+                       SET_PRIO(ACTION_LAST_OPENED, ACTION_NEWEST_LIST, ACTION_UNSET, ACTION_UNSET); break;
                case SELECTONENTRY_NOTHING:
-                       SET_PRIO(ACTION_LAST_LIST, ACTION_UNSET, ACTION_UNSET, ACTION_UNSET); break;
+                       SET_PRIO(ACTION_NEWEST_LIST, ACTION_UNSET, ACTION_UNSET, ACTION_UNSET); break;
                default:
                        break;
        }
index f6e16df..e0f0a14 100644 (file)
@@ -20,7 +20,7 @@
 #ifndef __PREFS_SUMMARY_OPEN_H__
 #define __PREFS_SUMMARY_OPEN_H__
 
-#define SUMMARY_OPEN_ACTIONS 8
+#define SUMMARY_OPEN_ACTIONS 11
 
 void prefs_summary_open_open           (void);
 void prefs_summary_open_set_defaults   (void);
index ebb344f..deaac7b 100644 (file)
@@ -1518,7 +1518,7 @@ gboolean summary_show(SummaryView *summaryview, FolderItem *item)
                        EntryAction act = prefs_common.summary_select_prio[i];
                        
                        switch(act) {
-                       case ACTION_MARKED:
+                       case ACTION_OLDEST_MARKED:
                                if (summaryview->sort_type == SORT_ASCENDING)
                                        node = summary_find_next_flagged_msg(summaryview, NULL,
                                             MSG_MARKED, FALSE);
@@ -1526,7 +1526,15 @@ gboolean summary_show(SummaryView *summaryview, FolderItem *item)
                                        node = summary_find_prev_flagged_msg(summaryview, NULL,
                                             MSG_MARKED, FALSE);
                                break;
-                       case ACTION_NEW:
+                       case ACTION_NEWEST_MARKED:
+                               if (summaryview->sort_type == SORT_ASCENDING)
+                                       node = summary_find_prev_flagged_msg(summaryview, NULL,
+                                            MSG_MARKED, FALSE);
+                               else
+                                       node = summary_find_next_flagged_msg(summaryview, NULL,
+                                            MSG_MARKED, FALSE);
+                               break;
+                       case ACTION_OLDEST_NEW:
                                if (summaryview->sort_type == SORT_ASCENDING)
                                        node = summary_find_next_flagged_msg(summaryview, NULL,
                                             MSG_NEW, FALSE);
@@ -1534,7 +1542,15 @@ gboolean summary_show(SummaryView *summaryview, FolderItem *item)
                                        node = summary_find_prev_flagged_msg(summaryview, NULL,
                                             MSG_NEW, FALSE);
                                break;
-                       case ACTION_UNREAD:
+                       case ACTION_NEWEST_NEW:
+                               if (summaryview->sort_type == SORT_ASCENDING)
+                                       node = summary_find_prev_flagged_msg(summaryview, NULL,
+                                            MSG_NEW, FALSE);
+                               else
+                                       node = summary_find_next_flagged_msg(summaryview, NULL,
+                                            MSG_NEW, FALSE);
+                               break;
+                       case ACTION_OLDEST_UNREAD:
                                if (summaryview->sort_type == SORT_ASCENDING)
                                        node = summary_find_next_flagged_msg(summaryview, NULL,
                                             MSG_UNREAD, FALSE);
@@ -1542,13 +1558,21 @@ gboolean summary_show(SummaryView *summaryview, FolderItem *item)
                                        node = summary_find_prev_flagged_msg(summaryview, NULL,
                                             MSG_UNREAD, FALSE);
                                break;
+                       case ACTION_NEWEST_UNREAD:
+                               if (summaryview->sort_type == SORT_ASCENDING)
+                                       node = summary_find_prev_flagged_msg(summaryview, NULL,
+                                            MSG_UNREAD, FALSE);
+                               else
+                                       node = summary_find_next_flagged_msg(summaryview, NULL,
+                                            MSG_UNREAD, FALSE);
+                               break;
                        case ACTION_LAST_OPENED:
                                if (summaryview->folder_item) {
                                        node = summary_find_msg_by_msgnum(summaryview, 
                                                        summaryview->folder_item->last_seen);
                                }
                                break;
-                       case ACTION_LAST_LIST:
+                       case ACTION_NEWEST_LIST:
                                if (GTK_CMCLIST(ctree)->row_list != NULL) {
                                        node = gtk_cmctree_node_nth
                                                (ctree,
@@ -1556,7 +1580,7 @@ gboolean summary_show(SummaryView *summaryview, FolderItem *item)
                                                 ? 0 : GTK_CMCLIST(ctree)->rows - 1);
                                }
                                break;
-                       case ACTION_FIRST_LIST:
+                       case ACTION_OLDEST_LIST:
                                if (GTK_CMCLIST(ctree)->row_list != NULL) {
                                        node = gtk_cmctree_node_nth
                                                (ctree,