mirror of
https://github.com/Kuingsmile/PicList.git
synced 2025-02-08 21:38:13 -05:00
Finished: guiApi.showMessageBox
This commit is contained in:
parent
a4056cbe58
commit
9ab9e1973c
@ -87,19 +87,39 @@ class GuiApi {
|
|||||||
* For notification
|
* For notification
|
||||||
* @param {Object} options
|
* @param {Object} options
|
||||||
*/
|
*/
|
||||||
showNotification (options) {
|
showNotification (options = {
|
||||||
if (options === undefined) {
|
title: '',
|
||||||
options = {
|
body: ''
|
||||||
title: '',
|
}) {
|
||||||
body: ''
|
|
||||||
}
|
|
||||||
}
|
|
||||||
const notification = new Notification({
|
const notification = new Notification({
|
||||||
title: options.title,
|
title: options.title,
|
||||||
body: options.body
|
body: options.body
|
||||||
})
|
})
|
||||||
notification.show()
|
notification.show()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param {Object} options
|
||||||
|
*/
|
||||||
|
showMessageBox (options = {
|
||||||
|
title: '',
|
||||||
|
message: '',
|
||||||
|
type: 'info',
|
||||||
|
buttons: ['Yes', 'No']
|
||||||
|
}) {
|
||||||
|
return new Promise((resolve, reject) => {
|
||||||
|
dialog.showMessageBox(
|
||||||
|
BrowserWindow.fromWebContents(this[WEBCONTENTS]),
|
||||||
|
options,
|
||||||
|
(result, checkboxChecked) => {
|
||||||
|
resolve({
|
||||||
|
result,
|
||||||
|
checkboxChecked
|
||||||
|
})
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export default GuiApi
|
export default GuiApi
|
||||||
|
Loading…
Reference in New Issue
Block a user