+ gboolean dialog_finished = FALSE;
+ while (!dialog_finished)
+ {
+ gint response = gtk_dialog_run (GTK_DIALOG (window));
+ if (response == GTK_RESPONSE_OK) {
+ gtk_widget_hide (window);
+ dialog_finished = TRUE;
+ /* Delete any previous data for this row: */
+ if (data)
+ {
+ modest_account_mgr_free_server_account_data (priv->account_manager, data);
+ data = NULL;
+ }
+
+ /* Get the new account data and save it in the row for later:
+ * We free this in finalize(),
+ * and save it to our configuration in
+ * modest_connection_specific_smtp_window_save_server_accounts(). */
+ data = modest_connection_specific_smtp_edit_window_get_settings (
+ MODEST_CONNECTION_SPECIFIC_SMTP_EDIT_WINDOW (window),
+ priv->account_manager);
+
+ const gchar* server_name = data ? data->hostname : NULL;
+ gtk_list_store_set (GTK_LIST_STORE (priv->model), &iter,
+ MODEL_COL_SERVER_ACCOUNT_DATA, data,
+ MODEL_COL_SERVER_NAME, server_name,
+ -1);
+ }
+ else