Re: [evolution-patches] patch to fix disabled "Next" (Mail)



hi,

Here is the updated patch.
Just moved 'prepare' part up before we validate it. So that we do not
have to explicitly set it as TRUE, and ensures that it works in all the
cases.

Thanks,
Vivek Jain
On Fri, 2005-08-12 at 04:27 +0000, Vivek Jain  wrote:
> hi,
> 
> The attached patch fixes the ugly bug of "Next" not getting enabled on
> Account Management page while creating an account.
> 
> The problem I found was:
> First time when check_complete is called the page is incomplete so 'ok'
> is FALSE. In the same code flow (1), we prepare the page and set the
> default entry in the entry box. This in turn calls another
> check_complete which returns status ok 'TRUE' and the 'next' gets
> enabled.
> But finally (1) returns the old 'ok' status which was FALSE and the
> button is again disabled.
> 
> The fix just makes sure that after we have prepared the management page
> (have put the proper entry) we consider that as complete, which is TRUE,
> and have 'ok' as TRUE.
> 
> Thanks,
> Vivek Jain
> 
> PS: I still have to find the bug number for it.
> 
Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution/mail/ChangeLog,v
retrieving revision 1.3690
diff -u -p -r1.3690 ChangeLog
--- ChangeLog	11 Aug 2005 06:11:04 -0000	1.3690
+++ ChangeLog	12 Aug 2005 07:29:21 -0000
@@ -1,3 +1,9 @@
+2005-08-12  Vivek Jain <jvivek novell com>
+
+	* em-account-editor.c : (emae_check_complete)
+	first prepare the page and then validate
+	**Fixes #273842
+
 2005-08-11  Vivek Jain <jvivek novell com>
 	
 	* em-folder-tree-model.c: (account_changed)
Index: em-account-editor.c
===================================================================
RCS file: /cvs/gnome/evolution/mail/em-account-editor.c,v
retrieving revision 1.33
diff -u -p -r1.33 em-account-editor.c
--- em-account-editor.c	8 Aug 2005 09:02:25 -0000	1.33
+++ em-account-editor.c	12 Aug 2005 07:29:22 -0000
@@ -2414,40 +2414,6 @@ emae_check_complete(EConfig *ec, const c
 	const char *tmp;
 	EAccount *ea;
 
-	if (pageid == NULL || !strcmp(pageid, "00.identity")) {
-		/* TODO: check the account name is set, and unique in the account list */
-		ok = (tmp = e_account_get_string(emae->account, E_ACCOUNT_ID_NAME))
-			&& tmp[0]
-			&& (tmp = e_account_get_string(emae->account, E_ACCOUNT_ID_ADDRESS))
-			&& is_email(tmp)
-			&& ((tmp = e_account_get_string(emae->account, E_ACCOUNT_ID_REPLY_TO)) == NULL
-			    || tmp[0] == 0
-			    || is_email(tmp));
-		if (!ok)
-			d(printf("identity incomplete\n"));
-	}
-
-	if (ok && (pageid == NULL || !strcmp(pageid, "10.receive"))) {
-		ok = emae_service_complete(emae, &emae->priv->source);
-		if (!ok)
-			d(printf("receive page incomplete\n"));
-	}
-
-	if (ok && (pageid == NULL || !strcmp(pageid, "30.send"))) {
-		ok = emae_service_complete(emae, &emae->priv->transport);
-		if (!ok)
-			d(printf("send page incomplete\n"));
-	}
-
-	if (ok && (pageid == NULL || !strcmp(pageid, "40.management"))) {
-		ok = (tmp = e_account_get_string(emae->account, E_ACCOUNT_NAME))
-			&& tmp[0]
-			&& ((ea = mail_config_get_account_by_name(tmp)) == NULL
-			    || ea == emae->original);
-		if (!ok)
-			d(printf("management page incomplete\n"));
-	}
-
 	/* We use the page-check of various pages to 'prepare' or
 	   pre-load their values, only in the druid */
 	if (pageid
@@ -2498,6 +2464,40 @@ emae_check_complete(EConfig *ec, const c
 				gtk_entry_set_text(emae->priv->identity_entries[0], template);
 			}
 		}
+	}
+
+	if (pageid == NULL || !strcmp(pageid, "00.identity")) {
+		/* TODO: check the account name is set, and unique in the account list */
+		ok = (tmp = e_account_get_string(emae->account, E_ACCOUNT_ID_NAME))
+			&& tmp[0]
+			&& (tmp = e_account_get_string(emae->account, E_ACCOUNT_ID_ADDRESS))
+			&& is_email(tmp)
+			&& ((tmp = e_account_get_string(emae->account, E_ACCOUNT_ID_REPLY_TO)) == NULL
+			    || tmp[0] == 0
+			    || is_email(tmp));
+		if (!ok)
+			d(printf("identity incomplete\n"));
+	}
+
+	if (ok && (pageid == NULL || !strcmp(pageid, "10.receive"))) {
+		ok = emae_service_complete(emae, &emae->priv->source);
+		if (!ok)
+			d(printf("receive page incomplete\n"));
+	}
+
+	if (ok && (pageid == NULL || !strcmp(pageid, "30.send"))) {
+		ok = emae_service_complete(emae, &emae->priv->transport);
+		if (!ok)
+			d(printf("send page incomplete\n"));
+	}
+
+	if (ok && (pageid == NULL || !strcmp(pageid, "40.management"))) {
+		ok = (tmp = e_account_get_string(emae->account, E_ACCOUNT_NAME))
+			&& tmp[0]
+			&& ((ea = mail_config_get_account_by_name(tmp)) == NULL
+			    || ea == emae->original);
+		if (!ok)
+			d(printf("management page incomplete\n"));
 	}
 
 	return ok;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]