-
Notifications
You must be signed in to change notification settings - Fork 173
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove autosave files when user declines to restore from them #1962
base: master
Are you sure you want to change the base?
Conversation
When Hydrogen starts up, if a file has been autosaved the user will be offered the opportunity to restore from that file. If they decline it, Hydrogen should delete the autosaved file; it may be soon overwritten anyway by new autosave data. This avoids the annoying cycle I often find myself in: 1. edit file 2. quit Hydrogen discarding edits (but autosave remains) 3. open Hydrogen 4. hit "Don't Save" because I didn't want those edits 5. listen to original file without modifying (hence no autosave, but old autosave remains) 6. quit Hydrogen (silently) 7. goto 3 Also, when opening a file and restoring from its autosave, Hydrogen should count this as the song being Modified because the current content is from the autosave and is not the same as the content of the named file.
In initialising GUI elements, setting properties may set IsModified to true, even though there is no user action and the properties are only set to their existing value. Check these null actions and don't set IsModified for them. Also, remove the now-unneeded sets of IsModified to false what were needed to work around that behaviour.
Haha, setting autosave to
I also noted that. In #1955 I used a "No" instead of "Discard" button. But breaking the cycles sound like a very good idea. How about we offer all three options: yes, no, discard. This way the user can view both original and modified version before deciding whether to discard or apply the changes. |
Excellent idea, I like it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. But there still seem to be some spurious calls to setIsModified
during startup. When
- Create a new song
- Save it
- Quit Hydrogen and open it again
the empty song is marked "modified"
Oh good catch, I'll look into it. Thanks. |
88d8082
to
44dcf4c
Compare
Remove autosave files when user declines to restore from them
When Hydrogen starts up, if a file has been autosaved the user will
be offered the opportunity to restore from that file. If they decline
it, Hydrogen should delete the autosaved file; it may be soon overwritten anyway by new autosave data.
This avoids the annoying cycle I often find myself in:
Also, when opening a file and restoring from its autosave, Hydrogen
should count this as the song being Modified because the current
content is from the autosave and is not the same as the content of
the named file.
This change also removes spurious sets of
IsModified
in parts of the GUI, which wouldsetIsModified( true )
in the GUI initialisation despite not making any actual changes, as well assetModified( false )
calls that were needed to work around these spurious sets after song loading completed.