aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--mail/ChangeLog6
-rw-r--r--mail/em-folder-browser.c12
2 files changed, 16 insertions, 2 deletions
diff --git a/mail/ChangeLog b/mail/ChangeLog
index 12d6bb16f1..43beeb0e0e 100644
--- a/mail/ChangeLog
+++ b/mail/ChangeLog
@@ -1,5 +1,11 @@
2004-04-21 Not Zed <NotZed@Ximian.com>
+ * em-folder-browser.c (emfb_activate): dont desensitise
+ HideDeleted just 'cause we have no folder, it needs to depend on
+ Trash folder only.
+ (emfb_set_folder): set the hidedeleted sensitivity based on
+ whether we have a trash folder or not. Fixed #57226.
+
* em-folder-view.c (emfv_class_init): use the right signal
callback for the changed signal. Fixes #57246.
diff --git a/mail/em-folder-browser.c b/mail/em-folder-browser.c
index 38649e7663..5422cab731 100644
--- a/mail/em-folder-browser.c
+++ b/mail/em-folder-browser.c
@@ -948,6 +948,11 @@ emfb_set_folder(EMFolderView *emfv, CamelFolder *folder, const char *uri)
if (emfv->uic)
bonobo_ui_component_set_prop(emfv->uic, "/commands/ViewThreaded", "state", state?"1":"0", NULL);
+ if (emfv->uic) {
+ state = (folder->folder_flags & CAMEL_FOLDER_IS_TRASH) == 0;
+ bonobo_ui_component_set_prop(emfv->uic, "/commands/HideDeleted", "sensitive", state?"1":"0", NULL);
+ }
+
sstate = camel_object_meta_get(folder, "evolution:search_state");
g_object_set(emfb->search, "state", sstate, NULL);
g_free(sstate);
@@ -1057,11 +1062,14 @@ emfb_activate(EMFolderView *emfv, BonoboUIComponent *uic, int act)
/* HideDeleted */
state = !gconf_client_get_bool(gconf, "/apps/evolution/mail/display/show_deleted", NULL);
+ if (emfv->folder && (emfv->folder->folder_flags & CAMEL_FOLDER_IS_TRASH)) {
+ state = FALSE;
+ bonobo_ui_component_set_prop(uic, "/commands/HideDeleted", "sensitive", "0", NULL);
+ } else
+ bonobo_ui_component_set_prop(uic, "/commands/HideDeleted", "sensitive", "1", NULL);
bonobo_ui_component_set_prop(uic, "/commands/HideDeleted", "state", state ? "1" : "0", NULL);
bonobo_ui_component_add_listener(uic, "HideDeleted", emfb_hide_deleted, emfv);
em_folder_view_set_hide_deleted(emfv, state); /* <- not sure if this optimal, but it'll do */
- if (emfv->folder == NULL)
- bonobo_ui_component_set_prop(uic, "/commands/HideDeleted", "sensitive", state?"1":"0", NULL);
/* FIXME: If we have no folder, we can't do a few of the lookups we need,
perhaps we should postpone till we can */