[Commits] [SCM] claws branch, gtk3, updated. 4.0.0-85-g76e9a5af6
wwp at claws-mail.org
wwp at claws-mail.org
Tue Aug 31 20:42:55 UTC 2021
The branch, gtk3 has been updated
via 76e9a5af67914f92ec26c6223d3b2a5413a97fad (commit)
from 4a753d0496edc9fa25f7c8ec6f3f62627572b598 (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 76e9a5af67914f92ec26c6223d3b2a5413a97fad
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 9b8d5543f..edc4e248d 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},
@@ -224,6 +226,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;
@@ -284,6 +287,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 f13ae9fc9..6f9cac114 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 a3f549236..7efa8eaa2 100644
--- a/src/folderview.c
+++ b/src/folderview.c
@@ -967,11 +967,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 1e3da0e66..021fbfd47 100644
--- a/src/prefs_folder_item.c
+++ b/src/prefs_folder_item.c
@@ -84,6 +84,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;
@@ -98,6 +99,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;
@@ -254,6 +256,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;
@@ -269,6 +272,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;
@@ -538,6 +542,24 @@ static void prefs_folder_item_general_create_widget_func(PrefsPage * page_,
gtk_grid_attach(GTK_GRID(table), promote_html_part_rec_checkbtn, 2, rowcount, 1, 1);
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_grid_attach(GTK_GRID(table), checkbtn_offlinesync, 0, rowcount, 1, 1);
@@ -639,6 +661,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;
@@ -654,6 +677,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;
@@ -745,6 +769,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));
@@ -784,6 +813,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