binding = process.atomBinding 'dialog'
v8Util = process.atomBinding 'v8_util'
+app = require 'app'
BrowserWindow = require 'browser-window'
fileDialogProperties =
options = null
[window, options, callback]
+checkAppInitialized = ->
+ throw new Error('dialog module can only be used after app is ready') unless app.isReady()
+
module.exports =
showOpenDialog: (args...) ->
+ checkAppInitialized()
[window, options, callback] = parseArgs args...
options ?= title: 'Open', properties: ['openFile']
wrappedCallback
showSaveDialog: (args...) ->
+ checkAppInitialized()
[window, options, callback] = parseArgs args...
options ?= title: 'Save'
wrappedCallback
showMessageBox: (args...) ->
+ checkAppInitialized()
[window, options, callback] = parseArgs args...
options ?= type: 'none'