aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChenthill Palanisamy <pchenthill@novell.com>2010-06-30 18:52:26 +0800
committerChenthill Palanisamy <pchenthill@novell.com>2010-06-30 18:54:01 +0800
commitea49fac12e759170cdabd0673b3c0e1861ee7d3f (patch)
tree58e8a76bd68f0486472901e9637a3c965529bdfe
parented144aaf1b82440dbff01e461520132046299565 (diff)
downloadgsoc2013-evolution-ea49fac12e759170cdabd0673b3c0e1861ee7d3f.tar
gsoc2013-evolution-ea49fac12e759170cdabd0673b3c0e1861ee7d3f.tar.gz
gsoc2013-evolution-ea49fac12e759170cdabd0673b3c0e1861ee7d3f.tar.bz2
gsoc2013-evolution-ea49fac12e759170cdabd0673b3c0e1861ee7d3f.tar.lz
gsoc2013-evolution-ea49fac12e759170cdabd0673b3c0e1861ee7d3f.tar.xz
gsoc2013-evolution-ea49fac12e759170cdabd0673b3c0e1861ee7d3f.tar.zst
gsoc2013-evolution-ea49fac12e759170cdabd0673b3c0e1861ee7d3f.zip
Bug 623201 - Set default options automatically while creating a new account
-rw-r--r--mail/em-account-editor.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/mail/em-account-editor.c b/mail/em-account-editor.c
index 02cadc9aa2..603aa529a4 100644
--- a/mail/em-account-editor.c
+++ b/mail/em-account-editor.c
@@ -143,6 +143,7 @@ struct _EMAccountEditorPrivate {
EAccount *modified_account;
EAccount *original_account;
+ gboolean new_account;
struct _EMConfig *config;
GList *providers;
@@ -248,6 +249,7 @@ emae_set_original_account (EMAccountEditor *emae,
} else {
modified_account = e_account_new ();
modified_account->enabled = TRUE;
+ emae->priv->new_account = TRUE;
e_account_set_string (
modified_account, E_ACCOUNT_DRAFTS_FOLDER_URI,
@@ -2284,7 +2286,9 @@ emae_option_toggle (EMAccountEditorService *service, CamelURL *url, const gchar
{
GtkWidget *w;
- /* FIXME: how do we get the default value ever? */
+ if (service->emae->priv->new_account && def)
+ camel_url_set_param (url, name, "");
+
w = gtk_check_button_new_with_mnemonic (text);
g_object_set_data ((GObject *)w, "option-name", (gpointer)name);
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (w), camel_url_get_param (url, name) != NULL);
@@ -2389,6 +2393,13 @@ emae_option_checkspin (EMAccountEditorService *service, CamelURL *url, const gch
max = 1.0;
}
+ if (service->emae->priv->new_account && on == 'y') {
+ gchar value[16];
+
+ sprintf (value, "%d", (gint) def);
+ camel_url_set_param (url, name, value);
+ }
+
if ((enable = (val = camel_url_get_param (url, name)) != NULL) )
def = strtod (val, NULL);
else