Make XP filepicker's OK button display Open/Save/Select depending on the mode. r=bryner, a=brendan

This commit is contained in:
disttsc%bart.nl 2000-09-07 18:22:14 +00:00
Родитель 1b378df792
Коммит ced5bf8e0f
2 изменённых файлов: 26 добавлений и 0 удалений

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

@ -84,6 +84,28 @@ function onLoad() {
var filterMenuList = document.getElementById("filterMenuList");
filterMenuList.appendChild(filterPopup);
}
try {
var buttonLabel;
switch (filePickerMode) {
case nsIFilePicker.modeOpen:
buttonLabel = bundle.GetStringFromName("openButtonLabel");
break;
case nsIFilePicker.modeSave:
buttonLabel = bundle.GetStringFromName("saveButtonLabel");
break;
case nsIFilePicker.modeGetFolder:
buttonLabel = bundle.GetStringFromName("selectFolderButtonLabel");
break;
}
if (buttonLabel) {
var okButton = document.getElementById("ok");
okButton.setAttribute("value", buttonLabel);
}
} catch (exception) {
// keep it set to "OK"
}
// setup the dialogOverlay.xul button handlers
doSetOKCancel(onOK, onCancel);
@ -249,6 +271,7 @@ function onCancel()
{
// Close the window.
retvals.buttonStatus = nsIFilePicker.returnCancel;
retvals.file = null;
return true;
}

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

@ -14,3 +14,6 @@ xulTitle=XUL Files
xulFilter=*.xul
confirmFileReplacing=already exists. Do you want to replace it?
openButtonLabel=Open
saveButtonLabel=Save
selectFolderButtonLabel=Select