From c99c1692987e9e58a9d800940e41855458424b85 Mon Sep 17 00:00:00 2001 From: Not Zed Date: Wed, 21 Apr 2004 05:18:58 +0000 Subject: dont desensitise HideDeleted just 'cause we have no folder, it needs to 2004-04-21 Not Zed * 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. svn path=/trunk/; revision=25551 --- mail/em-folder-browser.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'mail/em-folder-browser.c') 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 */ -- cgit