2008-07-07 [colin] 3.5.0cvs15
authorColin Leroy <colin@colino.net>
Mon, 7 Jul 2008 16:49:14 +0000 (16:49 +0000)
committerColin Leroy <colin@colino.net>
Mon, 7 Jul 2008 16:49:14 +0000 (16:49 +0000)
* AUTHORS
* src/gtk/authors.h
* src/prefs_common.c
* src/prefs_common.h
* src/prefs_summaries.c
* src/summaryview.c
* src/gtk/authors.h
Change "Always open message when selected" to
a tristate (Never/Always/When preview is visible)
Patch by Jonathan Corbet <corbet@lwn.net>.

AUTHORS
ChangeLog
PATCHSETS
configure.ac
src/gtk/authors.h
src/prefs_common.c
src/prefs_common.h
src/prefs_summaries.c
src/summaryview.c

diff --git a/AUTHORS b/AUTHORS
index 8109a25..95995e0 100644 (file)
--- a/AUTHORS
+++ b/AUTHORS
@@ -255,3 +255,4 @@ contributors (in addition to the above; based on Changelog)
        Federico Heinz
        Marius Glauser
        Christian Cornelssen
+       Jonathan Corbet
index 0fc3832..9d35305 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,16 @@
+2008-07-07 [colin]     3.5.0cvs15
+
+       * AUTHORS
+       * src/gtk/authors.h
+       * src/prefs_common.c
+       * src/prefs_common.h
+       * src/prefs_summaries.c
+       * src/summaryview.c
+       * src/gtk/authors.h
+               Change "Always open message when selected" to
+               a tristate (Never/Always/When preview is visible)
+               Patch by Jonathan Corbet <corbet@lwn.net>.
+
 2008-07-06 [paul]      3.5.0cvs14
 
        * src/addrgather.c
index 8cb388d..db1399a 100644 (file)
--- a/PATCHSETS
+++ b/PATCHSETS
 ( cvs diff -u -r 1.274.2.246 -r 1.274.2.247 src/mainwindow.c;  ) > 3.5.0cvs12.patchset
 ( cvs diff -u -r 1.274.2.247 -r 1.274.2.248 src/mainwindow.c;  cvs diff -u -r 1.39.2.47 -r 1.39.2.48 src/mainwindow.h;  cvs diff -u -r 1.1.2.29 -r 1.1.2.30 src/plugins/pgpcore/prefs_gpg.c;  ) > 3.5.0cvs13.patchset
 ( cvs diff -u -r 1.5.10.20 -r 1.5.10.21 src/addrgather.c;  cvs diff -u -r 1.274.2.248 -r 1.274.2.249 src/mainwindow.c;  ) > 3.5.0cvs14.patchset
+( cvs diff -u -r 1.100.2.62 -r 1.100.2.63 AUTHORS;  cvs diff -u -r 1.1.2.49 -r 1.1.2.50 src/gtk/authors.h;  cvs diff -u -r 1.204.2.173 -r 1.204.2.174 src/prefs_common.c;  cvs diff -u -r 1.103.2.110 -r 1.103.2.111 src/prefs_common.h;  cvs diff -u -r 1.1.2.53 -r 1.1.2.54 src/prefs_summaries.c;  cvs diff -u -r 1.395.2.371 -r 1.395.2.372 src/summaryview.c;  cvs diff -u -r 1.1.2.49 -r 1.1.2.50 src/gtk/authors.h;  ) > 3.5.0cvs15.patchset
index 8e91e0e..8317967 100644 (file)
@@ -11,7 +11,7 @@ MINOR_VERSION=5
 MICRO_VERSION=0
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=14
+EXTRA_VERSION=15
 EXTRA_RELEASE=
 EXTRA_GTK2_VERSION=
 
