Dirty and window title added back. Dirty close prompts user.

This commit is contained in:
Corey Johnson
2011-11-01 16:03:16 -07:00
parent 66ad5e8150
commit 9e21d8da04
4 changed files with 92 additions and 31 deletions

View File

@@ -22,15 +22,22 @@ windowAdditions =
KeyBinder.register "window", window
@editor = if fs.isFile atomController.path
@editor = if atomController.path and fs.isFile atomController.path
new Editor atomController.path
else
new Editor @tmpFile()
new Editor
@loadExtensions()
@loadKeyBindings()
KeyBinder.load "#{@appRoot}/static/key-bindings.coffee"
KeyBinder.load "~/.atomicity/key-bindings.coffee"
Event.on "editor:open", (e) =>
path = e.details
console.log path
basename = fs.base path
@setTitle basename
Event.on "editor:close", (e) =>
@setTitle "untitled"
loadExtensions: ->
extension.shutdown() for extension in @extensions
@@ -53,18 +60,22 @@ windowAdditions =
console.warn "window: Extension #{extension.constructor.name} failed to startup."
console.warn error
loadKeyBindings: ->
KeyBinder.load "#{@appRoot}/static/key-bindings.coffee"
KeyBinder.load "~/.atomicity/key-bindings.coffee"
recentPath: ->
localStorage.lastOpenedPath ? @tmpFile()
localStorage.lastOpenedPath
setRecentPath: (path) ->
localStorage.lastOpenedPath = path
tmpFile: ->
"/tmp/atom"
showConsole: ->
atomController.webView.inspector.showConsole true
setTitle: (title) ->
atomController.window.title = title
reload: ->
@close()
Native.newWindow atomController.path