Bug82197 Acct Central Offline Settings should go to Offline panel, r=bhuvan, sr=mscott

This commit is contained in:
chuang%netscape.com 2001-07-16 18:47:20 +00:00
Родитель 454dd484ab
Коммит e6ed5fee67
7 изменённых файлов: 47 добавлений и 13 удалений

Просмотреть файл

@ -94,8 +94,11 @@ function onLoad() {
gPrefsBundle = document.getElementById("bundle_prefs");
var selectedServer;
if (window.arguments && window.arguments[0])
var selectPage = null;
if (window.arguments && window.arguments[0]) {
selectedServer = window.arguments[0].server;
selectPage = window.arguments[0].selectPage;
}
accountArray = new Array;
RDF = Components.classes["@mozilla.org/rdf/rdf-service;1"].getService(Components.interfaces.nsIRDFService);
@ -119,7 +122,7 @@ function onLoad() {
setDefaultButton = document.getElementById("setDefaultButton");
sortAccountList(accounttree);
selectServer(selectedServer)
selectServer(selectedServer, selectPage);
}
function sortAccountList(accounttree)
@ -129,12 +132,15 @@ function sortAccountList(accounttree)
xulSortService.Sort(accounttree, 'http://home.netscape.com/NC-rdf#FolderTreeName?sort=true', 'ascending');
}
function selectServer(server)
function selectServer(server, selectPage)
{
var selectedItem;
if (server)
if (server) {
selectedItem = document.getElementById(server.serverURI);
if (selectedItem && selectPage)
selectedItem = findSelectPage(selectedItem, selectPage);
}
if (!selectedItem)
selectedItem = getFirstAccount();
@ -147,6 +153,26 @@ function selectServer(server)
}
}
function findSelectPage(selectServer, selectPage)
{
var children = selectServer.childNodes;
for (i=0; i < children.length; i++)
{
if (children[i].localName == "treechildren") {
var pageNodes = children[i].childNodes;
for (j=0; j < pageNodes.length; j++) {
if (pageNodes[j].localName == "treeitem") {
var page = pageNodes[j].getAttribute('PageTag');
if (page == selectPage) {
return pageNodes[j];
}
}
}
}
}
return null;
}
function getFirstAccount()
{
var tree = document.getElementById("accounttree");

Просмотреть файл

@ -132,7 +132,11 @@ function msgOpenAccountWizard()
}
function MsgAccountManager()
// selectPage: the xul file name for the viewing page,
// null for the account main page, other pages are
// 'am-server.xul', 'am-copies.xul', 'am-offline.xul',
// 'am-addressing.xul','am-advanced.xul', 'am-smtp.xul'
function MsgAccountManager(selectPage)
{
var server;
try {
@ -142,5 +146,5 @@ function MsgAccountManager()
window.openDialog("chrome://messenger/content/AccountManager.xul",
"AccountManager", "chrome,modal,titlebar,resizable",
{ server: server });
{ server: server, selectPage: selectPage });
}

Просмотреть файл

@ -903,7 +903,7 @@ function MailCheckBeforeOfflineChange()
function MsgSettingsOffline()
{
window.parent.MsgAccountManager();
window.parent.MsgAccountManager('am-offline.xul');
}
// Init PrefsService

Просмотреть файл

@ -873,7 +873,7 @@ Rights Reserved.
accesskey="&folderPropsCmd.accesskey;"
observes="cmd_properties"/>
<menuseparator/>
<menuitem label="&accountManagerCmd.label;" accesskey="&accountManagerCmd.accesskey;" oncommand="MsgAccountManager();"/>
<menuitem label="&accountManagerCmd.label;" accesskey="&accountManagerCmd.accesskey;" oncommand="MsgAccountManager(null);"/>
<menuitem id="menu_preferences" oncommand="goPreferences('messenger.xul', 'chrome://messenger/content/pref-mailnews.xul','mailnews')"/>
</menupopup>
</menu>

Просмотреть файл

@ -212,9 +212,13 @@ function ComposeAMessage(event)
}
// Open AccountManager to view settings for a given account
function ViewSettings()
// selectPage: the xul file name for the viewing page,
// null for the account main page, other pages are
// 'am-server.xul', 'am-copies.xul', 'am-offline.xul',
// 'am-addressing.xul','am-advanced.xul', 'am-smtp.xul'
function ViewSettings(selectPage)
{
window.parent.MsgAccountManager();
window.parent.MsgAccountManager(selectPage);
}
// Open AccountWizard to create an account

Просмотреть файл

@ -105,7 +105,7 @@ Rights Reserved.
<separator id="AccountsHeader.separator" class="thin"/>
<row id="AccountSettings" class="acctCentralRow">
<hbox>
<text class="acctCentralText acctCentralLinkText" value="&settingsLink.label;" onclick="ViewSettings();"/>
<text class="acctCentralText acctCentralLinkText" value="&settingsLink.label;" onclick="ViewSettings(null);"/>
</hbox>
</row>
<separator id="AccountSettings.separator" class="thin"/>
@ -140,7 +140,7 @@ Rights Reserved.
<separator id="CreateFilters.separator" class="thin"/>
<row id="OfflineSettings" class="acctCentralRow">
<hbox>
<text class="acctCentralText acctCentralLinkText" value="&offlineLink.label;" onclick="ViewSettings();"/>
<text class="acctCentralText acctCentralLinkText" value="&offlineLink.label;" onclick="ViewSettings('am-offline.xul');"/>
</hbox>
</row>
<separator id="OfflineSettings.separator" class="thin"/>

Просмотреть файл

@ -435,7 +435,7 @@ var defaultController =
case "cmd_print" : DoCommandPrint(); break;
//Edit Menu
case "cmd_account" : MsgAccountManager(); break;
case "cmd_account" : MsgAccountManager(null); break;
case "cmd_preferences" : DoCommandPreferences(); break;
//View Menu