2007-11-23 [wwp] 3.1.0cvs25
authorTristan Chabredier <wwp@claws-mail.org>
Fri, 23 Nov 2007 10:15:37 +0000 (10:15 +0000)
committerTristan Chabredier <wwp@claws-mail.org>
Fri, 23 Nov 2007 10:15:37 +0000 (10:15 +0000)
* src/prefs_common.c
* src/prefs_common.h
* src/prefs_summary_open.c
* src/prefs_summary_open.h
* src/summaryview.c
Add "select first email in list" to the list of possible selections
when opening a folder.

ChangeLog
PATCHSETS
configure.ac
src/prefs_common.c
src/prefs_common.h
src/prefs_summary_open.c
src/prefs_summary_open.h
src/summaryview.c

index 9d69016..7aa1708 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2007-11-23 [wwp]       3.1.0cvs25
+
+       * src/prefs_common.c
+       * src/prefs_common.h
+       * src/prefs_summary_open.c
+       * src/prefs_summary_open.h
+       * src/summaryview.c
+               Add "select first email in list" to the list of possible selections
+               when opening a folder.
+
 2007-11-23 [paul]      3.1.0cvs24
 
        * po/de.po
index cfaae2f..3712738 100644 (file)
--- a/PATCHSETS
+++ b/PATCHSETS
 ( cvs diff -u -r 1.1.2.10 -r 1.1.2.11 src/prefs_logging.c;  ) > 3.1.0cvs22.patchset
 ( cvs diff -u -r 1.1.2.35 -r 1.1.2.36 src/prefs_msg_colors.c;  ) > 3.1.0cvs23.patchset
 ( cvs diff -u -r 1.58.2.34 -r 1.58.2.35 po/de.po;  ) > 3.1.0cvs24.patchset
+( cvs diff -u -r 1.204.2.154 -r 1.204.2.155 src/prefs_common.c;  cvs diff -u -r 1.103.2.99 -r 1.103.2.100 src/prefs_common.h;  cvs diff -u -r 1.1.2.5 -r 1.1.2.6 src/prefs_summary_open.c;  cvs diff -u -r 1.1.2.2 -r 1.1.2.3 src/prefs_summary_open.h;  cvs diff -u -r 1.395.2.338 -r 1.395.2.339 src/summaryview.c;  ) > 3.1.0cvs25.patchset
index d71b441..2b084c7 100644 (file)
@@ -11,7 +11,7 @@ MINOR_VERSION=1
 MICRO_VERSION=0
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=24
+EXTRA_VERSION=25
 EXTRA_RELEASE=
 EXTRA_GTK2_VERSION=
 
