[balsa] Disable widgets when building --without-ssl



commit 3ec15112c46e305f2592560f2f55bfe7f024e643
Author: Peter Bloomfield <PeterBloomfield bellsouth net>
Date:   Wed Jul 28 22:33:16 2010 -0400

    Disable widgets when building --without-ssl
    
    	* src/mailbox-conf.c (balsa_server_conf_get_advanced_widget):
    	disable SSL and TLS widgets when building --without-ssl.

 ChangeLog          |    5 +++++
 src/mailbox-conf.c |   23 +++++++++++++++++++----
 2 files changed, 24 insertions(+), 4 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 50c7979..ba4d7d2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2010-07-28  Peter Bloomfield
+
+	* src/mailbox-conf.c (balsa_server_conf_get_advanced_widget):
+	disable SSL and TLS widgets when building --without-ssl.
+
 2010-07-25  Pawel Salek
 
 	* libbalsa/imap/imap-handle.c: work around buggy Gmail.
diff --git a/src/mailbox-conf.c b/src/mailbox-conf.c
index 500ee45..69615d0 100644
--- a/src/mailbox-conf.c
+++ b/src/mailbox-conf.c
@@ -207,14 +207,22 @@ balsa_server_conf_get_advanced_widget(BalsaServerConf *bsc, LibBalsaServer *s,
         { N_("Required"),    LIBBALSA_TLS_REQUIRED }
     };
     GtkWidget *label;
-    GtkWidget *hbox;
+    GtkWidget *box;
     gboolean use_ssl = s && s->use_ssl;
 
-    hbox = gtk_hbox_new(FALSE, 0);
+    box = gtk_vbox_new(FALSE, 0);
+
+#if !defined(USE_SSL)
+    gtk_box_pack_start(GTK_BOX(box),
+                       gtk_label_new
+                       (_("Balsa was built without SSL support.\n"
+                          "Neither SSL nor TLS can be used.")),
+                       FALSE, FALSE, 0);
+#endif                          /* !defined(USE_SSL) */
 
     bsc->table = GTK_TABLE(libbalsa_create_table(3 + extra_rows, 2));
     gtk_container_set_border_width(GTK_CONTAINER(bsc->table), 12);
-    gtk_box_pack_start(GTK_BOX(hbox), GTK_WIDGET(bsc->table),
+    gtk_box_pack_start(GTK_BOX(box), GTK_WIDGET(bsc->table),
                        FALSE, FALSE, 0);
 
     bsc->used_rows = 0;
@@ -222,6 +230,9 @@ balsa_server_conf_get_advanced_widget(BalsaServerConf *bsc, LibBalsaServer *s,
     bsc->use_ssl = balsa_server_conf_add_checkbox(bsc, _("Use _SSL"));
     if(use_ssl)
 	gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(bsc->use_ssl), TRUE);
+#if !defined(USE_SSL)
+    gtk_widget_set_sensitive(bsc->use_ssl, FALSE);
+#endif                          /* !defined(USE_SSL) */
 
     label = libbalsa_create_label(_("Use _TLS:"), GTK_WIDGET(bsc->table), 1);
 
@@ -239,8 +250,12 @@ balsa_server_conf_get_advanced_widget(BalsaServerConf *bsc, LibBalsaServer *s,
     gtk_widget_show_all(GTK_WIDGET(bsc->table));
     bsc->used_rows = 2;
     gtk_widget_set_sensitive(bsc->tls_option, !use_ssl);
+#if !defined(USE_TLS)
+    gtk_widget_set_sensitive(label, FALSE);
+    gtk_widget_set_sensitive(bsc->tls_option, FALSE);
+#endif                          /* !defined(USE_TLS) */
 
-    return hbox;
+    return box;
 }
 
 GtkWidget*



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