* src/modest-defs.h:
authorAlberto Garcia <agarcia@igalia.com>
Fri, 17 Aug 2007 12:51:13 +0000 (12:51 +0000)
committerAlberto Garcia <agarcia@igalia.com>
Fri, 17 Aug 2007 12:51:13 +0000 (12:51 +0000)
    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

src/maemo/easysetup/modest-easysetup-wizard.c
src/maemo/modest-account-settings-dialog.c
src/modest-account-mgr-helpers.c
src/modest-account-mgr-helpers.h
src/modest-defs.h

index 4be58b7..c00ffe3 100644 (file)
@@ -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_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 (
        gboolean result = TRUE;
        if (self->specific_window)
                result = modest_connection_specific_smtp_window_save_server_accounts (
index 34f183f..0148e33 100644 (file)
@@ -1368,7 +1368,7 @@ void modest_account_settings_dialog_set_account_name (ModestAccountSettingsDialo
                }
                
                const gboolean has_specific = 
                }
                
                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 (
                                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: */
        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);
        if (dialog->specific_window) {
                return modest_connection_specific_smtp_window_save_server_accounts (
                        MODEST_CONNECTION_SPECIFIC_SMTP_WINDOW (dialog->specific_window), account_name);
index 2bd6b3e..73362c4 100644 (file)
@@ -160,18 +160,17 @@ gboolean modest_account_mgr_remove_connection_specific_smtp (ModestAccountMgr *s
        return TRUE;
 }
 
        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);
 }
 
 /**
 }
 
 /**
index 5143220..ef57144 100644 (file)
@@ -243,12 +243,22 @@ gboolean modest_account_mgr_remove_connection_specific_smtp (ModestAccountMgr *s
                                         const gchar* connection_name);
 
 /**
                                         const gchar* connection_name);
 
 /**
- * modest_account_mgr_get_has_connection_specific_smtp
+ * modest_account_mgr_get_use_connection_specific_smtp
  * @self: a ModestAccountMgr instance
  * @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
 
 /**
  * modest_account_mgr_get_connection_specific_smtp
index 078d7e4..b92e781 100644 (file)
  * 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"
  * 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 */
 
 /* server account keys */
 #define MODEST_ACCOUNT_PASSWORD          "password"          /* string */