r=sspitzer,sr=bienvenu
This commit is contained in:
sspitzer%netscape.com 2000-12-21 23:34:22 +00:00
Родитель 5e96046abb
Коммит e1ab0cea00
6 изменённых файлов: 34 добавлений и 3 удалений

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

@ -235,7 +235,11 @@ function onDeleteAccount(event) {
var type = server.type;
var protocolinfo = Components.classes["@mozilla.org/messenger/protocol/info;1?type=" + type].getService(Components.interfaces.nsIMsgProtocolInfo);
if (!protocolinfo.canDelete) return;
var canDelete = protocolinfo.canDelete;
if (!canDelete) {
canDelete = server.canDelete;
}
if (!canDelete) return;
var confirmDeleteAccount =
Bundle.GetStringFromName("confirmDeleteAccount");
@ -329,8 +333,10 @@ function updateButtons(tree,serverId) {
var protocolinfo = Components.classes["@mozilla.org/messenger/protocol/info;1?type=" + type].getService(Components.interfaces.nsIMsgProtocolInfo);
canDuplicate = protocolinfo.canDuplicate;
canDelete = protocolinfo.canDelete;
canDelete = protocolinfo.canDelete;
if (!canDelete) {
canDelete = server.canDelete;
}
}
else {
// HACK

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

@ -182,6 +182,13 @@ interface nsIMsgIncomingServer : nsISupports {
/* used for comparing nsIMsgIncomingServers */
boolean equals(in nsIMsgIncomingServer server);
/**
* can this server be removed from the account manager? for
* instance, local mail is not removable, but an imported folder is
*/
attribute boolean canDelete;
};
%{C++

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

@ -1054,6 +1054,18 @@ nsMsgIncomingServer::getProtocolInfo(nsIMsgProtocolInfo **aResult)
return NS_OK;
}
NS_IMETHODIMP nsMsgIncomingServer::GetCanDelete(PRBool* value)
{
NS_ENSURE_ARG_POINTER(value);
return GetBoolValue("canDelete", value);
}
NS_IMETHODIMP nsMsgIncomingServer::SetCanDelete(PRBool value)
{
return SetBoolValue("canDelete", value);
}
// use the convenience macros to implement the accessors
NS_IMPL_SERVERPREF_STR(nsMsgIncomingServer, Username, "userName");
NS_IMPL_SERVERPREF_STR(nsMsgIncomingServer, PrefPassword, "password");

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

@ -1042,6 +1042,10 @@ PRBool nsImportGenericMail::GetAccount( nsIMsgFolder **ppFolder)
}
server->SetType( "none");
// usually, servers of type none can't be deleted; this must be
// overridden
server->SetCanDelete(PR_TRUE);
// Let's get a reasonable "pretty name" that doesn't exist yet?
GetUniquePrettyName( accMgr, prettyName);

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

@ -409,6 +409,7 @@ pref("mail.server.default.empty_trash_on_exit", false);
pref("mail.server.default.using_subscription", true);
pref("mail.server.default.dual_use_folders", true);
pref("mail.server.default.canDelete", false);
pref("mail.smtpserver.default.auth_method", 2); // auth login

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

@ -409,6 +409,7 @@ pref("mail.server.default.empty_trash_on_exit", false);
pref("mail.server.default.using_subscription", true);
pref("mail.server.default.dual_use_folders", true);
pref("mail.server.default.canDelete", false);
pref("mail.smtpserver.default.auth_method", 2); // auth login