Adopt to new open/save dialog API.

This commit is contained in:
Cheng Zhao
2013-05-20 22:23:27 +08:00
parent 1254561724
commit 6e012ed24f
2 changed files with 5 additions and 5 deletions

View File

@@ -171,8 +171,9 @@ window.atom =
callbacks[chosen]?()
showSaveDialog: (callback) ->
@presentModal =>
@sendMessageToBrowserProcess('showSaveDialog', [], (path) => @dismissModal(callback, path))
currentWindow = remote.getCurrentWindow()
result = remote.require('dialog').showSaveDialog currentWindow, title: 'Save File', defaultPath: path
callback(result)
presentModal: (fn) ->
if @presentingModal

View File

@@ -122,9 +122,8 @@ class AtomApplication
ipc.on 'open-folder', =>
currentWindow = BrowserWindow.getFocusedWindow()
dialog.openFolder currentWindow, {}, (result, paths...) =>
console.log paths
@createAtomWindow(path) for path in paths
paths = dialog.showOpenDialog title: 'Open', properties: ['openFile', 'openDirectory', 'multiSelections', 'createDirectory']
@createAtomWindow(path) for path in paths if paths?
ipc.on 'new-window', =>
@createAtomWindow()