From e419261d1841fa38c0c41f5eaddd9b790ab85996 Mon Sep 17 00:00:00 2001 From: Milan Crha Date: Mon, 29 Nov 2010 19:48:58 +0100 Subject: Bug #633949 - Add an option to disable new e-mail check at startup --- mail/evolution-mail.schemas.in | 15 ++++++++ mail/mail-config.ui | 71 +++++++++++++++++++++++++++++++++++- mail/mail-send-recv.c | 8 +++- modules/mail/e-mail-shell-settings.c | 4 ++ modules/mail/em-mailer-prefs.c | 7 ++++ 5 files changed, 102 insertions(+), 3 deletions(-) diff --git a/mail/evolution-mail.schemas.in b/mail/evolution-mail.schemas.in index 695f9c9632..4493c22f09 100644 --- a/mail/evolution-mail.schemas.in +++ b/mail/evolution-mail.schemas.in @@ -1555,6 +1555,21 @@ + + /schemas/apps/evolution/mail/send_recv_on_start + /apps/evolution/mail/send_recv_on_start + evolution-mail + bool + true + + Check for new messages on start + + Whether check for new messages when Evolution is started. + This includes also sending messages from Outbox. + + + + /schemas/apps/evolution/mail/send_recv_height /apps/evolution/mail/send_recv_height diff --git a/mail/mail-config.ui b/mail/mail-config.ui index 7252206a56..8677b95f15 100644 --- a/mail/mail-config.ui +++ b/mail/mail-config.ui @@ -2415,6 +2415,73 @@ For example: "Work" or "Personal" 12 vertical 12 + + + True + vertical + 6 + + + True + 0 + Start up + + + + + + False + False + 0 + + + + + True + 12 + + + True + vertical + 6 + + + True + 4 + + + Check for new _messages on start + True + True + False + True + True + + + False + False + 0 + + + + + 0 + + + + + + + 1 + + + + + False + False + 0 + + True @@ -2652,7 +2719,7 @@ For example: "Work" or "Personal" False False - 0 + 1 @@ -2749,7 +2816,7 @@ For example: "Work" or "Personal" False False - 1 + 2 diff --git a/mail/mail-send-recv.c b/mail/mail-send-recv.c index cdcce0455d..deb38eb24a 100644 --- a/mail/mail-send-recv.c +++ b/mail/mail-send-recv.c @@ -1252,7 +1252,13 @@ mail_autoreceive_init (EMailBackend *backend) shell_backend = E_SHELL_BACKEND (backend); shell = e_shell_backend_get_shell (shell_backend); - auto_online (shell); + if (e_shell_settings_get_boolean (e_shell_get_shell_settings (shell), "mail-check-on-start")) { + auto_online (shell); + + /* also flush outbox on start */ + if (e_shell_get_online (shell)) + mail_send (session); + } g_signal_connect ( shell, "notify::online", diff --git a/modules/mail/e-mail-shell-settings.c b/modules/mail/e-mail-shell-settings.c index 3e55a98aa8..d6e9aabbba 100644 --- a/modules/mail/e-mail-shell-settings.c +++ b/modules/mail/e-mail-shell-settings.c @@ -108,6 +108,10 @@ e_mail_shell_settings_init (EShellBackend *shell_backend) "mail-check-for-junk", "/apps/evolution/mail/junk/check_incoming"); + e_shell_settings_install_property_for_key ( + "mail-check-on-start", + "/apps/evolution/mail/send_recv_on_start"); + e_shell_settings_install_property_for_key ( "mail-citation-color", "/apps/evolution/mail/display/citation_colour"); diff --git a/modules/mail/em-mailer-prefs.c b/modules/mail/em-mailer-prefs.c index b03ac60b0c..cae9251158 100644 --- a/modules/mail/em-mailer-prefs.c +++ b/modules/mail/em-mailer-prefs.c @@ -832,6 +832,13 @@ em_mailer_prefs_construct (EMMailerPrefs *prefs, /* General tab */ + widget = e_builder_get_widget (prefs->builder, "chkCheckMailOnStart"); + g_object_bind_property ( + shell_settings, "mail-check-on-start", + widget, "active", + G_BINDING_BIDIRECTIONAL | + G_BINDING_SYNC_CREATE); + /* Message Display */ widget = e_builder_get_widget (prefs->builder, "view-check"); -- cgit