* Removed all help application support (fixes NB#93294).
[modest] / src / hildon2 / modest-connection-specific-smtp-edit-window.c
index 70e7ac1..67aea73 100644 (file)
@@ -171,9 +171,9 @@ on_range_error (GtkWidget *widget, HildonNumberEditorErrorType type, gpointer us
        priv->range_error_occured = TRUE;
 
        if (type == HILDON_NUMBER_EDITOR_ERROR_MAXIMUM_VALUE_EXCEED) {
-               msg = g_strdup (_HL("ckct_ib_maximum_value"));
+               msg = g_strdup_printf (dgettext ("hildon-libs", "ckct_ib_maximum_value"), 65535);
        } else if (type == HILDON_NUMBER_EDITOR_ERROR_MINIMUM_VALUE_EXCEED) {
-               msg = g_strdup (_HL("ckct_ib_minimum_value"));
+               msg = g_strdup_printf (dgettext ("hildon-libs", "ckct_ib_minimum_value"), 1);
        } else {
                msg = g_strdup_printf (_HL("ckct_ib_set_a_value_within_range"), PORT_RANGE_MIN, PORT_RANGE_MAX);
        }
@@ -254,10 +254,35 @@ on_security_picker_changed (HildonPickerButton *widget, gpointer user_data)
        if(port_number != 0) {
                hildon_number_editor_set_value (
                        HILDON_NUMBER_EDITOR (priv->entry_port), port_number);
-       }               
+       }
 }
 
 static void
+on_auth_picker_changed (HildonPickerButton *widget, gpointer user_data)
+{
+       ModestConnectionSpecificSmtpEditWindow *self = 
+               MODEST_CONNECTION_SPECIFIC_SMTP_EDIT_WINDOW (user_data);
+       ModestConnectionSpecificSmtpEditWindowPrivate *priv = 
+               CONNECTION_SPECIFIC_SMTP_EDIT_WINDOW_GET_PRIVATE (self);
+       ModestProtocolType auth_proto;
+       
+       on_change (GTK_WIDGET(widget), self);
+
+       /* Enable/disable username and password fields */
+       auth_proto = 
+               modest_secureauth_picker_get_active_secureauth (MODEST_SECUREAUTH_PICKER (priv->outgoing_auth_picker));
+
+       if (auth_proto == modest_protocol_registry_get_none_auth_type_id ()) {
+               gtk_widget_set_sensitive (priv->entry_user_username, FALSE);
+               gtk_widget_set_sensitive (priv->entry_user_password, FALSE);
+       } else {
+               gtk_widget_set_sensitive (priv->entry_user_username, TRUE);
+               gtk_widget_set_sensitive (priv->entry_user_password, TRUE);
+       }
+}
+
+
+static void
 modest_connection_specific_smtp_edit_window_init (ModestConnectionSpecificSmtpEditWindow *self)
 {
        ModestConnectionSpecificSmtpEditWindowPrivate *priv; 
@@ -304,7 +329,7 @@ modest_connection_specific_smtp_edit_window_init (ModestConnectionSpecificSmtpEd
        modest_maemo_utils_set_hbutton_layout (title_sizegroup, value_sizegroup,
                                               _("mcen_li_emailsetup_secure_authentication"),
                                               priv->outgoing_auth_picker);
-       g_signal_connect (G_OBJECT (priv->outgoing_auth_picker), "value-changed", G_CALLBACK(on_change), self);
+       g_signal_connect (G_OBJECT (priv->outgoing_auth_picker), "value-changed", (GCallback)on_auth_picker_changed, self);
        gtk_widget_show (priv->outgoing_auth_picker);
        gtk_box_pack_start (GTK_BOX (vbox), priv->outgoing_auth_picker, FALSE, FALSE, MODEST_MARGIN_HALF);
        
@@ -372,7 +397,6 @@ modest_connection_specific_smtp_edit_window_init (ModestConnectionSpecificSmtpEd
        
        /* Show a default port number when the security method changes, as per the UI spec: */
        g_signal_connect (G_OBJECT (priv->outgoing_security_picker), "value-changed", (GCallback)on_security_picker_changed, self);
-       on_security_picker_changed (HILDON_PICKER_BUTTON (priv->outgoing_security_picker), self);
        
        /* Add the buttons: */
        gtk_dialog_add_button (GTK_DIALOG (self), _HL("wdgt_bd_save"), GTK_RESPONSE_OK);
@@ -400,9 +424,9 @@ modest_connection_specific_smtp_edit_window_init (ModestConnectionSpecificSmtpEd
        modest_window_mgr_prevent_hibernation_while_window_is_shown (
                modest_runtime_get_window_mgr (), GTK_WINDOW (self)); 
        
-       hildon_help_dialog_help_enable (GTK_DIALOG(self),
-                                       "applications_email_connectionspecificsmtpconf",
-                                       modest_maemo_utils_get_osso_context());
+       /* Refresh view with current settings */
+       on_auth_picker_changed (HILDON_PICKER_BUTTON (priv->outgoing_auth_picker), self);
+       on_security_picker_changed (HILDON_PICKER_BUTTON (priv->outgoing_security_picker), self);
 }
 
 ModestConnectionSpecificSmtpEditWindow*