[Commits] [SCM] claws branch, master, updated. 3.14.1-7-g75fcc18

ticho at claws-mail.org ticho at claws-mail.org
Fri Nov 11 17:31:18 CET 2016


The branch, master has been updated
       via  75fcc188b633803a6279e278a14a5be1e237c9d3 (commit)
       via  7322c825c7c762b177a39f39c9c5e2130c1501f7 (commit)
      from  a4c1e429bee127ab09fca2e3276449614360d907 (commit)

Summary of changes:
 src/prefs_common.c       |    3 +++
 src/prefs_common.h       |    5 +++--
 src/prefs_summaries.c    |    6 +++---
 src/prefs_summary_open.c |   16 +++++++++++++++-
 src/summaryview.c        |   20 ++++++++++++++------
 5 files changed, 38 insertions(+), 12 deletions(-)


- Log -----------------------------------------------------------------
commit 75fcc188b633803a6279e278a14a5be1e237c9d3
Author: Andrej Kacian <ticho at claws-mail.org>
Date:   Thu Nov 10 20:34:17 2016 +0100

    Add open_selected_on_folder_open to common prefs.
    
    This option overrides always_show_message_when_selected
    option when selecting initial message during folder open.
    
    This is useful so that the message's unread flag doesn't
    get unset before user had the chance of noticing it, or
    that an overly large message doesn't get automatically
    selected if user doesn't want it (e.g. IMAP over a slow
    connection).

diff --git a/src/prefs_common.c b/src/prefs_common.c
index feeb956..bf273a9 100644
--- a/src/prefs_common.c
+++ b/src/prefs_common.c
@@ -786,6 +786,9 @@ static PrefParam param[] = {
 #endif
 	/* {"emulate_emacs", "FALSE", &prefs_common.emulate_emacs, P_BOOL,
 	 NULL, NULL, NULL}, */
+	{"open_selected_message_on_folder_open", "FALSE",
+	 &prefs_common.open_selected_on_folder_open,
+	 P_BOOL, NULL, NULL, NULL},
 	{"always_show_message_when_selected", "0",
 	 &prefs_common.always_show_msg,
 	 P_ENUM, NULL, NULL, NULL},
diff --git a/src/prefs_common.h b/src/prefs_common.h
index 2c56b4d..533c0dd 100644
--- a/src/prefs_common.h
+++ b/src/prefs_common.h
@@ -92,8 +92,8 @@ typedef enum
 
 typedef enum
 {
-	OPENMSG_REQUEST_ONLY = 0,
-	OPENMSG_ALWAYS = 1,
+	OPENMSG_NO = 0,
+	OPENMSG_YES = 1,
 	OPENMSG_WHEN_VIEW_VISIBLE
 } ShowMsgPolicy;
 
@@ -368,6 +368,7 @@ struct _PrefsCommon
 
 	gint statusbar_update_step;
 	gboolean emulate_emacs;
+	gboolean open_selected_on_folder_open;
 	ShowMsgPolicy always_show_msg;
 	gboolean mark_as_read_on_new_window;
 	gboolean mark_as_read_delay;
diff --git a/src/prefs_summaries.c b/src/prefs_summaries.c
index 8cce007..3b2b3a2 100644
--- a/src/prefs_summaries.c
+++ b/src/prefs_summaries.c
@@ -501,9 +501,9 @@ static void prefs_summaries_create_widget(PrefsPage *_page, GtkWindow *window,
 	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 view is visible"),
+	COMBOBOX_ADD (menu, _("No"), OPENMSG_NO);
+	COMBOBOX_ADD (menu, _("Yes"), OPENMSG_YES);
+	COMBOBOX_ADD (menu, _("Only when message view is visible"),
 			OPENMSG_WHEN_VIEW_VISIBLE);
 	gtk_box_pack_start(GTK_BOX(hbox1), optmenu_always_show_msg, FALSE, FALSE, 0);
 
diff --git a/src/prefs_summary_open.c b/src/prefs_summary_open.c
index 37db95a..b1c235d 100644
--- a/src/prefs_summary_open.c
+++ b/src/prefs_summary_open.c
@@ -56,6 +56,8 @@ static struct SummaryOpen {
 
 	GtkWidget *possible_actions_list_view;
 	GtkWidget *actions_list_view;
+
+	GtkWidget *open_on_select;
 } summaryopen;
 
 /* widget creating functions */
@@ -159,6 +161,7 @@ static void prefs_summary_open_create(void)
 	GtkWidget *list_view_scrolledwin;
 	GtkWidget *possible_actions_list_view;
 	GtkWidget *actions_list_view;
+	GtkWidget *checkbtn_open_on_select;
 	
 	window = gtkut_window_new(GTK_WINDOW_TOPLEVEL, "prefs_summary_open");
 	gtk_container_set_border_width (GTK_CONTAINER (window), 8);
@@ -295,7 +298,9 @@ static void prefs_summary_open_create(void)
 	gtk_box_pack_start (GTK_BOX (btn_vbox), down_btn, FALSE, FALSE, 0);
 	g_signal_connect (G_OBJECT (down_btn), "clicked",
 			  G_CALLBACK (prefs_summary_open_down), NULL);
-	
+
+	PACK_CHECK_BUTTON(vbox, checkbtn_open_on_select,
+			_("Open the selected message"));
 
 	gtk_widget_show_all(window);
 
@@ -305,6 +310,7 @@ static void prefs_summary_open_create(void)
 
 	summaryopen.possible_actions_list_view        = possible_actions_list_view;
 	summaryopen.actions_list_view = actions_list_view;
+	summaryopen.open_on_select = checkbtn_open_on_select;
 }
 
 /* do it SUMMARY_OPEN_ACTIONS-1 times */
@@ -380,6 +386,10 @@ fill:
 					(model_poss), action_name[i], i);	
 		}
 	}
