[evolution] Bug 677624 - Disable Properties when Search Folders is selected



commit b3c57ed8e5f1bcbda9ec0fa37a252aeb5313f279
Author: Matthew Barnes <mbarnes redhat com>
Date:   Thu Jun 7 20:32:51 2012 -0400

    Bug 677624 - Disable Properties when Search Folders is selected

 mail/e-mail-sidebar.c            |    6 ++++++
 modules/mail/e-mail-shell-view.c |    8 ++++----
 2 files changed, 10 insertions(+), 4 deletions(-)
---
diff --git a/mail/e-mail-sidebar.c b/mail/e-mail-sidebar.c
index d4aeeb7..594dd27 100644
--- a/mail/e-mail-sidebar.c
+++ b/mail/e-mail-sidebar.c
@@ -420,6 +420,7 @@ mail_sidebar_check_state (EMailSidebar *sidebar)
 	gchar *full_name;
 	const gchar *uid;
 	gboolean store_is_local;
+	gboolean store_is_vfolder;
 	gboolean allows_children = TRUE;
 	gboolean can_delete = TRUE;
 	gboolean is_junk = FALSE;
@@ -445,6 +446,11 @@ mail_sidebar_check_state (EMailSidebar *sidebar)
 
 	uid = camel_service_get_uid (CAMEL_SERVICE (store));
 	store_is_local = (g_strcmp0 (uid, E_MAIL_SESSION_LOCAL_UID) == 0);
+	store_is_vfolder = (g_strcmp0 (uid, E_MAIL_SESSION_VFOLDER_UID) == 0);
+
+	/* Bit of a hack to indicate "Search Folders" is selected. */
+	if (is_store && store_is_vfolder)
+		is_virtual = TRUE;
 
 	if (!is_store && full_name != NULL) {
 		guint32 folder_type;
diff --git a/modules/mail/e-mail-shell-view.c b/modules/mail/e-mail-shell-view.c
index cbcf24f..6efc54b 100644
--- a/modules/mail/e-mail-shell-view.c
+++ b/modules/mail/e-mail-shell-view.c
@@ -836,7 +836,6 @@ mail_shell_view_update_actions (EShellView *shell_view)
 	gboolean folder_has_unread_rec = FALSE;
 	gboolean folder_tree_and_message_list_agree = TRUE;
 	gboolean store_is_subscribable;
-	gboolean store_is_vstore = FALSE;
 	gboolean any_store_is_subscribable = FALSE;
 
 	/* Chain up to parent's update_actions() method. */
@@ -887,7 +886,6 @@ mail_shell_view_update_actions (EShellView *shell_view)
 		service = CAMEL_SERVICE (store);
 		uid = camel_service_get_uid (service);
 		source = e_source_registry_ref_source (registry, uid);
-		store_is_vstore = g_strcmp0 (uid, E_MAIL_SESSION_VFOLDER_UID) == 0;
 	}
 
 	if (source != NULL) {
@@ -974,8 +972,9 @@ mail_shell_view_update_actions (EShellView *shell_view)
 	sensitive = folder_is_trash;
 	gtk_action_set_sensitive (action, sensitive);
 
+	/* folder_is_store + folder_is_virtual == "Search Folders" */
 	action = ACTION (MAIL_ACCOUNT_PROPERTIES);
-	sensitive = (store != NULL) && folder_is_store;
+	sensitive = (store != NULL) && folder_is_store && !folder_is_virtual;
 	gtk_action_set_sensitive (action, sensitive);
 
 	action = ACTION (MAIL_FLUSH_OUTBOX);
@@ -1042,8 +1041,9 @@ mail_shell_view_update_actions (EShellView *shell_view)
 	sensitive = any_store_is_subscribable;
 	gtk_action_set_sensitive (action, sensitive);
 
+	/* folder_is_store + folder_is_virtual == "Search Folders" */
 	action = ACTION (MAIL_VFOLDER_UNMATCHED_ENABLE);
-	gtk_action_set_visible (action, folder_is_store && store_is_vstore);
+	gtk_action_set_visible (action, folder_is_store && folder_is_virtual);
 
 	e_mail_shell_view_update_popup_labels (mail_shell_view);
 }



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]