diff --git a/mozilla/xpfe/components/filepicker/res/content/filepicker.js b/mozilla/xpfe/components/filepicker/res/content/filepicker.js index 066af22b676..2cd6956dce7 100644 --- a/mozilla/xpfe/components/filepicker/res/content/filepicker.js +++ b/mozilla/xpfe/components/filepicker/res/content/filepicker.js @@ -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; } diff --git a/mozilla/xpfe/components/filepicker/res/locale/en-US/filepicker.properties b/mozilla/xpfe/components/filepicker/res/locale/en-US/filepicker.properties index ac93e7c54c6..1329c17fbf9 100644 --- a/mozilla/xpfe/components/filepicker/res/locale/en-US/filepicker.properties +++ b/mozilla/xpfe/components/filepicker/res/locale/en-US/filepicker.properties @@ -14,3 +14,6 @@ xulTitle=XUL Files xulFilter=*.xul confirmFileReplacing=already exists. Do you want to replace it? +openButtonLabel=Open +saveButtonLabel=Save +selectFolderButtonLabel=Select