mirror of
https://github.com/atom/atom.git
synced 2026-04-28 03:01:47 -04:00
🎨 Removed application:open-dev and application:open-safe from new method.
This commit is contained in:
@@ -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...) ->
|
||||
|
||||
@@ -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')
|
||||
|
||||
Reference in New Issue
Block a user