MODEST_ACCOUNT_RETRIEVE, retrieve, FALSE /* not server account */);
/* Save the connection-specific SMTP server accounts. */
+ modest_account_mgr_set_use_connection_specific_smtp(self->account_manager, account_name,
+ gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(self->checkbox_outgoing_smtp_specific)));
gboolean result = TRUE;
if (self->specific_window)
result = modest_connection_specific_smtp_window_save_server_accounts (
}
const gboolean has_specific =
- modest_account_mgr_get_has_connection_specific_smtp (
+ modest_account_mgr_get_use_connection_specific_smtp (
dialog->account_manager,
account_name);
gtk_toggle_button_set_active (
account_title = NULL;
/* Save connection-specific SMTP server accounts: */
+ modest_account_mgr_set_use_connection_specific_smtp(dialog->account_manager, account_name,
+ gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(dialog->checkbox_outgoing_smtp_specific)));
if (dialog->specific_window) {
return modest_connection_specific_smtp_window_save_server_accounts (
MODEST_CONNECTION_SPECIFIC_SMTP_WINDOW (dialog->specific_window), account_name);
return TRUE;
}
-gboolean modest_account_mgr_get_has_connection_specific_smtp (ModestAccountMgr *self, const gchar* account_name)
+gboolean modest_account_mgr_get_use_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;
+ return modest_account_mgr_get_bool (self, account_name,
+ MODEST_ACCOUNT_USE_CONNECTION_SPECIFIC_SMTP, FALSE);
+}
+
+gboolean modest_account_mgr_set_use_connection_specific_smtp (ModestAccountMgr *self, const gchar* account_name,
+ gboolean new_value)
+{
+ return modest_account_mgr_set_bool (self, account_name, MODEST_ACCOUNT_USE_CONNECTION_SPECIFIC_SMTP,
+ new_value, FALSE);
}
/**
const gchar* connection_name);
/**
- * modest_account_mgr_get_has_connection_specific_smtp
+ * modest_account_mgr_get_use_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);
+ * @account_name: the account name
+ * @result: Whether this account should use connection-specific smtp server accounts.
+ */
+gboolean modest_account_mgr_get_use_connection_specific_smtp (ModestAccountMgr *self, const gchar* account_name);
+
+/**
+ * modest_account_mgr_set_use_connection_specific_smtp
+ * @self: a ModestAccountMgr instance
+ * @account_name: the account name
+ * @new_value: New value that indicates if if this account should use connection-specific smtp server accounts
+ * @result: TRUE if it succeeded, FALSE otherwise
+ */
+gboolean modest_account_mgr_set_use_connection_specific_smtp (ModestAccountMgr *self, const gchar* account_name,
+ gboolean new_value);
/**
* modest_account_mgr_get_connection_specific_smtp
* That's not pretty, but it's nicer than dealing with escaping of a = separator if
* putting them both in one string. */
#define MODEST_ACCOUNT_CONNECTION_SPECIFIC_SMTP_LIST "specific_smtp"
+#define MODEST_ACCOUNT_USE_CONNECTION_SPECIFIC_SMTP "use_specific_smtp" /* boolean */
/* server account keys */
#define MODEST_ACCOUNT_PASSWORD "password" /* string */