[evolution/wip/gsettings] Bug #637906 - Don't ask again when sending to non-mail recipients



commit 6e9c9986ac569a4e759f2102ec87e7614c8c00cc
Author: Milan Crha <mcrha redhat com>
Date:   Wed Jan 5 17:42:04 2011 +0100

    Bug #637906 - Don't ask again when sending to non-mail recipients

 mail/em-composer-utils.c             |    5 +++--
 mail/evolution-mail.schemas.in       |   12 ++++++++++++
 mail/mail-config.ui                  |   15 +++++++++++++++
 modules/mail/e-mail-shell-settings.c |    4 ++++
 modules/mail/em-composer-prefs.c     |    7 +++++++
 5 files changed, 41 insertions(+), 2 deletions(-)
---
diff --git a/mail/em-composer-utils.c b/mail/em-composer-utils.c
index fa55a89..5dfa1ff 100644
--- a/mail/em-composer-utils.c
+++ b/mail/em-composer-utils.c
@@ -309,12 +309,13 @@ composer_presend_check_recipients (EMsgComposer *composer)
 	}
 
 	if (invalid_addrs) {
-		if (e_alert_run_dialog_for_args (
+		if (!em_utils_prompt_user (
 			GTK_WINDOW (composer),
+			"/apps/evolution/mail/prompts/send_invalid_recip",
 			strstr (invalid_addrs->str, ", ") ?
 				"mail:ask-send-invalid-recip-multi" :
 				"mail:ask-send-invalid-recip-one",
-			invalid_addrs->str, NULL) == GTK_RESPONSE_CANCEL) {
+			invalid_addrs->str, NULL)) {
 			g_string_free (invalid_addrs, TRUE);
 			goto finished;
 		}
diff --git a/mail/evolution-mail.schemas.in b/mail/evolution-mail.schemas.in
index e6a3daa..3a75ad2 100644
--- a/mail/evolution-mail.schemas.in
+++ b/mail/evolution-mail.schemas.in
@@ -1224,6 +1224,18 @@
       </locale>
     </schema>
 
+    <schema>
+      <key>/schemas/apps/evolution/mail/prompts/send_invalid_recip</key>
+      <applyto>/apps/evolution/mail/prompts/send_invalid_recip</applyto>
+      <owner>evolution-mail</owner>
+      <type>bool</type>
+      <default>true</default>
+      <locale name="C">
+         <short>Prompt before sending to recipients not entered as mail addresses</short>
+         <long>It disables/enables the repeated prompts to warn that you are trying to send a message to recipients not entered as mail addresses</long>
+      </locale>
+    </schema>
+
        <!-- Trash settings -->
 
     <schema>
diff --git a/mail/mail-config.ui b/mail/mail-config.ui
index bfa365e..a38a0bf 100644
--- a/mail/mail-config.ui
+++ b/mail/mail-config.ui
@@ -4487,6 +4487,21 @@ For example: "Work" or "Personal"</property>
                     <property name="position">4</property>
                   </packing>
                 </child>
+                <child>
+                  <object class="GtkCheckButton" id="chkPromptSendInvalidRecip">
+                    <property name="label" translatable="yes" comments="This is in the context of: Ask for confirmation before...">Sending a message with _recipients not entered as mail addresses</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">5</property>
+                  </packing>
+                </child>
               </object>
             </child>
           </object>
diff --git a/modules/mail/e-mail-shell-settings.c b/modules/mail/e-mail-shell-settings.c
index 18e8407..9f02469 100644
--- a/modules/mail/e-mail-shell-settings.c
+++ b/modules/mail/e-mail-shell-settings.c
@@ -289,6 +289,10 @@ e_mail_shell_settings_init (EShellBackend *shell_backend)
 		"/apps/evolution/mail/prompts/empty_subject");
 
 	e_shell_settings_install_property_for_key (
+		"composer-prompt-send-invalid-recip",
+		"/apps/evolution/mail/prompts/send_invalid_recip");
+
+	e_shell_settings_install_property_for_key (
 		"composer-reply-start-bottom",
 		"/apps/evolution/mail/composer/reply_start_bottom");
 
diff --git a/modules/mail/em-composer-prefs.c b/modules/mail/em-composer-prefs.c
index b4d0513..e0dd2f1 100644
--- a/modules/mail/em-composer-prefs.c
+++ b/modules/mail/em-composer-prefs.c
@@ -411,6 +411,13 @@ em_composer_prefs_construct (EMComposerPrefs *prefs,
 		G_BINDING_BIDIRECTIONAL |
 		G_BINDING_SYNC_CREATE);
 
+	widget = e_builder_get_widget (prefs->builder, "chkPromptSendInvalidRecip");
+	g_object_bind_property (
+		shell_settings, "composer-prompt-send-invalid-recip",
+		widget, "active",
+		G_BINDING_BIDIRECTIONAL |
+		G_BINDING_SYNC_CREATE);
+
 	widget = e_builder_get_widget (prefs->builder, "chkAutoSmileys");
 	g_object_bind_property (
 		shell_settings, "composer-magic-smileys",



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