talons

Fork of Claws Mail https://www.claws-mail
Log | Files | Refs | README | LICENSE

commit c7af8ad4b2915af05f2d2755b216affd1368a7b3
parent d287120c94c98d51a9844227565952fc5ada3842
Author: wwp <wwp@free.fr>
Date:   Wed,  4 Jan 2017 11:14:15 +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>

Diffstat:
Msrc/folderutils.c | 4++--
Msrc/folderview.c | 3+--
Msrc/mainwindow.c | 4++--
Msrc/summaryview.c | 14+++++++++-----
Msrc/summaryview.h | 4++--
Msrc/toolbar.c | 4++--
6 files changed, 18 insertions(+), 15 deletions(-)

diff --git 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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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