MODEL_COL_SERVER_ACCOUNT_NAME, &server_account_name,
MODEL_COL_SERVER_ACCOUNT_SETTINGS, &server_settings,
-1);
-
- /* printf("DEBUG: %s: BEFORE: connection-specific server_account_name=%s\n", __FUNCTION__, server_account_name); */
- /* TODO: Is 0 an allowed libconic IAP ID?
- * If not then we should check for it. */
-
+
/* Get existing server account data if a server account is already specified: */
gboolean settings_were_retrieved = FALSE;
if (server_account_name && !server_settings) {
if (server_settings)
settings_were_retrieved = TRUE;
}
-
+
GtkWidget * window = GTK_WIDGET (modest_connection_specific_smtp_edit_window_new ());
modest_connection_specific_smtp_edit_window_set_connection (
MODEST_CONNECTION_SPECIFIC_SMTP_EDIT_WINDOW (window), id, connection_name, server_settings);
-
+
/* Delete data, unless it was data from the rowmodel: */
if (settings_were_retrieved) {
g_object_unref (server_settings);
server_settings = NULL;
}
-
+
modest_window_mgr_set_modal (modest_runtime_get_window_mgr (), GTK_WINDOW (window), GTK_WINDOW (self));
-
+
gint response = gtk_dialog_run (GTK_DIALOG (window));
if (response == GTK_RESPONSE_OK) {
g_object_unref (server_settings);
server_settings = 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(). */
server_settings = modest_connection_specific_smtp_edit_window_get_settings (
MODEST_CONNECTION_SPECIFIC_SMTP_EDIT_WINDOW (window));
-
+
if (server_settings) {
gtk_list_store_set (GTK_LIST_STORE (priv->model), &iter,
MODEL_COL_SERVER_ACCOUNT_SETTINGS, server_settings,
ModestAccountMgr *mgr = modest_runtime_get_account_mgr ();
ModestConnectionSpecificSmtpWindowPrivate *priv =
CONNECTION_SPECIFIC_SMTP_WINDOW_GET_PRIVATE (self);
-
-
+
+
/* Get the first iter in the list */
GtkTreeIter iter;
gboolean valid = gtk_tree_model_get_iter_first (priv->model, &iter);
gchar *server_account_name = NULL;
gchar *server_name = NULL;
ModestServerAccountSettings *server_settings = NULL;
-
+
gtk_tree_model_get (priv->model, &iter,
MODEL_COL_ID, &id,
MODEL_COL_NAME, &connection_name,
MODEL_COL_SERVER_ACCOUNT_NAME, &server_account_name,
MODEL_COL_SERVER_ACCOUNT_SETTINGS, &server_settings,
-1);
-
- gboolean success = TRUE;
+
+ gboolean success = TRUE;
if (id && server_settings) { /* The presence of data suggests that there is something to save. */
if (!server_account_name) {
/* Add a new server account, building a (non-human-visible) name: */
MODEL_COL_SERVER_ACCOUNT_NAME, server_account_name, -1);
} else {
+ /* If the account already exists then update it and notify */
modest_account_mgr_save_server_settings (mgr, server_settings);
}
} else if (id && server_name &&
if (!server_account_name) {
return NULL; /* No connection-specific SMTP server was specified for this connection. */
}
-
+
TnyAccount* account = modest_tny_account_store_get_tny_account_by (self,
MODEST_TNY_ACCOUNT_STORE_QUERY_ID,
server_account_name);
/* printf ("DEBUG: %s: account=%p\n", __FUNCTION__, account); */
- g_free (server_account_name);
+ g_free (server_account_name);
/* Unref the get()ed object, as required by the tny_maemo_conic_device_get_iap() documentation. */
g_object_unref (connection);
-
+
return account;
#else
return NULL; /* TODO: Implement this for GNOME, instead of just Maemo? */
}
-void
+void
modest_ui_actions_on_send_queue_error_happened (TnySendQueue *self,
TnyHeader *header,
TnyMsg *msg,
/* Get the server name: */
- server_account =
+ server_account =
TNY_TRANSPORT_ACCOUNT (tny_camel_send_queue_get_transport_account (TNY_CAMEL_SEND_QUEUE (self)));
if (server_account)
- server_name = tny_account_get_hostname (TNY_ACCOUNT (server_account));
+ server_name = tny_account_get_hostname (TNY_ACCOUNT (server_account));
else
g_return_if_reached ();
g_warning ("%s: unexpected ERROR %d",
__FUNCTION__, err->code);
message = g_strdup (_CS("sfil_ib_unable_to_send"));
- break;
+ break;
}
modest_platform_run_information_dialog (NULL, message, FALSE);