[Commits] [SCM] claws branch, master, updated. 3.14.1-158-g20ad778
wwp at claws-mail.org
wwp at claws-mail.org
Sat Jan 21 15:16:19 CET 2017
The branch, master has been updated
via 20ad778b08831f0779847afe64fe881da177985d (commit)
from 18403c8b8b3da6086f29d69f49aad51c04f78967 (commit)
Summary of changes:
src/mainwindow.c | 40 ++++++++++++++++++++++++++++++++++------
src/toolbar.c | 2 +-
2 files changed, 35 insertions(+), 7 deletions(-)
- Log -----------------------------------------------------------------
commit 20ad778b08831f0779847afe64fe881da177985d
Author: wwp <wwp at free.fr>
Date: Sat Jan 21 15:12:43 2017 +0100
Always show a notice dialog after delete-dupes, even if nothing has
been deleted. Make a better notice when it's about marking as delete
(for later deletion when execute is done). Always say we're deleting
dupes, in status bar.
Fix toolbar item sensibility even though if it's not perfect since
the whole button dropdown menu can't be accessed if current folder
can't be searched for dupes.
diff --git a/src/mainwindow.c b/src/mainwindow.c
index d23c7db..5f3a64b 100644
--- a/src/mainwindow.c
+++ b/src/mainwindow.c
@@ -4700,14 +4700,36 @@ void mainwindow_delete_duplicated(MainWindow *mainwin)
item = folderview_get_selected_item(mainwin->folderview);
if (item) {
+ gint result;
+
main_window_cursor_wait(mainwin);
STATUSBAR_PUSH(mainwin, _("Deleting duplicated messages..."));
-
- folderutils_delete_duplicates(item, prefs_common.immediate_exec ?
+ result = folderutils_delete_duplicates(item, prefs_common.immediate_exec ?
DELETE_DUPLICATES_REMOVE : DELETE_DUPLICATES_SETFLAG);
-
STATUSBAR_POP(mainwin);
main_window_cursor_normal(mainwin);
+
+ switch (result > 0) {
+ case -1:
+ break;
+ case 0:
+ alertpanel_notice(_("No duplicate message found in selected folder.\n"));
+ break;
+ default: {
+ gchar *msg;
+
+ if (prefs_common.immediate_exec) {
+ msg = ngettext("Deleted %d duplicate message in selected folder.\n",
+ "Deleted %d duplicate messages in selected folder.\n",
+ result);
+ } else {
+ msg = ngettext("Marked %d duplicate message for deletion in selected folder.\n",
+ "Marked %d duplicate messages in selected folder.\n",
+ result);
+ }
+ alertpanel_notice(msg, result);
+ }
+ }
}
}
@@ -4739,13 +4761,19 @@ void mainwindow_delete_duplicated_all(MainWindow *mainwin)
struct DelDupsData data = {0, 0};
main_window_cursor_wait(mainwin);
+ STATUSBAR_PUSH(mainwin, _("Deleting duplicated messages in all folders..."));
folder_func_to_all_folders(deldup_all, &data);
+ STATUSBAR_POP(mainwin);
main_window_cursor_normal(mainwin);
-
- alertpanel_notice(ngettext("Deleted %d duplicate message in %d folders.\n",
+
+ if (data.dups > 0) {
+ alertpanel_notice(ngettext("Deleted %d duplicate message in %d folders.\n",
"Deleted %d duplicate messages in %d folders.\n",
data.dups),
- data.dups, data.folders);
+ data.dups, data.folders);
+ } else {
+ alertpanel_notice(_("No duplicate message found in %d folders.\n"), data.folders);
+ }
}
static void delete_duplicated_all_cb(GtkAction *action, gpointer mw)
diff --git a/src/toolbar.c b/src/toolbar.c
index 47f0500..a182d4e 100644
--- a/src/toolbar.c
+++ b/src/toolbar.c
@@ -2681,7 +2681,7 @@ do { \
if (toolbar->delete_dup_btn)
SET_WIDGET_COND(toolbar->delete_dup_btn,
- M_ALLOW_DELETE, M_SUMMARY_ISLIST);
+ M_MSG_EXIST, M_ALLOW_DELETE, M_SUMMARY_ISLIST);
if (toolbar->exec_btn)
SET_WIDGET_COND(toolbar->exec_btn,
-----------------------------------------------------------------------
hooks/post-receive
--
Claws Mail
More information about the Commits
mailing list