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

git-svn-id: svn://10.0.0.236/trunk@78397 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
disttsc%bart.nl
2000-09-07 18:22:14 +00:00
parent beabb48e58
commit 2dd8b1f5cc
2 changed files with 26 additions and 0 deletions

View File

@@ -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;
}

View File

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