+ /* Create the account, which will contain the two "server accounts": */
+ created = modest_account_mgr_add_account (self->account_manager, account_name,
+ store_name, /* The name of our POP/IMAP server account. */
+ transport_name /* The name of our SMTP server account. */);
+ g_free (store_name);
+ g_free (transport_name);
+
+ if (!created) {
+ /* TODO: Provide a Logical ID for the text: */
+ show_error (GTK_WINDOW (self), _("An error occurred while creating the account."));
+ return FALSE;
+ }
+
+ /* The user name and email address must be set additionally: */
+ const gchar* user_name = gtk_entry_get_text (GTK_ENTRY (self->entry_user_name));
+ modest_account_mgr_set_string (self->account_manager, account_name,
+ MODEST_ACCOUNT_FULLNAME, user_name, FALSE /* not server account */);
+
+ const gchar* emailaddress = gtk_entry_get_text (GTK_ENTRY (self->entry_user_email));
+ modest_account_mgr_set_string (self->account_manager, account_name,
+ MODEST_ACCOUNT_EMAIL, emailaddress, FALSE /* not server account */);
+
+ /* Set the display name: */
+ modest_account_mgr_set_string (self->account_manager, account_name,
+ MODEST_ACCOUNT_DISPLAY_NAME, display_name, FALSE /* not server account */);
+
+ /* Save the connection-specific SMTP server accounts. */
+ if (self->specific_window)
+ return modest_connection_specific_smtp_window_save_server_accounts (
+ MODEST_CONNECTION_SPECIFIC_SMTP_WINDOW (self->specific_window), account_name);
+
+ g_free (account_name);
+