commit 9470e632a121897af943b4c2972a7f1dfe8a0673
parent a48bc282238c94763a8c35a797e72b57b0fd3034
Author: Ricardo Mones <ricardo@mones.org>
Date: Mon, 3 Oct 2016 15:54:01 +0200
Fix #3014: The icon for folder drafts with hide…
…read messages is the same as when not hidden
Fix disables hiding thread/messages options in draft folders,
hence hrm mode icons are not required for them. Values already
set for these options in draft folders are also ignored.
Many thanks to Andrej and Paul for their feedback on this one.
Diffstat:
3 files changed, 18 insertions(+), 10 deletions(-)
diff --git a/src/folder.c b/src/folder.c
@@ -1,6 +1,6 @@
/*
- * Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
- * Copyright (C) 1999-2012 Hiroyuki Yamamoto and the Claws Mail team
+ * Claws Mail -- a GTK+ based, lightweight, and fast e-mail client
+ * Copyright (C) 1999-2016 Hiroyuki Yamamoto and the Claws Mail team
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -14,7 +14,6 @@
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
*/
#ifdef HAVE_CONFIG_H
@@ -650,6 +649,11 @@ void folder_item_set_xml(Folder *folder, FolderItem *item, XMLTag *tag)
item->last_seen = 0;
}
}
+ /* options without meaning in drafts */
+ if (item->stype == F_DRAFT)
+ item->hide_read_msgs =
+ item->hide_del_msgs =
+ item->hide_read_threads = FALSE;
}
XMLTag *folder_item_get_xml(Folder *folder, FolderItem *item)
diff --git a/src/mainwindow.c b/src/mainwindow.c
@@ -3015,6 +3015,10 @@ SensitiveCondMask main_window_get_current_state(MainWindow *mainwin)
!folder_has_parent_of_type(mainwin->summaryview->folder_item, F_TRASH)))
UPDATE_STATE(M_NOT_TRASH);
+ if (mainwin->summaryview->folder_item
+ && mainwin->summaryview->folder_item->stype != F_DRAFT)
+ UPDATE_STATE(M_NOT_DRAFT);
+
if (prefs_common.actions_list && g_slist_length(prefs_common.actions_list))
UPDATE_STATE(M_ACTIONS_EXIST);
@@ -3175,9 +3179,9 @@ do { \
FILL_TABLE("Menu/View/ThreadView", M_EXEC, M_SUMMARY_ISLIST);
FILL_TABLE("Menu/View/ExpandThreads", M_MSG_EXIST, M_SUMMARY_ISLIST);
FILL_TABLE("Menu/View/CollapseThreads", M_MSG_EXIST, M_SUMMARY_ISLIST);
- FILL_TABLE("Menu/View/HideReadThreads", M_HIDE_READ_THREADS, M_SUMMARY_ISLIST);
- FILL_TABLE("Menu/View/HideReadMessages", M_HIDE_READ_MSG, M_SUMMARY_ISLIST);
- FILL_TABLE("Menu/View/HideDelMessages", M_SUMMARY_ISLIST);
+ FILL_TABLE("Menu/View/HideReadThreads", M_HIDE_READ_THREADS, M_SUMMARY_ISLIST, M_NOT_DRAFT);
+ FILL_TABLE("Menu/View/HideReadMessages", M_HIDE_READ_MSG, M_SUMMARY_ISLIST, M_NOT_DRAFT);
+ FILL_TABLE("Menu/View/HideDelMessages", M_SUMMARY_ISLIST, M_NOT_DRAFT);
FILL_TABLE("Menu/View/Goto/Prev", M_MSG_EXIST);
FILL_TABLE("Menu/View/Goto/Next", M_MSG_EXIST);
FILL_TABLE("Menu/View/Goto/PrevUnread", M_MSG_EXIST);
@@ -3345,7 +3349,7 @@ do { \
cm_toggle_menu_set_active_full(mainwin->ui_manager, "Menu/View/ThreadView", (state & main_window_get_mask(M_THREADED, -1)) != 0);
cm_menu_set_sensitive_full(mainwin->ui_manager, "Menu/View/ExpandThreads", (state & main_window_get_mask(M_THREADED, -1)) != 0);
cm_menu_set_sensitive_full(mainwin->ui_manager, "Menu/View/CollapseThreads", (state & main_window_get_mask(M_THREADED, -1)) != 0);
- cm_menu_set_sensitive_full(mainwin->ui_manager, "Menu/View/HideReadThreads", (state & main_window_get_mask(M_THREADED, -1)) != 0);
+ cm_menu_set_sensitive_full(mainwin->ui_manager, "Menu/View/HideReadThreads", (state & main_window_get_mask(M_THREADED, -1)) != 0 && (state & main_window_get_mask(M_NOT_DRAFT, -1)) != 0);
cm_toggle_menu_set_active_full(mainwin->ui_manager, "Menu/View/Quotes/CollapseAll", (prefs_common.hide_quotes == 1));
cm_toggle_menu_set_active_full(mainwin->ui_manager, "Menu/View/Quotes/Collapse2", (prefs_common.hide_quotes == 2));
cm_toggle_menu_set_active_full(mainwin->ui_manager, "Menu/View/Quotes/Collapse3", (prefs_common.hide_quotes == 3));
diff --git a/src/mainwindow.h b/src/mainwindow.h
@@ -1,6 +1,6 @@
/*
- * Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
- * Copyright (C) 1999-2013 Hiroyuki Yamamoto and the Claws Mail team
+ * Claws Mail -- a GTK+ based, lightweight, and fast e-mail client
+ * Copyright (C) 1999-2016 Hiroyuki Yamamoto and the Claws Mail team
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -14,7 +14,6 @@
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
*/
#ifndef __MAINWINDOW_H__
@@ -70,6 +69,7 @@ typedef enum
M_HIDE_READ_THREADS,
M_HAVE_RETRIEVABLE_ACCOUNT,
M_HAVE_ANY_RETRIEVABLE_ACCOUNT,
+ M_NOT_DRAFT,
/* reserved */
M_MAX_RESERVED