Auto-Saving implemented in r16227 (to become 2.1.5) - Feedback wanted
Eric Ladner
eric.ladner at gmail.com
Tue Jul 3 13:34:25 EDT 2007
On 7/3/07, Bill Wohler <wohler at newt.com> wrote:
>
> Emacs and other programs I've seen auto-save into a separate file. I'd
> strongly suggest, and it would be greatly appreciated by the user
> community, that the hard work be done to make it so. You will end up
> surprising a lot of folks (not in a good way) by auto-saving over the
> original file.
Kind of like how 'vi' does it too. Here's the rough logic...
(on startup)
if (alternate file exists)
// something went wrong.. prompt user for option of reloading saved
checkpoint
if (user says yes)
load checkpoint
else
delete file
(timed) save to alternate file
if (user saves file)
delete checkpoint
(on exit)
if (not saved)
prompt user to save
if (user says yes)
save file
delete checkpoint
That way, you're not saving over the "official" data file, but saving to an
alternate file that always has the same name (<account>.ckpt" maybe). When
loading account <account>, if a checkpoint exists, something bad happened
and you can restore to that checkpoint, or just load the original file
(rollback all the way to last session).
--
Eric Ladner
More information about the gnucash-user
mailing list