aboutsummaryrefslogtreecommitdiffstats
path: root/mail/folder-browser-factory.c
diff options
context:
space:
mode:
Diffstat (limited to 'mail/folder-browser-factory.c')
-rw-r--r--mail/folder-browser-factory.c45
1 files changed, 24 insertions, 21 deletions
diff --git a/mail/folder-browser-factory.c b/mail/folder-browser-factory.c
index 6c80677352..4d7644d149 100644
--- a/mail/folder-browser-factory.c
+++ b/mail/folder-browser-factory.c
@@ -38,6 +38,7 @@
#include "mail-session.h"
#include "e-util/e-gui-utils.h"
+#include "camel/camel-vtrash-folder.h"
/* The FolderBrowser BonoboControls we have. */
static EList *control_list = NULL;
@@ -222,6 +223,7 @@ control_activate (BonoboControl *control,
{
GtkWidget *folder_browser;
Bonobo_UIContainer container;
+ int state;
container = bonobo_control_get_remote_ui_container (control);
bonobo_ui_component_set_container (uic, container);
@@ -241,27 +243,28 @@ control_activate (BonoboControl *control,
uic, EVOLUTION_DATADIR,
"evolution-mail.xml", "evolution-mail");
- if (mail_config_get_thread_list ())
- bonobo_ui_component_set_prop (
- uic, "/commands/ViewThreaded", "state", "1", NULL);
- else
- bonobo_ui_component_set_prop (
- uic, "/commands/ViewThreaded", "state", "0", NULL);
-
- bonobo_ui_component_add_listener (
- uic, "ViewThreaded",
- folder_browser_toggle_threads, folder_browser);
-
- if (mail_config_get_view_source ())
- bonobo_ui_component_set_prop (uic, "/commands/ViewSource",
- "state", "1", NULL);
- else
- bonobo_ui_component_set_prop (uic, "/commands/ViewSource",
- "state", "0", NULL);
-
- bonobo_ui_component_add_listener (uic, "ViewSource",
- folder_browser_toggle_view_source,
- folder_browser);
+ state = mail_config_get_thread_list();
+ bonobo_ui_component_set_prop(uic, "/commands/ViewThreaded", "state", state?"1":"0", NULL);
+ bonobo_ui_component_add_listener(uic, "ViewThreaded", folder_browser_toggle_threads, folder_browser);
+ /* FIXME: this kind of bypasses bonobo but seems the only way when we change components */
+ folder_browser_toggle_threads(uic, "", Bonobo_UIComponent_STATE_CHANGED, state?"1":"0", folder_browser);
+
+ state = mail_config_get_view_source();
+ bonobo_ui_component_set_prop(uic, "/commands/ViewSource", "state", state?"1":"0", NULL);
+ bonobo_ui_component_add_listener(uic, "ViewSource", folder_browser_toggle_view_source, folder_browser);
+ /* FIXME: this kind of bypasses bonobo but seems the only way when we change components */
+ folder_browser_toggle_view_source(uic, "", Bonobo_UIComponent_STATE_CHANGED, state?"1":"0", folder_browser);
+
+ if (fb->folder && CAMEL_IS_VTRASH_FOLDER(fb->folder)) {
+ bonobo_ui_component_set_prop(uic, "/commands/HideDeleted", "sensitive", "0", NULL);
+ state = FALSE;
+ } else {
+ state = mail_config_get_hide_deleted();
+ }
+ bonobo_ui_component_set_prop(uic, "/commands/HideDeleted", "state", state?"1":"0", NULL);
+ bonobo_ui_component_add_listener(uic, "HideDeleted", folder_browser_toggle_hide_deleted, folder_browser);
+ /* FIXME: this kind of bypasses bonobo but seems the only way when we change components */
+ folder_browser_toggle_hide_deleted(uic, "", Bonobo_UIComponent_STATE_CHANGED, state?"1":"0", folder_browser);
folder_browser_setup_view_menus (fb, uic);
folder_browser_setup_property_menu (fb, uic);