make it so when you click on an account that has a server but no identities in the account setup dialog, it shows the

new panel "am-serverwithnoidentities.xul" panel.

now "Local Folders" works!
This commit is contained in:
sspitzer%netscape.com 2000-01-26 11:16:38 +00:00
Родитель 0602b121c6
Коммит 9200e3284b
12 изменённых файлов: 90 добавлений и 9 удалений

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

@ -61,6 +61,7 @@ var setDefaultButton;
// called when the whole document loads // called when the whole document loads
// perform initialization here // perform initialization here
function onLoad() { function onLoad() {
dump("accountmanager on load\n");
accountArray = new Array; accountArray = new Array;
RDF = Components.classes["component://netscape/rdf/rdf-service"].getService(Components.interfaces.nsIRDFService); RDF = Components.classes["component://netscape/rdf/rdf-service"].getService(Components.interfaces.nsIRDFService);
@ -356,16 +357,17 @@ function showDeckPage(deckBoxId) {
/* bring the deck to the front */ /* bring the deck to the front */
var deckBox = top.document.getElementById(deckBoxId); var deckBox = top.document.getElementById(deckBoxId);
var deck = deckBox.parentNode; if (deckBox) {
var children = deck.childNodes; var deck = deckBox.parentNode;
var children = deck.childNodes;
// search through deck children, and find the index to load // search through deck children, and find the index to load
for (var i=0; i<children.length; i++) { for (var i=0; i<children.length; i++) {
if (children[i] == deckBox) break; if (children[i] == deckBox) break;
}
deck.setAttribute("index", i);
} }
deck.setAttribute("index", i);
} }
// //

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

@ -70,6 +70,10 @@
<html:iframe src="chrome://messenger/content/am-smtp.xul" name="am-smtp.xul" <html:iframe src="chrome://messenger/content/am-smtp.xul" name="am-smtp.xul"
style="border: none" flex="100%"/> style="border: none" flex="100%"/>
</box> </box>
<box id="am-serverwithnoidentities.xul" flex="100%">
<html:iframe src="chrome://messenger/content/am-serverwithnoidentities.xul" name="am-serverwithnoidentities.xul"
style="border: none" flex="100%"/>
</box>
</deck> </deck>
</tabcontrol> </tabcontrol>
</box> </box>

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

@ -24,6 +24,7 @@ AccountManager.xul
AccountManager.js AccountManager.js
am-main.xul am-main.xul
am-server.xul am-server.xul
am-serverwithnoidentities.xul
am-server.js am-server.js
am-server-top.xul am-server-top.xul
am-copies.xul am-copies.xul

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

@ -33,6 +33,8 @@ EXPORT_RESOURCE_SAMPLES = \
AccountManager.js \ AccountManager.js \
am-main.xul \ am-main.xul \
am-server.xul \ am-server.xul \
am-serverwithnoidentities.xul \
am-serverwithnoidentities.js \
am-server.js \ am-server.js \
am-server-top.xul \ am-server-top.xul \
am-copies.xul \ am-copies.xul \
@ -54,6 +56,7 @@ EXPORT_RESOURCE_SAMPLES = \
aw-identity.xul \ aw-identity.xul \
aw-identity.js \ aw-identity.js \
aw-server.xul \ aw-server.xul \
am-serverwithnoidentity.xul \
aw-server.js \ aw-server.js \
aw-login.xul \ aw-login.xul \
aw-login.js \ aw-login.js \

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

@ -0,0 +1,22 @@
/* -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
* The contents of this file are subject to the Netscape Public
* License Version 1.1 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
*
* The Original Code is Mozilla Communicator client code, released
* March 31, 1998.
*
* The Initial Developer of the Original Code is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998-1999 Netscape Communications Corporation. All
* Rights Reserved.
*/
function onInit() {
}

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

@ -0,0 +1,27 @@
<?xml version="1.0"?>
<?xml-stylesheet href="chrome://messenger/skin/" type="text/css"?>
<!DOCTYPE window SYSTEM "chrome://messenger/locale/am-serverwithnoidentities.dtd" >
<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
xmlns:html="http://www.w3.org/TR/REC-html40"
class="dialog"
align="vertical">
<html:script src="chrome://messenger/content/am-serverwithnoidentities.js"/>
<html:div class="pageTitle">&accountTitle.label;</html:div>
<box align="vertical">
<html:div class="secDesc">&accountSettingsDesc.label;</html:div>
<box align="horizontal">
<html:div>&accountName.label;</html:div>
<html:spacer/>
<html:input type="text" name="server.prettyName" flex="100%"/>
</box>
</box>
<box align="vertical">
<html:div>&localPath.label;</html:div>
<html:input type="text" name="server.localPath" datatype="nsIFileSpec"/>
</box>
</window>

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

@ -28,6 +28,7 @@ install::
$(MAKE_INSTALL) AccountManager.js $(DIST)\bin\chrome\messenger\content\default $(MAKE_INSTALL) AccountManager.js $(DIST)\bin\chrome\messenger\content\default
$(MAKE_INSTALL) am-main.xul $(DIST)\bin\chrome\messenger\content\default $(MAKE_INSTALL) am-main.xul $(DIST)\bin\chrome\messenger\content\default
$(MAKE_INSTALL) am-server.xul $(DIST)\bin\chrome\messenger\content\default $(MAKE_INSTALL) am-server.xul $(DIST)\bin\chrome\messenger\content\default
$(MAKE_INSTALL) am-serverwithnoidentities.xul $(DIST)\bin\chrome\messenger\content\default
$(MAKE_INSTALL) am-server.js $(DIST)\bin\chrome\messenger\content\default $(MAKE_INSTALL) am-server.js $(DIST)\bin\chrome\messenger\content\default
$(MAKE_INSTALL) am-server-top.xul $(DIST)\bin\chrome\messenger\content\default $(MAKE_INSTALL) am-server-top.xul $(DIST)\bin\chrome\messenger\content\default
$(MAKE_INSTALL) am-copies.xul $(DIST)\bin\chrome\messenger\content\default $(MAKE_INSTALL) am-copies.xul $(DIST)\bin\chrome\messenger\content\default
@ -60,6 +61,7 @@ clobber::
rm -f $(DIST)\chrome\messenger\content\default\AccountManager.js rm -f $(DIST)\chrome\messenger\content\default\AccountManager.js
rm -f $(DIST)\chrome\messenger\content\default\am-main.xul rm -f $(DIST)\chrome\messenger\content\default\am-main.xul
rm -f $(DIST)\chrome\messenger\content\default\am-server.xul rm -f $(DIST)\chrome\messenger\content\default\am-server.xul
rm -f $(DIST)\chrome\messenger\content\default\am-serverwithnoidentities.xul
rm -f $(DIST)\chrome\messenger\content\default\am-server.js rm -f $(DIST)\chrome\messenger\content\default\am-server.js
rm -f $(DIST)\chrome\messenger\content\default\am-server-top.xul rm -f $(DIST)\chrome\messenger\content\default\am-server-top.xul
rm -f $(DIST)\chrome\messenger\content\default\am-copies.xul rm -f $(DIST)\chrome\messenger\content\default\am-copies.xul

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

@ -41,3 +41,4 @@ am-copies.dtd
am-main.dtd am-main.dtd
am-server-top.dtd am-server-top.dtd
prefs.properties prefs.properties
am-serverwithnoidentities.dtd

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

@ -50,6 +50,7 @@ EXPORT_RESOURCE_SAMPLES = \
am-main.dtd \ am-main.dtd \
am-server-top.dtd \ am-server-top.dtd \
prefs.properties \ prefs.properties \
am-serverwithnoidentities.dtd \
$(NULL) $(NULL)
include $(topsrcdir)/config/rules.mk include $(topsrcdir)/config/rules.mk

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

@ -0,0 +1,4 @@
<!ENTITY accountTitle.label "Account Settings">
<!ENTITY accountSettingsDesc.label "The following is a special account. There are no identities associated with it.">
<!ENTITY accountName.label "Account Name:">
<!ENTITY localPath.label "Local directory:">

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

@ -47,6 +47,7 @@ install::
$(MAKE_INSTALL) am-main.dtd $(DISTBROWSER) $(MAKE_INSTALL) am-main.dtd $(DISTBROWSER)
$(MAKE_INSTALL) am-server-top.dtd $(DISTBROWSER) $(MAKE_INSTALL) am-server-top.dtd $(DISTBROWSER)
$(MAKE_INSTALL) prefs.properties $(DISTBROWSER) $(MAKE_INSTALL) prefs.properties $(DISTBROWSER)
$(MAKE_INSTALL) am-serverwithnoidentities.dtd $(DISTBROWSER)
clobber:: clobber::
rm -f $(DIST)\bin\chrome\messenger\locale\en-US\custreceipt.dtd rm -f $(DIST)\bin\chrome\messenger\locale\en-US\custreceipt.dtd
@ -70,3 +71,4 @@ clobber::
rm -f $(DIST)\bin\chrome\messenger\locale\en-US\am-main.dtd rm -f $(DIST)\bin\chrome\messenger\locale\en-US\am-main.dtd
rm -f $(DIST)\bin\chrome\messenger\locale\en-US\am-server-top.dtd rm -f $(DIST)\bin\chrome\messenger\locale\en-US\am-server-top.dtd
rm -f $(DIST)\bin\chrome\messenger\locale\en-US\prefs.properties rm -f $(DIST)\bin\chrome\messenger\locale\en-US\prefs.properties
rm -f $(DIST)\bin\chrome\messenger\locale\en-US\am-serverwithnoidentities.dtd

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

@ -259,8 +259,20 @@ nsMsgAccountManagerDataSource::GetTarget(nsIRDFResource *source,
str = "am-advanced.xul"; str = "am-advanced.xul";
else if (source == kNC_PageTitleSMTP) else if (source == kNC_PageTitleSMTP)
str = "am-smtp.xul"; str = "am-smtp.xul";
else else {
str = "am-main.xul"; str = "am-main.xul";
/* if this is a server, with no identities, then we show a special panel */
nsCOMPtr<nsIMsgIncomingServer> server;
rv = getServerForFolderNode(source, getter_AddRefs(server));
if (server) {
PRBool hasIdentities;
rv = serverHasIdentities(server, &hasIdentities);
if (NS_SUCCEEDED(rv) && !hasIdentities) {
str = "am-serverwithnoidentities.xul";
}
}
}
} }
// handle sorting of servers // handle sorting of servers