[geary/wip/imap-creds-721964] Only allow one check box at a time



commit 80dfd2d7b94f334c62c8a4cebcc009cab1c4e388
Author: Charles Lindsay <chaz yorba org>
Date:   Thu Feb 27 12:20:42 2014 -0800

    Only allow one check box at a time

 src/client/accounts/add-edit-page.vala |   11 ++++++++---
 1 files changed, 8 insertions(+), 3 deletions(-)
---
diff --git a/src/client/accounts/add-edit-page.vala b/src/client/accounts/add-edit-page.vala
index 69f9957..f47dff7 100644
--- a/src/client/accounts/add-edit-page.vala
+++ b/src/client/accounts/add-edit-page.vala
@@ -277,8 +277,8 @@ public class AddEditPage : Gtk.Box {
         combo_imap_encryption.changed.connect(on_imap_encryption_changed);
         combo_smtp_encryption.changed.connect(on_smtp_encryption_changed);
         
-        check_smtp_use_imap_credentials.toggled.connect(on_smtp_auth_changed);
-        check_smtp_noauth.toggled.connect(on_smtp_auth_changed);
+        check_smtp_use_imap_credentials.toggled.connect(() => on_smtp_auth_changed(true));
+        check_smtp_noauth.toggled.connect(() => on_smtp_auth_changed(false));
         
         entry_imap_port.insert_text.connect(on_port_insert_text);
         entry_smtp_port.insert_text.connect(on_port_insert_text);
@@ -477,7 +477,12 @@ public class AddEditPage : Gtk.Box {
         edited_smtp_port = false;
     }
     
-    private void on_smtp_auth_changed() {
+    private void on_smtp_auth_changed(bool use_imap_credentials_toggled) {
+        if (use_imap_credentials_toggled && check_smtp_use_imap_credentials.active)
+            check_smtp_noauth.active = false;
+        else if (!use_imap_credentials_toggled && check_smtp_noauth.active)
+            check_smtp_use_imap_credentials.active = false;
+        
         if (check_smtp_use_imap_credentials.active || check_smtp_noauth.active) {
             if (!Geary.String.is_empty_or_whitespace(entry_smtp_username.text))
                 smtp_username_store = entry_smtp_username.text;


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