[evolution] Add "Send messages through Outbox folder" option



commit 2f73b39bf2999fa0316e776a0d7a3967e69c8ec6
Author: Milan Crha <mcrha redhat com>
Date:   Mon Jun 2 14:36:00 2014 +0200

    Add "Send messages through Outbox folder" option
    
    Users ask from time to time for the old behaviour when the messages
    used to be saved through Outbox, rather than the composer being opened
    all the time the message is sending. The change is pretty simple,
    thus why not to add it.
    
    Note the Outbox is not flushed after sending, the users is responsible
    to invoke the Outbox flush on his/her own. This also allows a user
    to postpone the message send for later.

 data/org.gnome.evolution.mail.gschema.xml.in |    5 +++++
 mail/em-composer-utils.c                     |   10 ++++++++++
 mail/mail-config.ui                          |   18 +++++++++++++++++-
 modules/mail/em-composer-prefs.c             |    6 ++++++
 4 files changed, 38 insertions(+), 1 deletions(-)
---
diff --git a/data/org.gnome.evolution.mail.gschema.xml.in b/data/org.gnome.evolution.mail.gschema.xml.in
index d026ec9..e42de28 100644
--- a/data/org.gnome.evolution.mail.gschema.xml.in
+++ b/data/org.gnome.evolution.mail.gschema.xml.in
@@ -140,6 +140,11 @@
       <_summary>Encode filenames in an Outlook/GMail way</_summary>
       <_description>Encode filenames in the mail headers same as Outlook or GMail do, to let them display 
correctly filenames with UTF-8 letters sent by Evolution, because they do not follow the RFC 2231, but use 
the incorrect RFC 2047 standard.</_description>
     </key>
+    <key name="composer-use-outbox" type="b">
+      <default>false</default>
+      <_summary>Send messages through Outbox folder</_summary>
+      <_description>Always save messages to Outbox folder when sending, to let a user choose when the 
messages should be sent.</_description>
+    </key>
     <key name="composer-top-signature" type="b">
       <default>false</default>
       <_summary>Put personalized signatures at the top of replies</_summary>
diff --git a/mail/em-composer-utils.c b/mail/em-composer-utils.c
index 26efe96..22cc594 100644
--- a/mail/em-composer-utils.c
+++ b/mail/em-composer-utils.c
@@ -601,6 +601,16 @@ em_utils_composer_send_cb (EMsgComposer *composer,
 {
        AsyncContext *async_context;
        GCancellable *cancellable;
+       GSettings *settings;
+
+       settings = g_settings_new ("org.gnome.evolution.mail");
+       if (g_settings_get_boolean (settings, "composer-use-outbox")) {
+               e_msg_composer_save_to_outbox (composer);
+               g_object_unref (settings);
+               return;
+       }
+
+       g_object_unref (settings);
 
        if (!camel_session_get_online (CAMEL_SESSION (session))) {
                e_alert_run_dialog_for_args (
diff --git a/mail/mail-config.ui b/mail/mail-config.ui
index a4769fe..4ba1964 100644
--- a/mail/mail-config.ui
+++ b/mail/mail-config.ui
@@ -278,6 +278,22 @@
                       </packing>
                     </child>
                     <child>
+                      <object class="GtkCheckButton" id="chkUseOutbox">
+                        <property name="label" translatable="yes">Send messages through Outbo_x 
folder</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="xalign">0.5</property>
+                        <property name="draw_indicator">True</property>
+                      </object>
+                      <packing>
+                        <property name="expand">False</property>
+                        <property name="fill">False</property>
+                        <property name="position">4</property>
+                      </packing>
+                    </child>
+                    <child>
                       <object class="GtkHBox" id="hboxComposerCharset">
                         <property name="visible">True</property>
                         <property name="can_focus">False</property>
@@ -304,7 +320,7 @@
                       <packing>
                         <property name="expand">False</property>
                         <property name="fill">False</property>
-                        <property name="position">4</property>
+                        <property name="position">5</property>
                       </packing>
                     </child>
                   </object>
diff --git a/modules/mail/em-composer-prefs.c b/modules/mail/em-composer-prefs.c
index d7ddf2a..8ef21c4 100644
--- a/modules/mail/em-composer-prefs.c
+++ b/modules/mail/em-composer-prefs.c
@@ -1135,6 +1135,12 @@ em_composer_prefs_construct (EMComposerPrefs *prefs,
                widget, "active",
                G_SETTINGS_BIND_DEFAULT);
 
+       widget = e_builder_get_widget (prefs->builder, "chkUseOutbox");
+       g_settings_bind (
+               settings, "composer-use-outbox",
+               widget, "active",
+               G_SETTINGS_BIND_DEFAULT);
+
        widget = e_builder_get_widget (prefs->builder, "chkIgnoreListReplyTo");
        g_settings_bind (
                settings, "composer-ignore-list-reply-to",


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