index 17f0aca..a936c76 100644 (file)
@@ -741,6 +741,7 @@ static PrefParam param[] = {
        {"show_tooltips", "TRUE", &prefs_common.show_tooltips,
         P_BOOL, NULL, NULL, NULL},
 
+       /* do it SUMMARY_OPEN_ACTIONS-1 times */
        {"summary_select_prio1", "0", &prefs_common.summary_select_prio[0], P_ENUM,
         NULL, NULL, NULL},
        {"summary_select_prio2", "0", &prefs_common.summary_select_prio[1], P_ENUM,
@@ -753,6 +754,8 @@ static PrefParam param[] = {
         NULL, NULL, NULL},
        {"summary_select_prio6", "0", &prefs_common.summary_select_prio[5], P_ENUM,
         NULL, NULL, NULL},
+       {"summary_select_prio7", "0", &prefs_common.summary_select_prio[6], P_ENUM,
+        NULL, NULL, NULL},
 
        {"mark_as_read_on_new_window", "FALSE",
         &prefs_common.mark_as_read_on_new_window,
index a3b23cd..d0f474e 100644 (file)
@@ -33,6 +33,7 @@
 #include "textview.h"
 #include "procmime.h"
 #include "prefs_msg_colors.h"
+#include "prefs_summary_open.h"
 
 typedef struct _PrefsCommon    PrefsCommon;
 
@@ -76,7 +77,8 @@ typedef enum
        ACTION_UNREAD,
        ACTION_LAST_OPENED,
        ACTION_LAST_LIST,
-       ACTION_NOTHING
+       ACTION_NOTHING,
+       ACTION_FIRST_LIST
 } EntryAction;
 
 typedef enum
@@ -343,7 +345,7 @@ struct _PrefsCommon
        SelectOnEntry select_on_entry;
        gboolean show_tooltips;
 
-       EntryAction summary_select_prio[6];
+       EntryAction summary_select_prio[SUMMARY_OPEN_ACTIONS-1];
 
        NextUnreadMsgDialogShow next_unread_msg_dialog;
        gboolean add_address_by_click;
index da19a4f..ac02794 100644 (file)
@@ -101,21 +101,22 @@ static void drag_end      (GtkTreeView *list_view,
                         GdkDragContext *context,
                         gpointer data);
 
-static EntryAction saved_summary_select_prio[6];
+static EntryAction saved_summary_select_prio[SUMMARY_OPEN_ACTIONS-1];
 
-static gchar *action_name[7] = 
+static gchar *action_name[SUMMARY_OPEN_ACTIONS] = 
 {        ("UNSET (!)"),
         N_("first marked email"),
         N_("first new email"),
         N_("first unread email"),
         N_("last opened email"),
         N_("last email in the list"),
-        N_("none")
+        N_("none"),
+        N_("first email in the list")
 };
 
 void prefs_summary_open_open(void)
 {
-       int i = 0;
+       int i;
        if (!summaryopen.window) {
                prefs_summary_open_create();
        }
@@ -125,7 +126,7 @@ void prefs_summary_open_open(void)
 
        prefs_summary_open_set_dialog();
        
-       for (i = 0; i < 6; i++)
+       for (i = 0; i < SUMMARY_OPEN_ACTIONS-1; i++)
                saved_summary_select_prio[i] = prefs_common.summary_select_prio[i];
 
        gtk_widget_show(summaryopen.window);
@@ -250,7 +251,7 @@ static void prefs_summary_open_create(void)
        gtk_box_pack_start (GTK_BOX (list_view_hbox), list_view_hbox2, TRUE, TRUE, 0);
 
        list_view_scrolledwin = gtk_scrolled_window_new (NULL, NULL);
-       gtk_widget_set_size_request (list_view_scrolledwin, 200, 210);
+       gtk_widget_set_size_request (list_view_scrolledwin, 200, 230);
        gtk_widget_show (list_view_scrolledwin);
        gtk_box_pack_start (GTK_BOX (list_view_hbox2), list_view_scrolledwin,
                            TRUE, TRUE, 0);
@@ -305,6 +306,7 @@ static void prefs_summary_open_create(void)
        summaryopen.actions_list_view = actions_list_view;
 }
 
+/* do it SUMMARY_OPEN_ACTIONS-1 times */
 #define SET_PRIO(p_one,p_two,p_three,p_four) {                         \
        prefs_common.summary_select_prio[0] = p_one;                    \
        prefs_common.summary_select_prio[1] = p_two;                    \
@@ -312,6 +314,7 @@ static void prefs_summary_open_create(void)
        prefs_common.summary_select_prio[3] = p_four;                   \
        prefs_common.summary_select_prio[4] = ACTION_UNSET;             \
        prefs_common.summary_select_prio[5] = ACTION_UNSET;             \
+       prefs_common.summary_select_prio[6] = ACTION_UNSET;             \
 }                                                      
 
 void prefs_summary_open_set_defaults(void)
@@ -342,9 +345,9 @@ static void prefs_summary_open_set_dialog(void)
        GtkTreeView *possible_list_view = GTK_TREE_VIEW(summaryopen.possible_actions_list_view);
        GtkTreeView *actions_list_view = GTK_TREE_VIEW(summaryopen.actions_list_view);
        GtkTreeModel *model_poss, *model_act;
-       int i = 0;
+       int i;
        gboolean set = FALSE;
-       gboolean used[7] = {FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE};
+       gboolean used[SUMMARY_OPEN_ACTIONS-1] = {FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE};
 
        model_poss = gtk_tree_view_get_model(possible_list_view);
        model_act = gtk_tree_view_get_model(actions_list_view);
@@ -353,14 +356,14 @@ static void prefs_summary_open_set_dialog(void)
        gtk_list_store_clear(GTK_LIST_STORE(model_act));
 
 fill:
-       for (i = 0; i < 6; i++) {
+       for (i = 0; i < SUMMARY_OPEN_ACTIONS-1; i++) {
                EntryAction act = prefs_common.summary_select_prio[i];
 
                if (act == ACTION_UNSET) 
                        continue;
                
                set = TRUE;
-               used[act] = TRUE;
+               used[act-1] = TRUE;
                prefs_summary_open_insert_action(GTK_LIST_STORE
                                        (model_act), action_name[act], act);    
        }
@@ -370,8 +373,8 @@ fill:
                goto fill;
        }
 
-       for (i = ACTION_MARKED; i <= ACTION_NOTHING; i++) {
-               if (!used[i]) {
+       for (i = 1; i < SUMMARY_OPEN_ACTIONS; i++) {
+               if (!used[i-1]) {
                        prefs_summary_open_insert_action(GTK_LIST_STORE
                                        (model_poss), action_name[i], i);       
                }
@@ -392,7 +395,7 @@ static void prefs_summary_open_set_list(void)
                prefs_common.summary_select_prio[row] = GPOINTER_TO_INT(data);
                row++;                          
        }
-       for (; row < 6; row++) {
+       for (; row < SUMMARY_OPEN_ACTIONS-1; row++) {
                prefs_common.summary_select_prio[row] = ACTION_UNSET;
        }
 }
@@ -531,8 +534,8 @@ static gboolean prefs_summary_open_key_pressed(GtkWidget *widget,
 
 static void prefs_summary_open_ok(void)
 {
-       int i = 0;
-       for (i = 0; i < 6; i++)
+       int i;
+       for (i = 0; i < SUMMARY_OPEN_ACTIONS-1; i++)
                saved_summary_select_prio[i] = prefs_common.summary_select_prio[i];
 
        gtk_widget_hide(summaryopen.window);
@@ -540,8 +543,8 @@ static void prefs_summary_open_ok(void)
 
 static void prefs_summary_open_cancel(void)
 {
-       int i = 0;
-       for (i = 0; i < 6; i++)
+       int i;
+       for (i = 0; i < SUMMARY_OPEN_ACTIONS-1; i++)
                prefs_common.summary_select_prio[i] = saved_summary_select_prio[i];
 
        gtk_widget_hide(summaryopen.window);
index 9dae8c1..d1524ea 100644 (file)
@@ -20,6 +20,8 @@
 #ifndef __PREFS_SUMMARY_OPEN_H__
 #define __PREFS_SUMMARY_OPEN_H__
 
+#define SUMMARY_OPEN_ACTIONS 8
+
 void prefs_summary_open_open           (void);
 void prefs_summary_open_set_defaults   (void);
 const gchar *summary_open_get_label    (int act);
index 8b88653..54795ea 100644 (file)
@@ -1419,6 +1419,14 @@ gboolean summary_show(SummaryView *summaryview, FolderItem *item)
                                                 ? 0 : GTK_CLIST(ctree)->rows - 1);
                                }
                                break;
+                       case ACTION_FIRST_LIST:
+                               if (GTK_CLIST(ctree)->row_list != NULL) {
+                                       node = gtk_ctree_node_nth
+                                               (ctree,
+                                                item->sort_type == SORT_ASCENDING
+                                                ? 0 : GTK_CLIST(ctree)->rows - 1);
+                               }
+                               break;
                        case ACTION_NOTHING:
                        case ACTION_UNSET:
                                node = NULL;