[Commits] [SCM] claws branch, master, updated. 3.14.1-96-gc7af8ad
wwp at claws-mail.org
wwp at claws-mail.org
Wed Jan 4 11:17:48 CET 2017
The branch, master has been updated
via c7af8ad4b2915af05f2d2755b216affd1368a7b3 (commit)
from d287120c94c98d51a9844227565952fc5ada3842 (commit)
Summary of changes:
src/folderutils.c | 4 ++--
src/folderview.c | 3 +--
src/mainwindow.c | 4 ++--
src/summaryview.c | 14 +++++++++-----
src/summaryview.h | 4 ++--
src/toolbar.c | 4 ++--
6 files changed, 18 insertions(+), 15 deletions(-)
- Log -----------------------------------------------------------------
commit c7af8ad4b2915af05f2d2755b216affd1368a7b3
Author: wwp <wwp at free.fr>
Date: Wed Jan 4 11:14:15 2017 +0100
Fix marking all as (un)read recursively when the confirmation
dialogue is enabled and the user clicks No: confirmation dialog
was taken into account just for the current folder, subtree was
marked anyway, and this only under certain conditions that I'd
prefer not to list here becau<woosh>
diff --git a/src/folderutils.c b/src/folderutils.c
index ce2fe3c..355af85 100644
--- a/src/folderutils.c
+++ b/src/folderutils.c
@@ -132,7 +132,7 @@ void folderutils_mark_all_read(FolderItem *item)
if (mainwin && mainwin->summaryview &&
mainwin->summaryview->folder_item == item) {
debug_print("folder opened, using summary\n");
- summary_mark_all_read(mainwin->summaryview);
+ summary_mark_all_read(mainwin->summaryview, FALSE);
} else {
msglist = folder_item_get_msg_list(item);
debug_print("got msglist %p\n", msglist);
@@ -172,7 +172,7 @@ void folderutils_mark_all_unread(FolderItem *item)
if (mainwin && mainwin->summaryview &&
mainwin->summaryview->folder_item == item) {
debug_print("folder opened, using summary\n");
- summary_mark_all_unread(mainwin->summaryview);
+ summary_mark_all_unread(mainwin->summaryview, FALSE);
} else {
msglist = folder_item_get_msg_list(item);
debug_print("got msglist %p\n", msglist);
diff --git a/src/folderview.c b/src/folderview.c
index 71391ef..d48a8de 100644
--- a/src/folderview.c
+++ b/src/folderview.c
@@ -876,8 +876,7 @@ static void mark_all_read_unread_handler(GtkAction *action, gpointer data,
_("Do you really want to mark all mails in this "
"folder as unread?");
}
- if (folderview->summaryview->folder_item != item &&
- prefs_common.ask_mark_all_read) {
+ if (prefs_common.ask_mark_all_read) {
val = alertpanel_full(title, message,
GTK_STOCK_NO, GTK_STOCK_YES, NULL,
TRUE, NULL, ALERT_QUESTION, G_ALERTDEFAULT);
diff --git a/src/mainwindow.c b/src/mainwindow.c
index c6305bc..6c8aa07 100644
--- a/src/mainwindow.c
+++ b/src/mainwindow.c
@@ -4479,13 +4479,13 @@ static void mark_as_unread_cb(GtkAction *action, gpointer data)
static void mark_all_read_cb(GtkAction *action, gpointer data)
{
MainWindow *mainwin = (MainWindow *)data;
- summary_mark_all_read(mainwin->summaryview);
+ summary_mark_all_read(mainwin->summaryview, TRUE);
}
static void mark_all_unread_cb(GtkAction *action, gpointer data)
{
MainWindow *mainwin = (MainWindow *)data;
- summary_mark_all_unread(mainwin->summaryview);
+ summary_mark_all_unread(mainwin->summaryview, TRUE);
}
static void mark_as_spam_cb(GtkAction *action, gpointer data)
diff --git a/src/summaryview.c b/src/summaryview.c
index fd28235..5fa3e7f 100644
--- a/src/summaryview.c
+++ b/src/summaryview.c
@@ -4141,14 +4141,16 @@ void summary_msgs_unlock(SummaryView *summaryview)
summary_status_show(summaryview);
}
-void summary_mark_all_read(SummaryView *summaryview)
+void summary_mark_all_read(SummaryView *summaryview, gboolean ask_if_needed)
{
GtkCMCTree *ctree = GTK_CMCTREE(summaryview->ctree);
GtkCMCTreeNode *node;
AlertValue val;
gboolean froze = FALSE;
- if (prefs_common.ask_mark_all_read) {
+ /* ask_if_needed is FALSE when user-asking is performed by caller,
+ commonly when the caller is a mark-as-read-recursive func */
+ if (ask_if_needed && prefs_common.ask_mark_all_read) {
val = alertpanel_full(_("Mark all as read"),
_("Do you really want to mark all mails in this folder as read?"),
GTK_STOCK_NO, GTK_STOCK_YES, NULL,
@@ -4178,15 +4180,17 @@ void summary_mark_all_read(SummaryView *summaryview)
summary_status_show(summaryview);
}
-void summary_mark_all_unread(SummaryView *summaryview)
+void summary_mark_all_unread(SummaryView *summaryview, gboolean ask_if_needed)
{
GtkCMCTree *ctree = GTK_CMCTREE(summaryview->ctree);
GtkCMCTreeNode *node;
AlertValue val;
gboolean froze = FALSE;
- if (prefs_common.ask_mark_all_read) {
- val = alertpanel_full(_("Mark all as unread"),
+ /* ask_if_needed is FALSE when user-asking is performed by caller,
+ commonly when the caller is a mark-as-unread-recursive func */
+ if (ask_if_needed && prefs_common.ask_mark_all_read) {
+ val = alertpanel_full(_("FOO Mark all as unread"),
_("Do you really want to mark all mails in this folder as unread?"),
GTK_STOCK_NO, GTK_STOCK_YES, NULL,
TRUE, NULL, ALERT_QUESTION, G_ALERTDEFAULT);
diff --git a/src/summaryview.h b/src/summaryview.h
index 66c0c4d..2d192e5 100644
--- a/src/summaryview.h
+++ b/src/summaryview.h
@@ -276,8 +276,8 @@ void summary_mark_as_read (SummaryView *summaryview);
void summary_mark_as_unread (SummaryView *summaryview);
void summary_msgs_lock (SummaryView *summaryview);
void summary_msgs_unlock (SummaryView *summaryview);
-void summary_mark_all_read (SummaryView *summaryview);
-void summary_mark_all_unread (SummaryView *summaryview);
+void summary_mark_all_read (SummaryView *summaryview, gboolean ask_if_needed);
+void summary_mark_all_unread (SummaryView *summaryview, gboolean ask_if_needed);
void summary_mark_as_spam (SummaryView *summaryview,
guint action,
GtkWidget *widget);
diff --git a/src/toolbar.c b/src/toolbar.c
index 6819586..c41b487 100644
--- a/src/toolbar.c
+++ b/src/toolbar.c
@@ -1602,7 +1602,7 @@ static void toolbar_all_read_cb(GtkWidget *widget, gpointer data)
switch (toolbar_item->type) {
case TOOLBAR_MAIN:
mainwin = (MainWindow *) toolbar_item->parent;
- summary_mark_all_read(mainwin->summaryview);
+ summary_mark_all_read(mainwin->summaryview, TRUE);
break;
case TOOLBAR_MSGVIEW:
/* TODO: see toolbar_next_unread_cb() if you need
@@ -1624,7 +1624,7 @@ static void toolbar_all_unread_cb(GtkWidget *widget, gpointer data)
switch (toolbar_item->type) {
case TOOLBAR_MAIN:
mainwin = (MainWindow *) toolbar_item->parent;
- summary_mark_all_unread(mainwin->summaryview);
+ summary_mark_all_unread(mainwin->summaryview, TRUE);
break;
case TOOLBAR_MSGVIEW:
/* TODO: see toolbar_next_unread_cb() if you need
-----------------------------------------------------------------------
hooks/post-receive
--
Claws Mail
More information about the Commits
mailing list