+2007-05-24 Murray Cumming <murrayc@murrayc.com>
+
+ * src/maemo/modest-account-settings-dialog.c:
+ (modest_account_settings_dialog_set_account_name),
+ Check the connection-specific smtp servers checkbox if there are any.
+
+ * src/maemo/modest-connection-specific-smtp-edit-window.c:
+ (modest_connection_specific_smtp_edit_window_init):
+ Start with a suitable port number.
+
+ * src/modest-account-mgr-helpers.h:
+ * src/modest-account-mgr-helpers.c: Added
+ modest_account_mgr_get_has_connection_specific_smtp().
+
+ (modest_account_mgr_set_connection_specific_smtp),
+ (modest_account_mgr_remove_connection_specific_smtp),
+ (modest_account_mgr_get_has_connection_specific_smtp),
+ (modest_account_mgr_get_connection_specific_smtp): Set/Get the list of
+ connection-specific smtp server accounts in the account, rather than
+ the server account conf dir.
+
+ This fixes bug projects.maemo.org bug NB#58263 .
+
+ * src/modest-tny-account-store.c:
+ (create_per_account_local_outbox_folders): Do not call get_server_accounts()
+ if there are no server accounts yet, to prevent an infinite loop when there
+ are no accounts. Document that one must be called before the other.
+
2007-05-24 Murray Cumming <murrayc@murrayc.com>
* src/modest-account-mgr-helpers.c:
hildon_number_editor_set_value (
HILDON_NUMBER_EDITOR (dialog->entry_outgoing_port), port_num);
}
+
+ const gboolean has_specific =
+ modest_account_mgr_get_has_connection_specific_smtp (
+ dialog->account_manager,
+ account_name);
+ gtk_toggle_button_set_active (
+ GTK_TOGGLE_BUTTON (dialog->checkbox_outgoing_smtp_specific),
+ has_specific);
}
/* account_data->is_enabled, */
}
/* Save connection-specific SMTP server accounts: */
- if (dialog->specific_window)
+ if (dialog->specific_window) {
return modest_connection_specific_smtp_window_save_server_accounts (
MODEST_CONNECTION_SPECIFIC_SMTP_WINDOW (dialog->specific_window), account_name);
+ }
else
return TRUE;
}
/* Show a default port number when the security method changes, as per the UI spec: */
g_signal_connect (G_OBJECT (priv->combo_outgoing_security), "changed", (GCallback)on_combo_security_changed, self);
+ on_combo_security_changed (GTK_COMBO_BOX (priv->combo_outgoing_security), self);
/* Add the buttons: */
gtk_dialog_add_button (GTK_DIALOG (self), GTK_STOCK_OK, GTK_RESPONSE_OK);
MODEL_COL_SERVER_ACCOUNT_DATA, &data,
-1);
- printf("DEBUG: %s: BEFORE: connection-specific server_account_name=%s\n", __FUNCTION__, server_account_name);
+ /* 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. */
priv->account_name, connection_name);
server_account_name = modest_account_mgr_get_unused_account_name (
priv->account_manager, name_start, TRUE /* server account. */);
+ g_assert (server_account_name);
g_free (name_start);
success = modest_account_mgr_add_server_account (priv->account_manager,
GSList *list = modest_account_mgr_get_list (self, account_name,
MODEST_ACCOUNT_CONNECTION_SPECIFIC_SMTP_LIST,
- MODEST_CONF_VALUE_STRING, TRUE);
+ MODEST_CONF_VALUE_STRING, FALSE);
/* The server account is in the item after the connection name: */
GSList *list_connection = g_slist_append (list, (gpointer)connection_name);
/* Reset the changed list: */
modest_account_mgr_set_list (self, account_name,
- MODEST_ACCOUNT_CONNECTION_SPECIFIC_SMTP_LIST, list,
- MODEST_CONF_VALUE_STRING, TRUE);
+ MODEST_ACCOUNT_CONNECTION_SPECIFIC_SMTP_LIST, list_connection,
+ MODEST_CONF_VALUE_STRING, FALSE);
/* TODO: Should we free the items too, or just the list? */
g_slist_free (list);
{
GSList *list = modest_account_mgr_get_list (self, account_name,
MODEST_ACCOUNT_CONNECTION_SPECIFIC_SMTP_LIST,
- MODEST_CONF_VALUE_STRING, TRUE);
+ MODEST_CONF_VALUE_STRING, FALSE);
if (!list)
return FALSE;
/* Reset the changed list: */
modest_account_mgr_set_list (self, account_name,
MODEST_ACCOUNT_CONNECTION_SPECIFIC_SMTP_LIST, list,
- MODEST_CONF_VALUE_STRING, TRUE);
+ MODEST_CONF_VALUE_STRING, FALSE);
/* TODO: Should we free the items too, or just the list? */
g_slist_free (list);
return TRUE;
}
+gboolean modest_account_mgr_get_has_connection_specific_smtp (ModestAccountMgr *self, const gchar* account_name)
+{
+ GSList *list = modest_account_mgr_get_list (self, account_name,
+ MODEST_ACCOUNT_CONNECTION_SPECIFIC_SMTP_LIST,
+ MODEST_CONF_VALUE_STRING, FALSE);
+ if (!list)
+ return FALSE;
+
+ /* TODO: Should we free the items too, or just the list? */
+ g_slist_free (list);
+
+ return TRUE;
+}
+
/**
* modest_account_mgr_get_connection_specific_smtp
* @self: a ModestAccountMgr instance
GSList *list = modest_account_mgr_get_list (self, account_name,
MODEST_ACCOUNT_CONNECTION_SPECIFIC_SMTP_LIST,
- MODEST_CONF_VALUE_STRING, TRUE);
+ MODEST_CONF_VALUE_STRING, FALSE);
if (!list)
return NULL;
const gchar* connection_name);
/**
+ * modest_account_mgr_get_has_connection_specific_smtp
+ * @self: a ModestAccountMgr instance
+ * @name: the account name
+ * @result: Whether this account uses any connection-specific smtp server accounts.
+ */
+gboolean modest_account_mgr_get_has_connection_specific_smtp (ModestAccountMgr *self, const gchar* account_name);
+
+/**
* modest_account_mgr_get_connection_specific_smtp
* @self: a ModestAccountMgr instance
* @name: the account name
return;
}
+ /* This transport accounts must be created before calling this function.
+ * Otherwise, we have an infinite loop when there are no accounts. */
+ if (!(priv->transport_accounts))
+ return;
+#if 0
/* Create the transport accounts, if necessary: */
if (!(priv->transport_accounts)) {
get_server_accounts (self, NULL /* TnyList */,
TNY_ACCOUNT_TYPE_TRANSPORT);
}
+#endif
GSList *accounts = NULL;
accounts = g_slist_append (accounts, tny_account); /* cache it */
}
- /* Do this here, in case create_per_account_local_outbox_folders() needs it. */
+ /* Do this here, because create_per_account_local_outbox_folders() needs it. */
if (type == TNY_ACCOUNT_TYPE_TRANSPORT) {
/* Store the cache: */
priv->transport_accounts = accounts;