From: Alberto Garcia Date: Fri, 17 Aug 2007 12:51:13 +0000 (+0000) Subject: * src/modest-defs.h: X-Git-Tag: git_migration_finished~2571 X-Git-Url: http://git.maemo.org/git/?p=modest;a=commitdiff_plain;h=fec75f1299dd791ff3f61a00035c022d96abbd07 * src/modest-defs.h: New gconf key: "use_specific_smtp" * src/modest-account-mgr-helpers.h * src/modest-account-mgr-helpers.c (modest_account_mgr_get_has_connection_specific_smtp): removed (modest_account_mgr_get_use_connection_specific_smtp): (modest_account_mgr_set_use_connection_specific_smtp): New functions to set and get the state of the use_specific_smtp gconf key * src/maemo/easysetup/modest-easysetup-wizard.c (create_account): Save the actual state of the "Use connection-specific SMTP servers" checkbox in gconf * src/maemo/modest-account-settings-dialog.c (modest_account_settings_dialog_set_account_name): (save_configuration): Save and restore the actual state of the "Use connection-specific SMTP server" checkbox in gconf Fixes NB#65993 pmo-trunk-r3009 --- diff --git a/src/maemo/easysetup/modest-easysetup-wizard.c b/src/maemo/easysetup/modest-easysetup-wizard.c index 4be58b7..c00ffe3 100644 --- a/src/maemo/easysetup/modest-easysetup-wizard.c +++ b/src/maemo/easysetup/modest-easysetup-wizard.c @@ -1815,6 +1815,8 @@ create_account (ModestEasysetupWizardDialog *self, gboolean enabled) 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 ( diff --git a/src/maemo/modest-account-settings-dialog.c b/src/maemo/modest-account-settings-dialog.c index 34f183f..0148e33 100644 --- a/src/maemo/modest-account-settings-dialog.c +++ b/src/maemo/modest-account-settings-dialog.c @@ -1368,7 +1368,7 @@ void modest_account_settings_dialog_set_account_name (ModestAccountSettingsDialo } 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 ( @@ -1560,6 +1560,8 @@ save_configuration (ModestAccountSettingsDialog *dialog) 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); diff --git a/src/modest-account-mgr-helpers.c b/src/modest-account-mgr-helpers.c index 2bd6b3e..73362c4 100644 --- a/src/modest-account-mgr-helpers.c +++ b/src/modest-account-mgr-helpers.c @@ -160,18 +160,17 @@ gboolean modest_account_mgr_remove_connection_specific_smtp (ModestAccountMgr *s 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); } /** diff --git a/src/modest-account-mgr-helpers.h b/src/modest-account-mgr-helpers.h index 5143220..ef57144 100644 --- a/src/modest-account-mgr-helpers.h +++ b/src/modest-account-mgr-helpers.h @@ -243,12 +243,22 @@ gboolean modest_account_mgr_remove_connection_specific_smtp (ModestAccountMgr *s 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 diff --git a/src/modest-defs.h b/src/modest-defs.h index 078d7e4..b92e781 100644 --- a/src/modest-defs.h +++ b/src/modest-defs.h @@ -123,6 +123,7 @@ * 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 */