aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMilan Crha <mcrha@redhat.com>2012-09-06 16:59:05 +0800
committerMilan Crha <mcrha@redhat.com>2012-09-06 16:59:05 +0800
commit3451671ce9296afda4135670c65e8df3fffe02b2 (patch)
treebee83e2f228b524769a20b77ba41db0e809966f4
parent67f6df0d2cc78668a0d3d7cdd7a524e5c23fdbad (diff)
downloadgsoc2013-evolution-3451671ce9296afda4135670c65e8df3fffe02b2.tar
gsoc2013-evolution-3451671ce9296afda4135670c65e8df3fffe02b2.tar.gz
gsoc2013-evolution-3451671ce9296afda4135670c65e8df3fffe02b2.tar.bz2
gsoc2013-evolution-3451671ce9296afda4135670c65e8df3fffe02b2.tar.lz
gsoc2013-evolution-3451671ce9296afda4135670c65e8df3fffe02b2.tar.xz
gsoc2013-evolution-3451671ce9296afda4135670c65e8df3fffe02b2.tar.zst
gsoc2013-evolution-3451671ce9296afda4135670c65e8df3fffe02b2.zip
Honor CAMEL_PROVIDER_DISABLE_SENT_FOLDER in account preferences
-rw-r--r--mail/e-mail-config-defaults-page.c23
1 files changed, 19 insertions, 4 deletions
diff --git a/mail/e-mail-config-defaults-page.c b/mail/e-mail-config-defaults-page.c
index 9d54fb5eec..1420ddab5c 100644
--- a/mail/e-mail-config-defaults-page.c
+++ b/mail/e-mail-config-defaults-page.c
@@ -267,10 +267,12 @@ mail_config_defaults_page_restore_folders (EMailConfigDefaultsPage *page)
folder_uri = e_mail_session_get_local_folder_uri (session, type);
em_folder_selection_button_set_folder_uri (button, folder_uri);
- type = E_MAIL_LOCAL_FOLDER_SENT;
- button = EM_FOLDER_SELECTION_BUTTON (page->priv->sent_button);
- folder_uri = e_mail_session_get_local_folder_uri (session, type);
- em_folder_selection_button_set_folder_uri (button, folder_uri);
+ if (gtk_widget_is_sensitive (page->priv->sent_button)) {
+ type = E_MAIL_LOCAL_FOLDER_SENT;
+ button = EM_FOLDER_SELECTION_BUTTON (page->priv->sent_button);
+ folder_uri = e_mail_session_get_local_folder_uri (session, type);
+ em_folder_selection_button_set_folder_uri (button, folder_uri);
+ }
}
static void
@@ -486,6 +488,7 @@ mail_config_defaults_page_constructed (GObject *object)
EMailConfigDefaultsPage *page;
EMailSession *session;
ESource *source;
+ ESourceBackend *account_ext;
ESourceMailComposition *composition_ext;
ESourceMailSubmission *submission_ext;
ESourceMDN *mdn_ext;
@@ -497,6 +500,7 @@ mail_config_defaults_page_constructed (GObject *object)
GEnumClass *enum_class;
GEnumValue *enum_value;
EMdnResponsePolicy policy;
+ CamelProvider *provider = NULL;
const gchar *extension_name;
const gchar *text;
gchar *markup;
@@ -507,6 +511,12 @@ mail_config_defaults_page_constructed (GObject *object)
G_OBJECT_CLASS (e_mail_config_defaults_page_parent_class)->
constructed (object);
+ source = e_mail_config_defaults_page_get_account_source (page);
+ extension_name = E_SOURCE_EXTENSION_MAIL_ACCOUNT;
+ account_ext = e_source_get_extension (source, extension_name);
+ if (e_source_backend_get_backend_name (account_ext))
+ provider = camel_provider_get (e_source_backend_get_backend_name (account_ext), NULL);
+
session = e_mail_config_defaults_page_get_session (page);
source = e_mail_config_defaults_page_get_identity_source (page);
@@ -587,6 +597,11 @@ mail_config_defaults_page_constructed (GObject *object)
page->priv->sent_button = widget; /* not referenced */
gtk_widget_show (widget);
+ if (provider && (provider->flags & CAMEL_PROVIDER_DISABLE_SENT_FOLDER) != 0) {
+ gtk_widget_set_sensitive (GTK_WIDGET (label), FALSE);
+ gtk_widget_set_sensitive (widget, FALSE);
+ }
+
g_object_bind_property (
submission_ext, "sent-folder",
widget, "folder-uri",