🎨 Removed application:open-dev and application:open-safe from new method.

This commit is contained in:
David Elliott
2016-04-28 11:13:07 -07:00
parent 6ec5cf497b
commit 398ae4491e
2 changed files with 6 additions and 5 deletions

View File

@@ -170,6 +170,8 @@ class AtomApplication
@on 'application:quit', -> app.quit()
@on 'application:new-window', -> @openPath(getLoadSettings())
@on 'application:new-file', -> (@focusedWindow() ? this).openPath()
@on 'application:open-dev', -> @promptForPathToOpen('all', devMode: true)
@on 'application:open-safe', -> @promptForPathToOpen('all', safeMode: true)
@on 'application:inspect', ({x, y, atomWindow}) ->
atomWindow ?= @focusedWindow()
atomWindow?.browserWindow.inspectElement(x, y)
@@ -251,12 +253,11 @@ class AtomApplication
@emit(command)
ipcMain.on 'open-command', (event, command, args...) =>
defaultPath = args[0] if args.length > 0
switch command
when 'application:open' then @promptForPathToOpen('all', getLoadSettings())
when 'application:open-file' then @promptForPathToOpen('file', getLoadSettings(), args[0])
when 'application:open-file' then @promptForPathToOpen('file', getLoadSettings(), defaultPath)
when 'application:open-folder' then @promptForPathToOpen('folder', getLoadSettings())
when 'application:open-dev' then @promptForPathToOpen('all', devMode: true)
when 'application:open-safe' then @promptForPathToOpen('all', safeMode: true)
else console.log "Invalid open-command received: " + command
ipcMain.on 'window-command', (event, command, args...) ->

View File

@@ -36,8 +36,8 @@ module.exports = ({commandRegistry, commandInstaller, config, notificationManage
defaultPath = atom.workspace.getActiveTextEditor()?.getPath() ? atom.project.getPaths()?[0]
ipcRenderer.send('open-command', 'application:open-file', defaultPath)
'application:open-folder': -> ipcRenderer.send('open-command', 'application:open-folder')
'application:open-dev': -> ipcRenderer.send('open-command', 'application:open-dev')
'application:open-safe': -> ipcRenderer.send('open-command', 'application:open-safe')
'application:open-dev': -> ipcRenderer.send('command', 'application:open-dev')
'application:open-safe': -> ipcRenderer.send('command', 'application:open-safe')
'application:add-project-folder': -> atom.addProjectFolder()
'application:minimize': -> ipcRenderer.send('command', 'application:minimize')
'application:zoom': -> ipcRenderer.send('command', 'application:zoom')