[Commits] [SCM] claws branch, gtk3, updated. 4.0.0-90-ge7436fb69
wwp at claws-mail.org
wwp at claws-mail.org
Wed Sep 1 09:59:00 UTC 2021
The branch, gtk3 has been updated
via e7436fb6938e61b5c62c2cd296222baaa3b78a0c (commit)
from ffddaa73d93f318eb1bc2f82d10cba737e7a1e1e (commit)
Summary of changes:
src/folderutils.c | 2 ++
src/folderview.c | 16 ++++++++++++++--
src/folderview.h | 2 ++
src/prefs_common.c | 2 ++
src/prefs_common.h | 1 +
src/prefs_summaries.c | 11 +++++++++++
6 files changed, 32 insertions(+), 2 deletions(-)
- Log -----------------------------------------------------------------
commit e7436fb6938e61b5c62c2cd296222baaa3b78a0c
Author: wwp <subscript at free.fr>
Date: Wed Sep 1 11:58:54 2021 +0200
Add a global option to allow executing per-folder processing rules prior to
mark all messages read/unread in folder (also works when marking recursively).
diff --git a/src/folderutils.c b/src/folderutils.c
index 9d71a51d6..650e2a1c6 100644
--- a/src/folderutils.c
+++ b/src/folderutils.c
@@ -176,6 +176,8 @@ static gboolean folderutils_mark_all_read_node_func(GNode *node, gpointer data)
{
if (node) {
FolderItem *sub_item = (FolderItem *) node->data;
+ if (prefs_common.run_processingrules_before_mark_all)
+ folderview_run_processing(sub_item);
folderutils_mark_all_read(sub_item, (gboolean) GPOINTER_TO_INT(data));
}
return(FALSE);
diff --git a/src/folderview.c b/src/folderview.c
index 7efa8eaa2..a080274f3 100644
--- a/src/folderview.c
+++ b/src/folderview.c
@@ -898,13 +898,19 @@ static void mark_all_read_unread_handler(GtkAction *action, gpointer data,
if (read) {
if (recursive)
folderutils_mark_all_read_recursive(item, TRUE);
- else
+ else {
+ if (prefs_common.run_processingrules_before_mark_all)
+ folderview_run_processing(item);
folderutils_mark_all_read(item, TRUE);
+ }
} else {
if (recursive)
folderutils_mark_all_read_recursive(item, FALSE);
- else
+ else {
folderutils_mark_all_read(item, FALSE);
+ if (prefs_common.run_processingrules_before_mark_all)
+ folderview_run_processing(item);
+ }
}
if (folderview->summaryview->folder_item != item && !recursive)
summary_unlock(folderview->summaryview);
@@ -2577,6 +2583,12 @@ static void folderview_run_processing_cb(GtkAction *action, gpointer data)
if (!folderview->selected) return;
item = folderview_get_selected_item(folderview);
+
+ folderview_run_processing(item);
+}
+
+void folderview_run_processing(FolderItem *item)
+{
cm_return_if_fail(item != NULL);
cm_return_if_fail(item->folder != NULL);
diff --git a/src/folderview.h b/src/folderview.h
index 904c20a8a..847d59b93 100644
--- a/src/folderview.h
+++ b/src/folderview.h
@@ -127,6 +127,8 @@ void folderview_check_new_all (void);
void folderview_update_all_updated (gboolean update_summary);
+void folderview_run_processing(FolderItem *item);
+
void folderview_move_folder (FolderView *folderview,
FolderItem *from_folder,
FolderItem *to_folder,
diff --git a/src/prefs_common.c b/src/prefs_common.c
index 36f1b34ed..f3c516230 100644
--- a/src/prefs_common.c
+++ b/src/prefs_common.c
@@ -897,6 +897,8 @@ static PrefParam param[] = {
NULL, NULL, NULL},
#endif
+ {"run_processingrules_before_mark_all", "FALSE", &prefs_common.run_processingrules_before_mark_all, P_BOOL,
+ NULL, NULL, NULL},
{"ask_mark_all_read", "TRUE", &prefs_common.ask_mark_all_read, P_BOOL,
NULL, NULL, NULL},
{"ask_override_colorlabel", "TRUE", &prefs_common.ask_override_colorlabel, P_BOOL,
diff --git a/src/prefs_common.h b/src/prefs_common.h
index dde021e2c..42f5d38f1 100644
--- a/src/prefs_common.h
+++ b/src/prefs_common.h
@@ -420,6 +420,7 @@ struct _PrefsCommon
#endif
int hover_timeout; /* msecs mouse hover timeout */
gboolean ask_mark_all_read;
+ gboolean run_processingrules_before_mark_all;
gboolean ask_override_colorlabel;
gboolean ask_apply_per_account_filtering_rules;
gint apply_per_account_filtering_rules;
diff --git a/src/prefs_summaries.c b/src/prefs_summaries.c
index 7e85ea632..e74c7f40a 100644
--- a/src/prefs_summaries.c
+++ b/src/prefs_summaries.c
@@ -73,6 +73,7 @@ typedef struct _SummariesPage
GtkWidget *spinbtn_mark_as_read_delay;
GtkWidget *checkbtn_immedexec;
GtkWidget *checkbtn_ask_mark_all_read;
+ GtkWidget *checkbtn_run_processingrules_mark_all_read;
GtkWidget *checkbtn_ask_override_colorlabel;
GtkWidget *optmenu_sort_key;
GtkWidget *optmenu_sort_type;
@@ -352,6 +353,7 @@ static void prefs_summaries_create_widget(PrefsPage *_page, GtkWindow *window,
GtkAdjustment *spinbtn_mark_as_read_delay_adj;
GtkWidget *checkbtn_immedexec;
GtkWidget *checkbtn_ask_mark_all_read;
+ GtkWidget *checkbtn_run_processingrules_mark_all_read;
GtkWidget *checkbtn_ask_override_colorlabel;
GtkWidget *label, *label_fill;
GtkListStore *menu;
@@ -416,6 +418,10 @@ static void prefs_summaries_create_widget(PrefsPage *_page, GtkWindow *window,
(vbox1, checkbtn_reopen_last_folder,
_("Open last opened folder at start-up"));
+ PACK_CHECK_BUTTON
+ (vbox1, checkbtn_run_processingrules_mark_all_read,
+ _("Run processing rules before marking all messages in a folder as read or unread"));
+
hbox1 = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 8);
gtk_widget_show (hbox1);
gtk_box_pack_start(GTK_BOX (vbox1), hbox1, FALSE, FALSE, 0);
@@ -691,6 +697,7 @@ static void prefs_summaries_create_widget(PrefsPage *_page, GtkWindow *window,
prefs_summaries->spinbtn_mark_as_read_delay = spinbtn_mark_as_read_delay;
prefs_summaries->checkbtn_immedexec = checkbtn_immedexec;
prefs_summaries->checkbtn_ask_mark_all_read = checkbtn_ask_mark_all_read;
+ prefs_summaries->checkbtn_run_processingrules_mark_all_read = checkbtn_run_processingrules_mark_all_read;
prefs_summaries->checkbtn_ask_override_colorlabel = checkbtn_ask_override_colorlabel;
prefs_summaries->optmenu_sort_key = optmenu_sort_key;
prefs_summaries->optmenu_sort_type = optmenu_sort_type;
@@ -750,6 +757,8 @@ static void prefs_summaries_create_widget(PrefsPage *_page, GtkWindow *window,
prefs_common.immediate_exec);
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(checkbtn_ask_mark_all_read),
prefs_common.ask_mark_all_read);
+ gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(checkbtn_run_processingrules_mark_all_read),
+ prefs_common.run_processingrules_before_mark_all);
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(checkbtn_ask_override_colorlabel),
prefs_common.ask_override_colorlabel);
@@ -824,6 +833,8 @@ static void prefs_summaries_save(PrefsPage *_page)
GTK_TOGGLE_BUTTON(page->checkbtn_immedexec));
prefs_common.ask_mark_all_read = gtk_toggle_button_get_active(
GTK_TOGGLE_BUTTON(page->checkbtn_ask_mark_all_read));
+ prefs_common.run_processingrules_before_mark_all = gtk_toggle_button_get_active(
+ GTK_TOGGLE_BUTTON(page->checkbtn_run_processingrules_mark_all_read));
prefs_common.ask_override_colorlabel = gtk_toggle_button_get_active(
GTK_TOGGLE_BUTTON(page->checkbtn_ask_override_colorlabel));
prefs_common.mark_as_read_delay = gtk_spin_button_get_value_as_int(
-----------------------------------------------------------------------
hooks/post-receive
--
Claws Mail
More information about the Commits
mailing list