Bug 216245 Subscribe/account wizard for newsgroups forgets account name. r=mnyromyr,sr=bienvenu for main patch, r/sr=bienvenu for regression fix (included in checkin) a=mscott for both patches

git-svn-id: svn://10.0.0.236/branches/MOZILLA_1_8_BRANCH@194401 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
bugzilla%standard8.demon.co.uk
2006-04-14 08:57:03 +00:00
parent df3ad4363c
commit 794ea02f3d
4 changed files with 36 additions and 18 deletions

View File

@@ -294,12 +294,15 @@ function AccountDataToPageData(accountData, pageData)
setPageData(pageData, "server", "servertype", server.type);
setPageData(pageData, "server", "hostname", server.hostName);
}
setPageData(pageData, "accounttype", "otheraccount", false);
}
setPageData(pageData, "login", "username", server.username);
setPageData(pageData, "login", "password", server.password);
setPageData(pageData, "login", "rememberPassword", server.rememberPassword);
setPageData(pageData, "accname", "prettyName", server.prettyName);
setPageData(pageData, "accname", "userset", false);
setPageData(pageData, "ispdata", "supplied", false);
var identity;
@@ -628,7 +631,7 @@ function setupCopiesAndFoldersServer(account, accountIsDeferred)
if (!am.localFoldersServer)
{
dump("error! we should have a local mail server at this point\n");
return;
return false;
}
copiesAndFoldersServer = am.localFoldersServer;
}
@@ -929,6 +932,8 @@ function PrefillAccountForIsp(ispName)
dump("PrefillAccountForISP: filling with " + ispData + "\n");
SetCurrentAccountData(ispData);
AccountDataToPageData(ispData, pageData);
setPageData(pageData, "ispdata", "supplied", true);
}
// does any cleanup work for the the account data

View File

@@ -76,6 +76,8 @@ function acctNamePageValidate()
}
setPageData(pageData, "accname", "prettyName", accountname);
// Set this to true so we know the user has set the name.
setPageData(pageData, "accname", "userset", true);
return true;
}

View File

@@ -69,13 +69,20 @@ function setupWizardPanels() {
}
var pageData = parent.GetPageData();
// We default this to false, even though we could set it to true if we
// are going to display the page. However as the accname page will set
// it to true for us, we'll just default it to false and not work it out
// twice.
setPageData(pageData, "accname", "userset", false);
// If we need to skip wizardpanels, set the wizard to jump to the
// summary page i.e., last page. Otherwise, set the flow based
// on type of account (mail or news) user is creating.
var skipPanels = "";
try {
skipPanels = gCurrentAccountData.wizardSkipPanels.toString().toLowerCase();
if (gCurrentAccountData.wizardSkipPanels)
skipPanels = gCurrentAccountData.wizardSkipPanels.toString().toLowerCase();
} catch(ex) {}
// "done" is the only required panel for all accounts. We used to require an identity panel but not anymore.

View File

@@ -102,25 +102,29 @@ function donePageInit() {
smtpUserName = getUsernameFromEmail(email);
setDivTextFromForm("smtpServer.username", smtpUserName);
var accountName="";
if (pageData.accname && pageData.accname.prettyName) {
accountName = pageData.accname.prettyName.value;
// If currentAccountData has a pretty name (e.g. news link or from
// isp data) only set the user name with the pretty name if the
// pretty name originally came from ispdata
if ((currentAccountData &&
currentAccountData.incomingServer.prettyName) &&
(pageData.ispdata &&
pageData.ispdata.supplied &&
pageData.ispdata.supplied.value))
{
// Get the polished account name - if the user has modified the
// account name then use that, otherwise use the userName.
pageData.accname.prettyName.value =
gPrefsBundle.getFormattedString("accountName",
[currentAccountData.incomingServer.prettyName,
(pageData.accname.userset && pageData.accname.userset.value) ? pageData.accname.prettyName.value : userName]);
}
// else just use the default supplied name
// If the AccountData exists, tha means we have values read from rdf file.
// Get the pretty name and polish the account name
if ( currentAccountData &&
currentAccountData.incomingServer.prettyName)
{
var prettyName = currentAccountData.incomingServer.prettyName;
// Get the polished account name
accountName = gPrefsBundle.getFormattedString("accountName",
[prettyName,
userName]);
// Set that to be the name in the pagedata
pageData.accname.prettyName.value = accountName;
}
setDivTextFromForm("account.name", pageData.accname.prettyName.value);
} else {
setDivTextFromForm("account.name", "");
}
setDivTextFromForm("account.name", accountName);
// Show mail servers (incoming&outgoing) details
// based on current account data. ISP can set