Don't default to "Open", "Save", just let OS decide
This commit is contained in:
parent
40c531737d
commit
84cce6c2c1
4 changed files with 9 additions and 13 deletions
|
@ -76,11 +76,7 @@ module.exports = {
|
|||
throw new TypeError('Title must be a string')
|
||||
}
|
||||
if (options.buttonLabel == null) {
|
||||
if (options.properties.indexOf('openDirectory') !== -1) {
|
||||
options.buttonLabel = 'Choose'
|
||||
} else {
|
||||
options.buttonLabel = 'Open'
|
||||
}
|
||||
options.buttonLabel = ''
|
||||
} else if (typeof options.buttonLabel !== 'string') {
|
||||
throw new TypeError('buttonLabel must be a string')
|
||||
}
|
||||
|
@ -95,7 +91,7 @@ module.exports = {
|
|||
wrappedCallback = typeof callback === 'function' ? function (success, result) {
|
||||
return callback(success ? result : void 0)
|
||||
} : null
|
||||
return binding.showOpenDialog(String(options.title), String(options.buttonLabel), String(options.defaultPath), options.filters, properties, window, wrappedCallback)
|
||||
return binding.showOpenDialog(options.title, options.buttonLabel, options.defaultPath, options.filters, properties, window, wrappedCallback)
|
||||
},
|
||||
|
||||
showSaveDialog: function (...args) {
|
||||
|
@ -113,7 +109,7 @@ module.exports = {
|
|||
throw new TypeError('Title must be a string')
|
||||
}
|
||||
if (options.buttonLabel == null) {
|
||||
options.buttonLabel = 'Save'
|
||||
options.buttonLabel = ''
|
||||
} else if (typeof options.buttonLabel !== 'string') {
|
||||
throw new TypeError('buttonLabel must be a string')
|
||||
}
|
||||
|
@ -128,7 +124,7 @@ module.exports = {
|
|||
wrappedCallback = typeof callback === 'function' ? function (success, result) {
|
||||
return callback(success ? result : void 0)
|
||||
} : null
|
||||
return binding.showSaveDialog(String(options.title), String(options.buttonLabel), String(options.defaultPath), options.filters, window, wrappedCallback)
|
||||
return binding.showSaveDialog(options.title, options.buttonLabel, options.defaultPath, options.filters, window, wrappedCallback)
|
||||
},
|
||||
|
||||
showMessageBox: function (...args) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue