Add DialogSettings helper struct

This commit is contained in:
Kevin Sawicki 2017-02-07 17:32:58 -08:00
parent e7410976f0
commit 867bb5a94e
9 changed files with 151 additions and 235 deletions

View file

@ -121,8 +121,9 @@ module.exports = {
const wrappedCallback = typeof callback === 'function' ? function (success, result) {
return callback(success ? result : void 0)
} : null
return binding.showOpenDialog(title, buttonLabel, defaultPath, filters,
dialogProperties, window, wrappedCallback)
const settings = {title, buttonLabel, defaultPath, filters, window}
settings.properties = dialogProperties
return binding.showOpenDialog(settings, wrappedCallback)
},
showSaveDialog: function (...args) {
@ -163,8 +164,8 @@ module.exports = {
const wrappedCallback = typeof callback === 'function' ? function (success, result) {
return callback(success ? result : void 0)
} : null
return binding.showSaveDialog(title, buttonLabel, defaultPath, filters,
window, wrappedCallback)
const settings = {title, buttonLabel, defaultPath, filters, window}
return binding.showSaveDialog(settings, wrappedCallback)
},
showMessageBox: function (...args) {