+
+	gtk_toggle_button_set_active
+		(GTK_TOGGLE_BUTTON(summaryopen.open_on_select),
+		 prefs_common.open_selected_on_folder_open);
 }
 
 static void prefs_summary_open_set_list(void)
@@ -543,6 +553,10 @@ static void prefs_summary_open_ok(void)
 	for (i = 0; i < SUMMARY_OPEN_ACTIONS-1; i++)
 		saved_summary_select_prio[i] = prefs_common.summary_select_prio[i];
 
+	prefs_common.open_selected_on_folder_open =
+		gtk_toggle_button_get_active
+		(GTK_TOGGLE_BUTTON(summaryopen.open_on_select));
+
 	gtk_widget_hide(summaryopen.window);
 	gtk_window_set_modal(GTK_WINDOW(summaryopen.window), FALSE);
 }
diff --git a/src/summaryview.c b/src/summaryview.c
index 67578cc..a58fa90 100644
--- a/src/summaryview.c
+++ b/src/summaryview.c
@@ -1550,8 +1550,18 @@ gboolean summary_show(SummaryView *summaryview, FolderItem *item)
 		}
 
 		summary_unlock(summaryview);
-		if (node)
-			summary_select_node(summaryview, node, -1);
+
+		if (node) {
+			gint open_selected = -1;
+			if (!is_refresh) {
+				if (prefs_common.open_selected_on_folder_open)
+					open_selected = 1;
+				else
+					open_selected = 0;
+			}
+			summary_select_node(summaryview, node, open_selected);
+		}
+
 		summary_lock(summaryview);
 	}
 
@@ -2230,7 +2240,7 @@ void summary_select_node(SummaryView *summaryview, GtkCMCTreeNode *node,
 	gboolean display_msg;
 	
 	display_msg = force_display > -1? force_display :
-		(prefs_common.always_show_msg == OPENMSG_ALWAYS) ||
+		(prefs_common.always_show_msg == OPENMSG_YES) ||
 		((prefs_common.always_show_msg == OPENMSG_WHEN_VIEW_VISIBLE &&
 				messageview_is_visible(summaryview->messageview)));
 

commit 7322c825c7c762b177a39f39c9c5e2130c1501f7
Author: Andrej Kacian <ticho at claws-mail.org>
Date:   Fri Nov 11 16:40:37 2016 +0100

    Honor display_msg == 0 in PostponedSelectData struct.

diff --git a/src/summaryview.c b/src/summaryview.c
index fbc29bf..67578cc 100644
--- a/src/summaryview.c
+++ b/src/summaryview.c
@@ -7003,9 +7003,7 @@ static void summary_selected(GtkCMCTree *ctree, GtkCMCTreeNode *row,
 		}
 	}
 
-	if (summaryview->display_msg ||
-	    (prefs_common.always_show_msg &&
-	     messageview_is_visible(summaryview->messageview))) {
+	if (summaryview->display_msg) {
 		summaryview->display_msg = FALSE;
 		if (summaryview->displayed != row) {
 			summary_display_msg(summaryview, row);

-----------------------------------------------------------------------


hooks/post-receive
-- 
Claws Mail


More information about the Commits mailing list