modeGetFolder should have some different wording from modeOpen. Bug

160672, r=caillon,timeless, sr=bryner
This commit is contained in:
bzbarsky%mit.edu 2002-09-11 07:38:14 +00:00
Родитель 30a38418d6
Коммит 662b773a70
3 изменённых файлов: 22 добавлений и 3 удалений

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

@ -83,6 +83,11 @@ function filepickerLoad() {
newDirButton.removeAttribute("hidden");
}
if (filePickerMode == nsIFilePicker.modeGetFolder) {
var textInputLabel = document.getElementById("textInputLabel");
textInputLabel.value = gFilePickerBundle.getString("dirTextInputLabel");
}
if ((filePickerMode == nsIFilePicker.modeOpen) ||
(filePickerMode == nsIFilePicker.modeOpenMultiple) ||
(filePickerMode == nsIFilePicker.modeSave)) {
@ -237,14 +242,24 @@ function selectOnOK()
//promptService.alert(window, "Problem", "normalize failed, continuing");
}
if (!file.exists() && (filePickerMode != nsIFilePicker.modeSave)) {
var fileExists = file.exists();
if (!fileExists && (filePickerMode == nsIFilePicker.modeOpen ||
filePickerMode == nsIFilePicker.modeOpenMultiple)) {
showErrorDialog("errorOpenFileDoesntExistTitle",
"errorOpenFileDoesntExistMessage",
file);
return false;
}
if (file.exists()) {
if (!fileExists && filePickerMode == nsIFilePicker.modeGetFolder) {
showErrorDialog("errorDirDoesntExistTitle",
"errorDirDoesntExistMessage",
file);
return false;
}
if (fileExists) {
isDir = file.isDirectory();
isFile = file.isFile();
}

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

@ -85,7 +85,7 @@
<rows>
<row align="center">
<label value="&textInput.label;"/>
<label value="&textInput.label;" id="textInputLabel"/>
<textbox id="textInput" flex="1" oninput="doEnabling()"
onfocus="onTextFieldFocus();"/>
</row>

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

@ -14,6 +14,8 @@ xulTitle=XUL Files
xulFilter=*.xul
appsTitle=Applications
dirTextInputLabel=Directory name:
confirmFileReplacing=%S already exists.\nDo you want to replace it?
openButtonLabel=Open
saveButtonLabel=Save
@ -22,6 +24,8 @@ noButtonLabel=No
errorOpenFileDoesntExistTitle=Error opening %S
errorOpenFileDoesntExistMessage=File %S doesn't exist
errorDirDoesntExistTitle=Error accessing %S
errorDirDoesntExistMessage=Directory %S doesn't exist
errorDirNotReadableMessage=Directory %S is not readable or does not exist.
errorOpeningFileTitle=Error opening %S