index 67c33e0..a5ddf98 100644 (file)
@@ -89,6 +89,7 @@ static char *CONTRIBS_LIST[] = {
 "Tsu-Fan Cheng",
 "Manrat Chobchuen",
 "Rich Coe",
+"Jonathan Corbet",
 "Christian Cornelssen",
 "George Danchev",
 "Matthieu Dazy",
index 2c9207e..273854e 100644 (file)
@@ -759,7 +759,7 @@ static PrefParam param[] = {
         NULL, NULL, NULL}, */
        {"always_show_message_when_selected", "FALSE",
         &prefs_common.always_show_msg,
-        P_BOOL, NULL, NULL, NULL},
+        P_ENUM, NULL, NULL, NULL},
        {"select_on_entry", "3", &prefs_common.select_on_entry,
         P_ENUM, NULL, NULL, NULL},
        {"show_tooltips", "TRUE", &prefs_common.show_tooltips,
index ce3b0f8..471fcff 100644 (file)
@@ -88,6 +88,13 @@ typedef enum
        NEXTUNREADMSGDIALOG_ASSUME_NO
 } NextUnreadMsgDialogShow;
 
+typedef enum
+{
+       OPENMSG_REQUEST_ONLY = 0,
+       OPENMSG_ALWAYS = 1,
+       OPENMSG_WHEN_VIEW_VISIBLE
+} ShowMsgPolicy;
+
 struct _PrefsCommon
 {
 #ifdef MAEMO
@@ -345,7 +352,7 @@ struct _PrefsCommon
 
        gint statusbar_update_step;
        gboolean emulate_emacs;
-       gboolean always_show_msg;
+       ShowMsgPolicy always_show_msg;
        gboolean mark_as_read_on_new_window;
        gboolean mark_as_read_delay;
        gboolean immediate_exec;
index 970a9b1..c8dd781 100644 (file)
@@ -64,7 +64,7 @@ typedef struct _SummariesPage
        GtkWidget *entry_datefmt;
 
        GtkWidget *checkbtn_reopen_last_folder;
-       GtkWidget *checkbtn_always_show_msg;
+       GtkWidget *optmenu_always_show_msg;
        GtkWidget *checkbtn_mark_as_read_on_newwin;
        GtkWidget *spinbtn_mark_as_read_delay;
        GtkWidget *checkbtn_immedexec;
@@ -333,7 +333,7 @@ static void prefs_summaries_create_widget(PrefsPage *_page, GtkWindow *window,
 
        GtkWidget *hbox2;
        GtkWidget *checkbtn_reopen_last_folder;
-       GtkWidget *checkbtn_always_show_msg;
+       GtkWidget *optmenu_always_show_msg;
        GtkWidget *spinbtn_mark_as_read_delay;
        GtkObject *spinbtn_mark_as_read_delay_adj;
        GtkWidget *checkbtn_immedexec;
@@ -453,9 +453,24 @@ static void prefs_summaries_create_widget(PrefsPage *_page, GtkWindow *window,
 
        gtk_box_pack_start(GTK_BOX(hbox1), optmenu_nextunreadmsgdialog, FALSE, FALSE, 0);
 
-       PACK_CHECK_BUTTON
-               (vbox2, checkbtn_always_show_msg,
-                _("Always open message when selected"));
+       /* Open message on select policy */
+       hbox1 = gtk_hbox_new (FALSE, 10);
+       gtk_widget_show (hbox1);
+       gtk_box_pack_start (GTK_BOX (vbox2), hbox1, FALSE, FALSE, 0);   
+       label = gtk_label_new (_("Open message when selected"));
+       gtk_widget_show (label);
+       gtk_box_pack_start(GTK_BOX(hbox1), label, FALSE, FALSE, 0);
+
+       optmenu_always_show_msg = gtkut_sc_combobox_create(NULL, FALSE);
+       menu = GTK_LIST_STORE(gtk_combo_box_get_model(
+                               GTK_COMBO_BOX(optmenu_always_show_msg)));
+       gtk_widget_show (optmenu_always_show_msg);
+       COMBOBOX_ADD (menu, _("Never"), OPENMSG_REQUEST_ONLY);
+       COMBOBOX_ADD (menu, _("Always"), OPENMSG_ALWAYS);
+       COMBOBOX_ADD (menu, _("When message preview is visible"),
+                       OPENMSG_WHEN_VIEW_VISIBLE);
+       gtk_box_pack_start(GTK_BOX(hbox1), optmenu_always_show_msg, FALSE, FALSE, 0);
+
        PACK_CHECK_BUTTON
                (vbox2, checkbtn_threadsubj,
                 _("Thread using subject in addition to standard headers"));
@@ -592,7 +607,7 @@ static void prefs_summaries_create_widget(PrefsPage *_page, GtkWindow *window,
 
        gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(checkbtn_reopen_last_folder),
                        prefs_common.goto_last_folder_on_startup);
-       gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(checkbtn_always_show_msg),
+       combobox_select_by_data(GTK_COMBO_BOX(optmenu_always_show_msg),
                        prefs_common.always_show_msg);
        gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(radio_mark_as_read_on_new_win),
                        prefs_common.mark_as_read_on_new_window);
@@ -615,7 +630,7 @@ static void prefs_summaries_create_widget(PrefsPage *_page, GtkWindow *window,
        prefs_summaries->entry_datefmt = entry_datefmt;
 
        prefs_summaries->checkbtn_reopen_last_folder = checkbtn_reopen_last_folder;
-       prefs_summaries->checkbtn_always_show_msg = checkbtn_always_show_msg;
+       prefs_summaries->optmenu_always_show_msg = optmenu_always_show_msg;
        prefs_summaries->checkbtn_mark_as_read_on_newwin = radio_mark_as_read_on_new_win;
        prefs_summaries->spinbtn_mark_as_read_delay = spinbtn_mark_as_read_delay;
        prefs_summaries->checkbtn_immedexec = checkbtn_immedexec;
@@ -651,8 +666,8 @@ static void prefs_summaries_save(PrefsPage *_page)
 
        prefs_common.goto_last_folder_on_startup = gtk_toggle_button_get_active(
                GTK_TOGGLE_BUTTON(page->checkbtn_reopen_last_folder));
-       prefs_common.always_show_msg = gtk_toggle_button_get_active(
-               GTK_TOGGLE_BUTTON(page->checkbtn_always_show_msg));
+       prefs_common.always_show_msg = combobox_get_active_data(
+               GTK_COMBO_BOX(page->optmenu_always_show_msg));
        prefs_common.mark_as_read_on_new_window = gtk_toggle_button_get_active(
                GTK_TOGGLE_BUTTON(page->checkbtn_mark_as_read_on_newwin));
        prefs_common.immediate_exec = gtk_toggle_button_get_active(
index 30cb660..76e8040 100644 (file)
@@ -4365,7 +4365,9 @@ void summary_move_selected_to(SummaryView *summaryview, FolderItem *to_folder)
        }
        END_LONG_OPERATION(summaryview);
 
-       summaryview->display_msg = prefs_common.always_show_msg;
+       summaryview->display_msg = (prefs_common.always_show_msg == OPENMSG_ALWAYS) ||
+               ((prefs_common.always_show_msg == OPENMSG_WHEN_VIEW_VISIBLE &&
+                               messageview_is_visible(summaryview->messageview)));
        
        if (prefs_common.immediate_exec) {
                summary_execute(summaryview);
@@ -4373,7 +4375,7 @@ void summary_move_selected_to(SummaryView *summaryview, FolderItem *to_folder)
                GtkCTreeNode *node = summary_find_next_msg(summaryview, sel_last);
                if (!node)
                        node = summary_find_prev_msg(summaryview, sel_last);
-               summary_select_node(summaryview, node, prefs_common.always_show_msg, TRUE);
+               summary_select_node(summaryview, node, summaryview->display_msg, TRUE);
                summary_status_show(summaryview);
        }
        
@@ -4381,7 +4383,7 @@ void summary_move_selected_to(SummaryView *summaryview, FolderItem *to_folder)
                GtkCTreeNode *node = gtk_ctree_node_nth (GTK_CTREE(summaryview->ctree), 
                                                         GTK_CLIST(summaryview->ctree)->rows - 1);
                if (node)
-                       summary_select_node(summaryview, node, prefs_common.always_show_msg, TRUE);
+                       summary_select_node(summaryview, node, summaryview->display_msg, TRUE);
        }
 
 }