Bug 256826 Mozilla should not permit to import empty address book

r=neil.parkwaycc.co.uk, sr=dmose, patch=brian.lu@sun.com
This commit is contained in:
kyle.yuan%sun.com 2004-11-02 02:32:46 +00:00
parent 683d7693d2
commit 8f92e961eb
2 changed files with 8 additions and 0 deletions

View File

@ -865,6 +865,13 @@ function ImportAddress( module, success, error) {
return( false);
}
if (file.fileSize == 0) {
var errorText = gImportMsgsBundle.getFormattedString('ImportEmptyAddressBook', [path]);
var promptService = Components.classes["@mozilla.org/embedcomp/prompt-service;1"].getService(Components.interfaces.nsIPromptService);
promptService.alert(window, document.title, errorText);
return false;
}
addInterface.SetData("addressLocation", file);
}

View File

@ -298,6 +298,7 @@ ImportMailSuccess=Mail was successfully imported from %S
# Error string for address import
ImportAddressBadModule=Unable to load address book import module.
ImportAddressNotFound=Unable to find any address books to import. Check to make sure the selected application or format is correctly installed on this machine.
ImportEmptyAddressBook=Can't import empty address book %S.
# LOCALIZATION NOTE : Do not translate the word "%S" below.
ImportAddressFailed=An error occurred importing addresses from %S.
# LOCALIZATION NOTE : Do not translate the word "%S" below.