[Commits] [SCM] claws branch, master, updated. 3.18.0-46-g9c336cb34
wwp at claws-mail.org
wwp at claws-mail.org
Tue Aug 31 20:42:14 UTC 2021
The branch, master has been updated
via 9c336cb34789404e8e5e495860b668de83933471 (commit)
from 68670c2d821218d4a04e06d479ae4e6beeabc0e4 (commit)
Summary of changes:
src/folder_item_prefs.c | 4 ++++
src/folder_item_prefs.h | 1 +
src/folderview.c | 4 ++--
src/prefs_folder_item.c | 30 ++++++++++++++++++++++++++++++
4 files changed, 37 insertions(+), 2 deletions(-)
- Log -----------------------------------------------------------------
commit 9c336cb34789404e8e5e495860b668de83933471
Author: wwp <subscript at free.fr>
Date: Tue Aug 31 22:41:27 2021 +0200
Add a per-folder option so that a folder can be skipped when doing a
goto next/prev unread/new message.
diff --git a/src/folder_item_prefs.c b/src/folder_item_prefs.c
index 9dc815b73..73d174e85 100644
--- a/src/folder_item_prefs.c
+++ b/src/folder_item_prefs.c
@@ -100,6 +100,8 @@ static PrefParam param[] = {
NULL, NULL, NULL},
{"promote_html_part", "0", &tmp_prefs.promote_html_part, P_ENUM,
NULL, NULL, NULL},
+ {"skip_on_goto_unread_or_new", "FALSE", &tmp_prefs.skip_on_goto_unread_or_new, P_BOOL,
+ NULL, NULL, NULL},
{"compose_with_format", "FALSE", &tmp_prefs.compose_with_format, P_BOOL,
NULL, NULL, NULL},
@@ -221,6 +223,7 @@ static FolderItemPrefs *folder_item_prefs_clear(FolderItemPrefs *prefs)
prefs->offlinesync_days = 0;
prefs->remove_old_bodies = FALSE;
prefs->promote_html_part = HTML_PROMOTE_DEFAULT;
+ prefs->skip_on_goto_unread_or_new = FALSE;
prefs->compose_with_format = FALSE;
prefs->compose_subject_format = NULL;
@@ -281,6 +284,7 @@ void folder_item_prefs_copy_prefs(FolderItem * src, FolderItem * dest)
tmp_prefs.offlinesync_days = src->prefs->offlinesync_days;
tmp_prefs.remove_old_bodies = src->prefs->remove_old_bodies;
tmp_prefs.promote_html_part = src->prefs->promote_html_part;
+ tmp_prefs.skip_on_goto_unread_or_new = src->prefs->skip_on_goto_unread_or_new;
prefs_matcher_read_config();
diff --git a/src/folder_item_prefs.h b/src/folder_item_prefs.h
index 272906beb..2a1427ffb 100644
--- a/src/folder_item_prefs.h
+++ b/src/folder_item_prefs.h
@@ -51,6 +51,7 @@ struct _FolderItemPrefs {
int offlinesync_days;
int remove_old_bodies;
HTMLPromoteType promote_html_part;
+ gboolean skip_on_goto_unread_or_new;
gboolean request_return_receipt;
gboolean enable_default_to;
diff --git a/src/folderview.c b/src/folderview.c
index 263d3d8d7..c281192a3 100644
--- a/src/folderview.c
+++ b/src/folderview.c
@@ -966,11 +966,11 @@ static GtkCMCTreeNode *folderview_find_next_with_flag(GtkCMCTree *ctree,
continue;
switch (flag) {
case MSG_UNREAD:
- if(item->unread_msgs > 0)
+ if((item->unread_msgs > 0) && (!item->prefs || !item->prefs->skip_on_goto_unread_or_new))
return node;
break;
case MSG_NEW:
- if(item->new_msgs > 0)
+ if((item->new_msgs > 0) && (!item->prefs || !item->prefs->skip_on_goto_unread_or_new))
return node;
break;
case MSG_MARKED:
diff --git a/src/prefs_folder_item.c b/src/prefs_folder_item.c
index fc2e1afea..7a3c23f11 100644
--- a/src/prefs_folder_item.c
+++ b/src/prefs_folder_item.c
@@ -85,6 +85,7 @@ struct _FolderItemGeneralPage
GtkWidget *checkbtn_enable_processing;
GtkWidget *checkbtn_enable_processing_when_opening;
GtkWidget *checkbtn_newmailcheck;
+ GtkWidget *checkbtn_skip_on_goto_unread_or_new;
GtkWidget *checkbtn_offlinesync;
GtkWidget *label_offlinesync;
GtkWidget *entry_offlinesync;
@@ -99,6 +100,7 @@ struct _FolderItemGeneralPage
GtkWidget *enable_processing_rec_checkbtn;
GtkWidget *enable_processing_when_opening_rec_checkbtn;
GtkWidget *newmailcheck_rec_checkbtn;
+ GtkWidget *skip_on_goto_unread_or_new_rec_checkbtn;
GtkWidget *offlinesync_rec_checkbtn;
GtkWidget *promote_html_part_rec_checkbtn;
@@ -255,6 +257,7 @@ static void prefs_folder_item_general_create_widget_func(PrefsPage * page_,
GtkWidget *checkbtn_enable_processing;
GtkWidget *checkbtn_enable_processing_when_opening;
GtkWidget *checkbtn_newmailcheck;
+ GtkWidget *checkbtn_skip_on_goto_unread_or_new;
GtkWidget *checkbtn_offlinesync;
GtkWidget *label_offlinesync;
GtkWidget *entry_offlinesync;
@@ -270,6 +273,7 @@ static void prefs_folder_item_general_create_widget_func(PrefsPage * page_,
GtkWidget *enable_processing_rec_checkbtn;
GtkWidget *enable_processing_when_opening_rec_checkbtn;
GtkWidget *newmailcheck_rec_checkbtn;
+ GtkWidget *skip_on_goto_unread_or_new_rec_checkbtn;
GtkWidget *offlinesync_rec_checkbtn;
GtkWidget *promote_html_part_rec_checkbtn;
@@ -536,6 +540,24 @@ static void prefs_folder_item_general_create_widget_func(PrefsPage * page_,
rowcount, rowcount + 1, GTK_SHRINK, GTK_SHRINK, 0, 0);
rowcount++;
+
+ /* Skip folder on 'goto unread (or new) message' */
+ checkbtn_skip_on_goto_unread_or_new = gtk_check_button_new_with_label(_("Skip folder when searching for unread or new messages"));
+ CLAWS_SET_TIP(checkbtn_newmailcheck,
+ _("Turn this option on if you want this folder to be ignored"
+ "when searching for unread or new messages"));
+ gtk_table_attach(GTK_TABLE(table), checkbtn_skip_on_goto_unread_or_new, 0, 2,
+ rowcount, rowcount+1, GTK_EXPAND | GTK_FILL, GTK_FILL, 0, 0);
+
+ gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(checkbtn_skip_on_goto_unread_or_new),
+ item->prefs->skip_on_goto_unread_or_new);
+ skip_on_goto_unread_or_new_rec_checkbtn = gtk_check_button_new();
+ gtk_table_attach(GTK_TABLE(table), skip_on_goto_unread_or_new_rec_checkbtn, 2, 3,
+ rowcount, rowcount + 1, GTK_SHRINK, GTK_SHRINK, 0, 0);
+
+ rowcount++;
+
+
/* Synchronise folder for offline use */
checkbtn_offlinesync = gtk_check_button_new_with_label(_("Synchronise for offline use"));
gtk_table_attach(GTK_TABLE(table), checkbtn_offlinesync, 0, 2,
@@ -638,6 +660,7 @@ static void prefs_folder_item_general_create_widget_func(PrefsPage * page_,
page->checkbtn_enable_processing = checkbtn_enable_processing;
page->checkbtn_enable_processing_when_opening = checkbtn_enable_processing_when_opening;
page->checkbtn_newmailcheck = checkbtn_newmailcheck;
+ page->checkbtn_skip_on_goto_unread_or_new = checkbtn_skip_on_goto_unread_or_new;
page->checkbtn_offlinesync = checkbtn_offlinesync;
page->label_offlinesync = label_offlinesync;
page->entry_offlinesync = entry_offlinesync;
@@ -653,6 +676,7 @@ static void prefs_folder_item_general_create_widget_func(PrefsPage * page_,
page->enable_processing_rec_checkbtn = enable_processing_rec_checkbtn;
page->enable_processing_when_opening_rec_checkbtn = enable_processing_when_opening_rec_checkbtn;
page->newmailcheck_rec_checkbtn = newmailcheck_rec_checkbtn;
+ page->skip_on_goto_unread_or_new_rec_checkbtn = skip_on_goto_unread_or_new_rec_checkbtn;
page->offlinesync_rec_checkbtn = offlinesync_rec_checkbtn;
page->promote_html_part_rec_checkbtn = promote_html_part_rec_checkbtn;
@@ -743,6 +767,11 @@ static void general_save_folder_prefs(FolderItem *folder, FolderItemGeneralPage
gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(page->checkbtn_newmailcheck));
}
+ if (all || gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(page->skip_on_goto_unread_or_new_rec_checkbtn))) {
+ prefs->skip_on_goto_unread_or_new =
+ gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(page->checkbtn_skip_on_goto_unread_or_new));
+ }
+
if (all || gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(page->offlinesync_rec_checkbtn))) {
prefs->offlinesync =
gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(page->checkbtn_offlinesync));
@@ -782,6 +811,7 @@ static gboolean general_save_recurse_func(GNode *node, gpointer data)
gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(page->enable_processing_when_opening_rec_checkbtn)) ||
gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(page->newmailcheck_rec_checkbtn)) ||
gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(page->offlinesync_rec_checkbtn)) ||
+ gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(page->skip_on_goto_unread_or_new_rec_checkbtn)) ||
gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(page->promote_html_part_rec_checkbtn))
))
return TRUE;
-----------------------------------------------------------------------
hooks/post-receive
--
Claws Mail
More information about the Commits
mailing list