Accidental data loss despite saving
-
- Posts: 549
- Joined: April 9th, 2013, 11:03 pm
Accidental data loss despite saving
This concerns one of golly's current features, which has caused me to lose my work multiple times when I thought I had it saved. The problem was that I saved on a generation other than 0, and could not find the original setups.
I therefore make this request: in Golly 2.6, either add a confirmation box before saving on a later generation to make sure the user wants to save there and lose the original configuration, or save both gen 0 and the current one. Thanks, I really don't want to lose any more work to this.
In addition, as I have another non dataloss related request, I will be makinng a feature requests thread if there isn't one already.
I therefore make this request: in Golly 2.6, either add a confirmation box before saving on a later generation to make sure the user wants to save there and lose the original configuration, or save both gen 0 and the current one. Thanks, I really don't want to lose any more work to this.
In addition, as I have another non dataloss related request, I will be makinng a feature requests thread if there isn't one already.
- Extrementhusiast
- Posts: 1966
- Joined: June 16th, 2009, 11:24 pm
- Location: USA
Re: Accidental data loss despite saving
On another note, some scripts perform activities on that layer, and there is no save prompt. So if you click on the wrong script, there goes all of your hard work past the last save. Either providing a save prompt or opening on a new layer would be preferable to what it is now.
I Like My Heisenburps! (and others)
Re: Accidental data loss despite saving
Saving both gen 0 and the current one wouldn't necessarily solve the problem. You might have loaded a pattern, run it a few gens, made changes, then run it a few more gens. So I've added a warning dialog that says:Sphenocorona wrote:I therefore make this request: in Golly 2.6, either add a confirmation box before saving on a later generation to make sure the user wants to save there and lose the original configuration, or save both gen 0 and the current one.
Saving this generation will not save the changes you made earlier,
so you might want to select Reset or Undo and save those changes.
I suspect this warning will be annoying to most users who are familiar with how Golly works, so people can disable it via a new setting in Prefs > Layer.
Re: Accidental data loss despite saving
Good point. I've made a change so that scripts now obey the "save changes" settings in Prefs > Layer. For example, let's assume you've ticked the option to be asked to save changes on creating a new pattern. If the current layer has changes and you run a script that calls new() then you'll get the standard dialog asking if you want to save those changes. If you cancel the dialog then the script is aborted.Extrementhusiast wrote:On another note, some scripts perform activities on that layer, and there is no save prompt.
Note that you'll only see the save prompt if the script calls new() or open() or dellayer() and the current layer has unsaved changes (ie. there's an asterisk at the start of the layer name) and the corresponding checkbox is ticked.
Re: Accidental data loss despite saving
Is there another and here? If the scripts will now obey Preferences settings, then do you see the save prompt only if you have a check mark in the appropriate spot in Preferences > Layer?Andrew wrote:Note that you'll only see the save prompt if the script calls new() or open() or dellayer() and the current layer has unsaved changes (ie. there's an asterisk at the start of the layer name).
I always turn that checkbox off immediately in a new copy of Golly. I spend too much time running throwaway simulations: copy something in from the forums, run it, see what it does -- done. It wastes too much time to have to answer that question all the time, so I accept the responsibility of saving my work regularly instead.
However, I would really appreciate seeing that prompt any time I'm running a script that will overwrite unsaved work. Most scripts make changes that can be rolled back with the Undo system, but there are a number of painful exceptions. Sample scripts that load or create a pattern, like p1100-MWSS-gun.py (hmm, I wrote that one...) will cavalierly throw away whatever is in the current layer, and then there's no way to recover it.
The worst offender for me is slide-show.py. I can't tell you how many times I've lost a significant amount of work due to a slight mis-click on the Scripts list, just barely hitting slide-show.py instead of shift.py after a long series of careful object moves...!
[I should really settle on a keyboard shortcut to use for shift.py, but that's not the point here. My actual solution has been to add some rude words to the beginning of slide-show.py so that it no longer runs when I click on it.]
Possibly a solution might be to give scripts access to the editing state of the current layer -- golly.getoption("unsavedchanges")? Or include the asterisk in the golly.getname() string? I guess that would probably break existing scripts, though. Anyway, I'd happily volunteer to adjust the standard script collection so that slide-show.py and the other destructive scripts pop up a dialog before throwing anything away. People could still write their own impolite scripts, but at least Golly's scripts wouldn't be modeling bad behavior.
Another separate Preferences > Layer checkbox for scripts would also solve my problem, of course -- I'd happily leave that one checked and turn off all the others. But quite possibly there's a cleaner fix that I haven't thought of.
Re: Accidental data loss despite saving
Correct. I thought that was obvious from the example but I've edited the last sentence to make it explicit.dvgrn wrote: Is there another and here? If the scripts will now obey Preferences settings, then do you see the save prompt only if you have a check mark in the appropriate spot in Preferences > Layer?
If you use File > Open Clipboard to copy in a forum pattern instead of Edit > Paste then you won't get the save prompt as often (only if the current layer has been edited).I always turn that checkbox off immediately in a new copy of Golly. I spend too much time running throwaway simulations: copy something in from the forums, run it, see what it does -- done. It wastes too much time to have to answer that question all the time...
That will no longer happen in 2.6 (assuming the appropriate checkboxes are ticked). If you hit Cancel in the resulting save prompt (or in the following save dialog if you hit Save) then the script is aborted and the current layer is unchanged. I've tested this with all the supplied scripts that load or create a pattern, including slide-show.py.Sample scripts that load or create a pattern, like p1100-MWSS-gun.py (hmm, I wrote that one...) will cavalierly throw away whatever is in the current layer, and then there's no way to recover it.
I thought about doing that but we'd really need 3 new checkboxes to be consistent with the existing checkboxes. I think it's much simpler and cleaner if scripts obey the 3 existing checkboxes. Happy to reconsider this once 2.6 builds are available for testing (hopefully within the next week).Another separate Preferences > Layer checkbox for scripts would also solve my problem ...
Re: Accidental data loss despite saving
There's probably a much simpler solution: modify those scripts so they create a new layer if necessary. For example, your p1100-MWSS-gun.py script could replace the g.new("P1100 gun") line with something like this:dvgrn wrote:Possibly a solution might be to give scripts access to the editing state of the current layer -- golly.getoption("unsavedchanges")? Or include the asterisk in the golly.getname() string? I guess that would probably break existing scripts, though. Anyway, I'd happily volunteer to adjust the standard script collection so that slide-show.py and the other destructive scripts pop up a dialog before throwing anything away.
Code: Select all
title = "P1100 gun"
# check if a layer with this title already exists
layer = -1
for i in xrange(g.numlayers()):
if g.getname(i) == title:
layer = i
break
if layer == -1 and g.numlayers() == g.maxlayers():
g.exit("You need to delete a layer.")
if layer == -1:
layer = g.addlayer() # create a new layer
g.setoption("stacklayers", 0)
g.setoption("tilelayers", 0)
g.setoption("showlayerbar", 1)
else:
g.setlayer(layer) # reuse existing layer
g.new(title)
Re: Accidental data loss despite saving
This only helps if you ensure that all the scripts you have in your script list are well-behaved (or modified to be well-behaved). Other scripts will still have the same problem. Perhaps if any script attempt to make irreversible changes, and the confirmation option is checked, Golly should warn the user of the danger of losing saved work.Andrew wrote:There's probably a much simpler solution: modify those scripts so they create a new layer if necessary. For example, your p1100-MWSS-gun.py script could replace the g.new("P1100 gun") line with something like this:
Re: Accidental data loss despite saving
Yep, Golly 2.6 will do that (ie. scripts will obey the ticked confirmation settings). The script changes I suggested above would be an extra safety feature for people who for some reason prefer not to tick those confirmation settings.mniemiec wrote:Perhaps if any script attempt to make irreversible changes, and the confirmation option is checked, Golly should warn the user of the danger of losing saved work.
Re: Accidental data loss despite saving
Awesome! I noticed that a few of my pet peeve Golly mis-features (step being limited to 10000, and step resetting to 1 on rewind even though it displays a higher number) have magically been fixed in 2.5.Andrew wrote:Yep, Golly 2.6 will do that (ie. scripts will obey the ticked confirmation settings). The script changes I suggested above would be an extra safety feature for people who for some reason prefer not to tick those confirmation settings.mniemiec wrote:Perhaps if any script attempt to make irreversible changes, and the confirmation option is checked, Golly should warn the user of the danger of losing saved work.