From 7b171e786c959d364217aff338d5b020a168933c Mon Sep 17 00:00:00 2001 From: "alecf%netscape.com" Date: Tue, 4 Apr 2000 01:33:23 +0000 Subject: [PATCH] add support for pages asking to be reloaded from scratch (so that SMTP prefs can be reloaded) r=sspitzer --- .../prefs/resources/content/AccountManager.js | 21 +++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/mailnews/base/prefs/resources/content/AccountManager.js b/mailnews/base/prefs/resources/content/AccountManager.js index e74452dcf9d0..e0d9ad1b3198 100644 --- a/mailnews/base/prefs/resources/content/AccountManager.js +++ b/mailnews/base/prefs/resources/content/AccountManager.js @@ -377,11 +377,19 @@ function showPage(serverId, pageId) { // page has loaded function onPanelLoaded(pageId) { if (pageId != pendingPageId) { - dump("ERROR: page " + pageId + " was loaded, but " + pendingPageId + " was expected!\n"); - return; + + // if we're reloading the current page, we'll assume the + // page has asked itself to be completely reloaded from + // the prefs. to do this, clear out the the old entry in + // the account data, and then restore theh page + if (pageId == currentPageId) { + clearAccountData(currentServerId, currentPageId); + restorePage(currentServerId, currentPageId); + } + } else { + + restorePage(pendingPageId, pendingServerId); } - - restorePage(pendingPageId, pendingServerId); // probably unnecessary, but useful for debugging pendingServerId = null; @@ -641,6 +649,11 @@ function getValueArrayFor(serverId) { return accountArray[serverId]; } +function clearAccountData(serverId, pageId) +{ + getValueArrayFor(serverId)[pageId] = null; +} + function getServerIdAndPageIdFromTree(tree) { var serverId = null;