mirror of
https://github.com/atom/atom.git
synced 2026-04-28 03:01:47 -04:00
Show skull menu when in dev mode
This commit is contained in:
@@ -25,7 +25,7 @@ class AtomApplication
|
||||
resourcePath: null
|
||||
version: null
|
||||
|
||||
constructor: ({@resourcePath, pathsToOpen, @version, test, pidToKillWhenClosed}) ->
|
||||
constructor: ({@resourcePath, pathsToOpen, @version, test, pidToKillWhenClosed, @dev}) ->
|
||||
global.atomApplication = this
|
||||
|
||||
@pidsToOpenWindows = {}
|
||||
@@ -89,7 +89,8 @@ class AtomApplication
|
||||
app.commandLine.appendSwitch 'js-flags', '--harmony_collections'
|
||||
|
||||
buildApplicationMenu: ->
|
||||
atomMenu =
|
||||
menus = []
|
||||
menus.push
|
||||
label: 'Atom'
|
||||
submenu: [
|
||||
{ label: 'About Atom', selector: 'orderFrontStandardAboutPanel:' }
|
||||
@@ -106,13 +107,18 @@ class AtomApplication
|
||||
{ label: 'Quit', accelerator: 'Command+Q', click: -> app.quit() }
|
||||
]
|
||||
|
||||
fileMenu =
|
||||
if @dev
|
||||
menus.push
|
||||
label: '\uD83D\uDC80'
|
||||
submenu: [ { label: 'In Development Mode', enabled: false } ]
|
||||
|
||||
menus.push
|
||||
label: 'File'
|
||||
submenu: [
|
||||
{ label: 'Open...', accelerator: 'Command+O', click: => @promptForPath() }
|
||||
]
|
||||
|
||||
editMenu =
|
||||
menus.push
|
||||
label: 'Edit'
|
||||
submenu:[
|
||||
{ label: 'Undo', accelerator: 'Command+Z', selector: 'undo:' }
|
||||
@@ -124,14 +130,14 @@ class AtomApplication
|
||||
{ label: 'Select All', accelerator: 'Command+A', selector: 'selectAll:' }
|
||||
]
|
||||
|
||||
viewMenu =
|
||||
menus.push
|
||||
label: 'View'
|
||||
submenu:[
|
||||
{ label: 'Reload', accelerator: 'Command+R', click: => BrowserWindow.getFocusedWindow()?.restart() }
|
||||
{ label: 'Toggle DevTools', accelerator: 'Alt+Command+I', click: => BrowserWindow.getFocusedWindow()?.toggleDevTools() }
|
||||
]
|
||||
|
||||
windowMenu =
|
||||
menus.push
|
||||
label: 'Window'
|
||||
submenu: [
|
||||
{ label: 'Minimize', accelerator: 'Command+M', selector: 'performMiniaturize:' }
|
||||
@@ -140,7 +146,7 @@ class AtomApplication
|
||||
{ label: 'Bring All to Front', selector: 'arrangeInFront:' }
|
||||
]
|
||||
|
||||
@menu = Menu.buildFromTemplate [atomMenu, fileMenu, editMenu, viewMenu, windowMenu]
|
||||
@menu = Menu.buildFromTemplate menus
|
||||
Menu.setApplicationMenu @menu
|
||||
|
||||
handleEvents: ->
|
||||
|
||||
@@ -51,19 +51,22 @@ parseCommandLine = ->
|
||||
process.exit(0)
|
||||
|
||||
executedFrom = args['executed-from']
|
||||
dev = args['dev']
|
||||
pathsToOpen = args._
|
||||
pathsToOpen = [executedFrom] if executedFrom and pathsToOpen.length is 0
|
||||
test = args['test']
|
||||
pidToKillWhenClosed = args['pid'] if args['wait']
|
||||
|
||||
if args['resource-path']
|
||||
dev = true
|
||||
resourcePath = args['resource-path']
|
||||
else if args['dev']
|
||||
else if dev
|
||||
resourcePath = path.join(getHomeDir(), 'github', 'atom')
|
||||
|
||||
try
|
||||
fs.statSync resourcePath
|
||||
catch e
|
||||
dev = false
|
||||
resourcePath = path.dirname(__dirname)
|
||||
|
||||
{resourcePath, pathsToOpen, executedFrom, test, version, pidToKillWhenClosed}
|
||||
{resourcePath, pathsToOpen, executedFrom, test, version, pidToKillWhenClosed, dev}
|
||||
|
||||
Reference in New Issue
Block a user