[evolution] SMTP part of a new mail account dialog doesn't update UI properly



commit e837eb24ea6ae6bcd4d9fc3d6aaa852fe7112fff
Author: Milan Crha <mcrha redhat com>
Date:   Tue Jul 8 11:32:27 2014 +0200

    SMTP part of a new mail account dialog doesn't update UI properly
    
    Using "Server requires authentication" checkbox doesn't update
    the new mail account dialog properly, thus it seems like a username
    is required when the server does not require authentication. It's due
    to the dialog being updated properly only on CamelSettings changes,
    while this checkbox doesn't have any direct connection to any
    CamelSettings property.

 modules/mail-config/e-mail-config-smtp-backend.c |   16 ++++++++++++++++
 1 files changed, 16 insertions(+), 0 deletions(-)
---
diff --git a/modules/mail-config/e-mail-config-smtp-backend.c 
b/modules/mail-config/e-mail-config-smtp-backend.c
index 368ffd8..8c1d8dc 100644
--- a/modules/mail-config/e-mail-config-smtp-backend.c
+++ b/modules/mail-config/e-mail-config-smtp-backend.c
@@ -24,6 +24,7 @@
 #include <libebackend/libebackend.h>
 
 #include <mail/e-mail-config-auth-check.h>
+#include <mail/e-mail-config-page.h>
 #include <mail/e-mail-config-service-page.h>
 
 #define E_MAIL_CONFIG_SMTP_BACKEND_GET_PRIVATE(obj) \
@@ -45,6 +46,18 @@ G_DEFINE_DYNAMIC_TYPE (
        E_TYPE_MAIL_CONFIG_SERVICE_BACKEND)
 
 static void
+server_requires_auth_toggled_cb (GtkToggleButton *toggle,
+                                EMailConfigServiceBackend *backend)
+{
+       EMailConfigServicePage *page;
+
+       g_return_if_fail (E_IS_MAIL_CONFIG_SERVICE_BACKEND (backend));
+
+       page = e_mail_config_service_backend_get_page (backend);
+       e_mail_config_page_changed (E_MAIL_CONFIG_PAGE (page));
+}
+
+static void
 mail_config_smtp_backend_insert_widgets (EMailConfigServiceBackend *backend,
                                          GtkBox *parent)
 {
@@ -125,6 +138,9 @@ mail_config_smtp_backend_insert_widgets (EMailConfigServiceBackend *backend,
        priv->auth_required_toggle = widget;  /* do not reference */
        gtk_widget_show (widget);
 
+       g_signal_connect_object (widget, "toggled",
+               G_CALLBACK (server_requires_auth_toggled_cb), backend, 0);
+
        text = _("Security");
        markup = g_markup_printf_escaped ("<b>%s</b>", text);
        widget = gtk_label_new (markup);


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