fracte / keepnote

Automatically exported from code.google.com/p/keepnote
0 stars 0 forks source link

Create backup copy of files before saving #307

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
It would be great if the editor could make .bak files when saving, or at least 
have the option to do so.  For example, once I accidentally deleted a bunch of 
text (bumped the touchpad), then my file was auto saved, and gtkspell crashed 
the program before I could hit undo, so I lost that text.

Or even better, one could add something like this to KeepNoteEditor.save(), 
just after the try statement (editor.py, line 240):

# archive the old file
old = datetime.datetime.now().strftime("%Y-%m-%d_%H-%M-%S.html")
old = self._page.get_path() + os.sep + old
os.rename(self._page.get_data_file(), old)

Eclipse does this behind the scenes for all files < 1 MB (see attached), and 
cleans up old backup files on shutdown.  I think these three settings would be 
really nice for KeepNote as well, and have the added benefit of revision 
history if the user sets them high enough.

Original issue reported on code.google.com by csmayfi...@gmail.com on 10 Jul 2010 at 9:31

Attachments:

GoogleCodeExporter commented 8 years ago

Original comment by matt.rasmus@gmail.com on 19 Jul 2010 at 6:18