mapbox/tilemill — Issue #853: quitting Mac app loses unsaved edits & exports
Author: incanus
Created: 2011-10-29 01:35:33+00:00
State: open
Labels: bug, osx, ui

Closing the main app window doesn't trigger the `unload` event that prompts for unsaved work. For one, we don't get this for free with WebKit, even though we're now handling alerts & confirms properly as of 369437bdb079b01c1ec74adaf074b2df7f4c9b32. For another, the Mac app allows the main window to be closed, but doesn't free its memory, allowing the user to bring the window back up at any time, so we don't necessarily want browser-like behavior here.

However, outright quitting the app also loses unsaved work, as well as not prompting the user about in-progress exports.

We will need to do some bridging between the Cocoa app and the engine via WebKit JavaScript bridging to reconcile this.

Paying attention to the `unload` [routine](https://github.com/mapbox/tilemill/blob/57de04cf06ec40c0b3a3dab3c09eed9e6daeec9b/views/Project.bones#L536-545) in `views/Project.bones` is one part.

Examinging `Bones.models.exports` is another.