[evolution/webkit] Bug #633949 - Add an option to disable new e-mail check at startup



commit 14763ea655ed9fbcc32dc90dc133b5143673aaa3
Author: Milan Crha <mcrha redhat com>
Date:   Mon Nov 29 19:48:58 2010 +0100

    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 695f9c9..4493c22 100644
--- a/mail/evolution-mail.schemas.in
+++ b/mail/evolution-mail.schemas.in
@@ -1556,6 +1556,21 @@
     </schema>
 
     <schema>
+      <key>/schemas/apps/evolution/mail/send_recv_on_start</key>
+      <applyto>/apps/evolution/mail/send_recv_on_start</applyto>
+      <owner>evolution-mail</owner>
+      <type>bool</type>
+      <default>true</default>
+      <locale name="C">
+        <short>Check for new messages on start</short>
+        <long>
+          Whether check for new messages when Evolution is started.
+          This includes also sending messages from Outbox.
+        </long>
+      </locale>
+    </schema>
+
+    <schema>
       <key>/schemas/apps/evolution/mail/send_recv_height</key>
       <applyto>/apps/evolution/mail/send_recv_height</applyto>
       <owner>evolution-mail</owner>
diff --git a/mail/mail-config.ui b/mail/mail-config.ui
index 7252206..8677b95 100644
--- a/mail/mail-config.ui
+++ b/mail/mail-config.ui
@@ -2416,6 +2416,73 @@ For example: "Work" or "Personal"</property>
         <property name="orientation">vertical</property>
         <property name="spacing">12</property>
         <child>
+          <object class="GtkVBox" id="start-up-section">
+            <property name="visible">True</property>
+            <property name="orientation">vertical</property>
+            <property name="spacing">6</property>
+            <child>
+              <object class="GtkLabel" id="start-up-header">
+                <property name="visible">True</property>
+                <property name="xalign">0</property>
+                <property name="label" translatable="yes">Start up</property>
+                <attributes>
+                  <attribute name="weight" value="bold"/>
+                </attributes>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">False</property>
+                <property name="position">0</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkAlignment" id="start-up-alignment">
+                <property name="visible">True</property>
+                <property name="left_padding">12</property>
+                <child>
+                  <object class="GtkVBox" id="start-up-vbox">
+                    <property name="visible">True</property>
+                    <property name="orientation">vertical</property>
+                    <property name="spacing">6</property>
+                    <child>
+                      <object class="GtkHBox" id="start-up-hbox1">
+                        <property name="visible">True</property>
+                        <property name="spacing">4</property>
+                        <child>
+                          <object class="GtkCheckButton" id="chkCheckMailOnStart">
+                            <property name="label" translatable="yes">Check for new _messages on start</property>
+                            <property name="visible">True</property>
+                            <property name="can_focus">True</property>
+                            <property name="receives_default">False</property>
+                            <property name="use_underline">True</property>
+                            <property name="draw_indicator">True</property>
+                          </object>
+                          <packing>
+                            <property name="expand">False</property>
+                            <property name="fill">False</property>
+                            <property name="position">0</property>
+                          </packing>
+                        </child>
+                      </object>
+                      <packing>
+                        <property name="position">0</property>
+                      </packing>
+                    </child>
+                  </object>
+                </child>
+              </object>
+              <packing>
+                <property name="position">1</property>
+              </packing>
+            </child>
+          </object>
+          <packing>
+            <property name="expand">False</property>
+            <property name="fill">False</property>
+            <property name="position">0</property>
+          </packing>
+        </child>
+        <child>
           <object class="GtkVBox" id="message-display-section">
             <property name="visible">True</property>
             <property name="orientation">vertical</property>
@@ -2652,7 +2719,7 @@ For example: "Work" or "Personal"</property>
           <packing>
             <property name="expand">False</property>
             <property name="fill">False</property>
-            <property name="position">0</property>
+            <property name="position">1</property>
           </packing>
         </child>
         <child>
@@ -2749,7 +2816,7 @@ For example: "Work" or "Personal"</property>
           <packing>
             <property name="expand">False</property>
             <property name="fill">False</property>
-            <property name="position">1</property>
+            <property name="position">2</property>
           </packing>
         </child>
       </object>
diff --git a/mail/mail-send-recv.c b/mail/mail-send-recv.c
index cdcce04..deb38eb 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 3e55a98..d6e9aab 100644
--- a/modules/mail/e-mail-shell-settings.c
+++ b/modules/mail/e-mail-shell-settings.c
@@ -109,6 +109,10 @@ e_mail_shell_settings_init (EShellBackend *shell_backend)
 		"/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 4d0ed94..e117e3e 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");



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]