store_settings = modest_account_settings_get_store_settings (self->settings);
- transport_settings = modest_account_settings_get_store_settings (self->settings);
+ transport_settings = modest_account_settings_get_transport_settings (self->settings);
store_account_name = modest_server_account_settings_get_account_name (store_settings);
transport_account_name = modest_server_account_settings_get_account_name (transport_settings);
enable_buttons (ModestAccountSettingsDialog *self)
{
gboolean enable_ok = TRUE;
+ ModestAuthProtocol outgoing_auth_protocol;
/* The account details title is mandatory: */
if (entry_is_empty(self->entry_account_title))
- enable_ok = FALSE;
+ enable_ok = FALSE;
/* The user details username is mandatory: */
- if (entry_is_empty(self->entry_user_username))
+ if (enable_ok && entry_is_empty(self->entry_user_username))
enable_ok = FALSE;
/* The user details email address is mandatory: */
enable_ok = FALSE;
/* The custom incoming server is mandatory: */
- if (entry_is_empty(self->entry_incomingserver))
+ if (enable_ok && entry_is_empty(self->entry_incomingserver))
+ enable_ok = FALSE;
+
+ /* The custom incoming server is mandatory: */
+ if (enable_ok && entry_is_empty(self->entry_outgoingserver))
enable_ok = FALSE;
+
+ /* Outgoing username is mandatory if outgoing auth is secure */
+ if (self->combo_outgoing_auth) {
+ outgoing_auth_protocol = modest_secureauth_combo_box_get_active_secureauth (
+ MODEST_SECUREAUTH_COMBO_BOX (self->combo_outgoing_auth));
+ if (enable_ok &&
+ outgoing_auth_protocol != MODEST_PROTOCOL_AUTH_NONE &&
+ entry_is_empty (self->entry_outgoing_username))
+ enable_ok = FALSE;
+ }
/* Enable the buttons,
* identifying them via their associated response codes:
*/
GtkDialog *dialog_base = GTK_DIALOG (self);
- gtk_dialog_set_response_sensitive (dialog_base,
- GTK_RESPONSE_OK,
- enable_ok);
+ gtk_dialog_set_response_sensitive (dialog_base,
+ GTK_RESPONSE_OK,
+ enable_ok);
}
static void