aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMilan Crha <mcrha@redhat.com>2014-03-06 18:49:03 +0800
committerMilan Crha <mcrha@redhat.com>2014-03-06 18:49:03 +0800
commitddffaf3bcef9daf894e85911cd6179b9458ee502 (patch)
treea08f179c15946aada657a0ed4541ad355c5cff81
parent8b6802391608c0806e8a584c1b5022715b9615b0 (diff)
downloadgsoc2013-evolution-ddffaf3bcef9daf894e85911cd6179b9458ee502.tar
gsoc2013-evolution-ddffaf3bcef9daf894e85911cd6179b9458ee502.tar.gz
gsoc2013-evolution-ddffaf3bcef9daf894e85911cd6179b9458ee502.tar.bz2
gsoc2013-evolution-ddffaf3bcef9daf894e85911cd6179b9458ee502.tar.lz
gsoc2013-evolution-ddffaf3bcef9daf894e85911cd6179b9458ee502.tar.xz
gsoc2013-evolution-ddffaf3bcef9daf894e85911cd6179b9458ee502.tar.zst
gsoc2013-evolution-ddffaf3bcef9daf894e85911cd6179b9458ee502.zip
Bug #725615 - Disable Delete button in a vTrash folder
-rw-r--r--mail/e-mail-reader.c9
-rw-r--r--mail/e-mail-reader.h3
2 files changed, 9 insertions, 3 deletions
diff --git a/mail/e-mail-reader.c b/mail/e-mail-reader.c
index d0a851296c..e1c477ed12 100644
--- a/mail/e-mail-reader.c
+++ b/mail/e-mail-reader.c
@@ -3326,8 +3326,9 @@ mail_reader_update_actions (EMailReader *reader,
* advance the cursor even if the message is already deleted. */
action_name = "mail-delete";
sensitive =
- single_message_selected ||
- selection_has_undeleted_messages;
+ (single_message_selected ||
+ selection_has_undeleted_messages) &&
+ (state & E_MAIL_READER_FOLDER_IS_VTRASH) == 0;
action = e_mail_reader_get_action (reader, action_name);
gtk_action_set_sensitive (action, sensitive);
@@ -4042,6 +4043,7 @@ e_mail_reader_check_state (EMailReader *reader)
gboolean store_supports_vjunk = FALSE;
gboolean is_mailing_list;
gboolean is_junk_folder = FALSE;
+ gboolean is_vtrash_folder = FALSE;
guint32 state = 0;
guint ii;
@@ -4062,6 +4064,7 @@ e_mail_reader_check_state (EMailReader *reader)
store_supports_vjunk = (store->flags & CAMEL_STORE_VJUNK);
is_junk_folder =
(folder->folder_flags & CAMEL_FOLDER_IS_JUNK) != 0;
+ is_vtrash_folder = (store->flags & CAMEL_STORE_VTRASH) != 0 && (folder->folder_flags & CAMEL_FOLDER_IS_TRASH) != 0;
drafts_or_outbox =
em_utils_folder_is_drafts (registry, folder) ||
em_utils_folder_is_outbox (registry, folder);
@@ -4189,6 +4192,8 @@ e_mail_reader_check_state (EMailReader *reader)
state |= E_MAIL_READER_SELECTION_IS_MAILING_LIST;
if (is_junk_folder)
state |= E_MAIL_READER_FOLDER_IS_JUNK;
+ if (is_vtrash_folder)
+ state |= E_MAIL_READER_FOLDER_IS_VTRASH;
g_clear_object (&folder);
g_ptr_array_unref (uids);
diff --git a/mail/e-mail-reader.h b/mail/e-mail-reader.h
index 90e86f425c..5d081c2dad 100644
--- a/mail/e-mail-reader.h
+++ b/mail/e-mail-reader.h
@@ -86,7 +86,8 @@ enum {
E_MAIL_READER_SELECTION_HAS_UNREAD = 1 << 14,
E_MAIL_READER_SELECTION_HAS_ATTACHMENTS = 1 << 15,
E_MAIL_READER_SELECTION_IS_MAILING_LIST = 1 << 16,
- E_MAIL_READER_FOLDER_IS_JUNK = 1 << 17
+ E_MAIL_READER_FOLDER_IS_JUNK = 1 << 17,
+ E_MAIL_READER_FOLDER_IS_VTRASH = 1 << 18
};
struct _EMailReaderInterface {