ColinPitrat / caprice32

An emulator of the Amstrad CPC 8bit home computer range.
GNU General Public License v2.0
146 stars 32 forks source link

I'd like to add "autosave Snapshot on exit" and rework the exit logic #241

Open cormacj opened 11 months ago

cormacj commented 11 months ago

I'm considering adding a parameter and an option for auto-saving a snapshot on exit (if enabled or called).

The reasoning here is that sometimes I accidentally exit out without having made a disc change (F11/paste is really close to F10/Quit), so the program just exits. The autosave on exit would just write/overwrite a named snapshot file that contained the last open state if no disc changes were made.

I'm also considering a change to the exit logic, where instead of asking "Unsaved changes. Do you really want to quit? Yes/No" it would ask "Unsaved changes. Do you really want to quit? Yes/No/Save" and the save option would open the save dialog and pre-fill the last opened filename as a default, rather than the current "F1/Load-Save/Save/Specify a filename" path thats kind of clunky.

Any thoughts or concerns with me making these changes?

ColinPitrat commented 11 months ago

I'm considering adding a parameter and an option for auto-saving a snapshot on exit (if enabled or called).

That's a good idea. The snapshot could be dated, configuration could rely on the presence of a snapshot_autosave_dir in the configuration. What do you think?

I'm also considering a change to the exit logic, where instead of asking "Unsaved changes. Do you really want to quit? Yes/No" it would ask "Unsaved changes. Do you really want to quit? Yes/No/Save" and the save option would open the save dialog and pre-fill the last opened filename as a default, rather than the current "F1/Load-Save/Save/Specify a filename" path thats kind of clunky.

Caprice GUI framework is not the best and this may a bit hard to do, but if you find a clean way to do it, that would definitely make users life simpler (though I'm not sure how many users actually write something on disk anyway :-) ).