mirror of
https://github.com/atom/atom.git
synced 2026-04-06 03:02:13 -04:00
Open a custom config window on 'open-user-configuration' event
This commit is contained in:
committed by
Corey Johnson & Kevin Sawicki
parent
df064ddd21
commit
160b80b47f
@@ -126,6 +126,9 @@ _.extend atom,
|
||||
newWindow: (args...) ->
|
||||
@sendMessageToBrowserProcess('newWindow', args)
|
||||
|
||||
openConfig: ->
|
||||
@sendMessageToBrowserProcess('openConfig')
|
||||
|
||||
restartRendererProcess: ->
|
||||
@sendMessageToBrowserProcess('restartRendererProcess')
|
||||
|
||||
|
||||
9
src/app/config-view.coffee
Normal file
9
src/app/config-view.coffee
Normal file
@@ -0,0 +1,9 @@
|
||||
{View} = require 'space-pen'
|
||||
|
||||
module.exports =
|
||||
class ConfigView extends View
|
||||
@content: ->
|
||||
@div id: 'config-view', "Config View"
|
||||
|
||||
initialize: ->
|
||||
document.title = "Atom Configuration"
|
||||
@@ -40,7 +40,7 @@ class Keymap
|
||||
'alt-meta-i': 'toggle-dev-tools'
|
||||
|
||||
$(document).command 'new-window', => atom.newWindow()
|
||||
$(document).command 'open-user-configuration', => atom.open(config.configDirPath)
|
||||
$(document).command 'open-user-configuration', => atom.openConfig()
|
||||
$(document).command 'open', => atom.open()
|
||||
$(document).command 'open-dev', => atom.openDev()
|
||||
|
||||
|
||||
@@ -30,6 +30,7 @@ window.setUpEnvironment = ->
|
||||
keymap.bindDefaultKeys()
|
||||
|
||||
requireStylesheet 'atom'
|
||||
requireStylesheet 'config'
|
||||
|
||||
if nativeStylesheetPath = fsUtils.resolveOnLoadPath(process.platform, ['css', 'less'])
|
||||
requireStylesheet(nativeStylesheetPath)
|
||||
@@ -55,6 +56,15 @@ window.startEditorWindow = ->
|
||||
$(window).on 'beforeunload', -> shutdown(); false
|
||||
$(window).focus()
|
||||
|
||||
window.startConfigWindow = ->
|
||||
handleWindowEvents()
|
||||
config.load()
|
||||
keymap.loadBundledKeymaps()
|
||||
atom.loadThemes()
|
||||
atom.loadPackages()
|
||||
deserializeConfigWindow()
|
||||
keymap.loadUserKeymaps()
|
||||
|
||||
window.shutdown = ->
|
||||
return if not project and not rootView
|
||||
atom.setWindowState('pathToOpen', project.getPath())
|
||||
@@ -130,6 +140,11 @@ window.deserializeEditorWindow = ->
|
||||
window.git?.destroy()
|
||||
window.git = Git.open(project.getPath())
|
||||
|
||||
window.deserializeConfigWindow = ->
|
||||
ConfigView = require 'config-view'
|
||||
window.configView = new ConfigView()
|
||||
$(rootViewParentSelector).append(configView)
|
||||
|
||||
window.stylesheetElementForId = (id) ->
|
||||
$("head style[id='#{id}']")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user