This screen informs the user that the burn has completed and that the
drive can be ejected directly.
It also provides a button to burn another image without exitting the
application.
Fixes: https://github.com/resin-io/herostratus/issues/41
Currently we say "done" as soon as the progress is equal to 100, however
we don't wait for the drive to be ejected/unmounted.
This commit introduces a new state, called "Finishing..." which is shown
when the progress is 100, but the drive has not been unmounted.
Currently we only pass the drive device. By passing all the object
(containing the mountpoint, size, etc) we allow more control to the
writer in how to treat the device before/during/after the burning
process.
Currently we fire and forget `sudoPrompt.exec()` and run a timeout for
`process.exit(0)` right away, however this means that the timeout will
start as soon as the elevation dialog is shown when no sudo cache exists
and therefore the timeout will finish before the user can type his
password and submit.
The fix is to keep the parent alive until the children dies, but call
`app.dock.hide()` to make the parent completely invisible to the
operating system.
Fixes: https://github.com/resin-io/herostratus/issues/31
Currently, the parent application will not be closed until the children
process is closed, leading to two Herostratus applications running at
the same time on OS X.