Add DialogSettings helper struct
This commit is contained in:
parent
e7410976f0
commit
867bb5a94e
9 changed files with 151 additions and 235 deletions
|
@ -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) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue