mirror of
https://github.com/atom/atom.git
synced 2026-04-28 03:01:47 -04:00
Adopt to new open/save dialog API.
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user