← Back to team overview

openshot.developers team mailing list archive

Re: undo-redo system

 

I've made a proof-of-concept implementation in a branch:

lp:~francesco-hermanitosverdes/openshot/francesco_undo_redo_test

apparently it can be done, and it seems fast enough, but it must be
further investigated.

hope someone with better knowledge than me can review the code and see
if it is worth going on in this direction.

ciao, francesco




Il giorno gio, 21/01/2010 alle 10.33 +0000, Andy Finch ha scritto:
> The link below uses a stack/list, but keeps it in memory (using a
> python list object) rather than writing to disk, so it is essentially
> the same thing in principle. 
> 
> What I do like the idea of is to write to disk a separate 'backup' of
> the project file, perhaps using an autosave, so in the event of a
> crash or some other event that corrupts the project file, there is the
> option to restore back to one of the previous backup copies. But
> that's a different discussion I guess.
>  
> But I must admit I'm no expert in things like this, I was just having
> a browse around to see how other pygtk apps handle undo :-)
> 
> Cheers,
> Andy.
> 
> 2010/1/21 francesco fantoni <francesco@xxxxxxxxxxxxxxxxxxxx>
>         I was considering an approach similar to what is used in
>         saving project
>         file:
>         using cPickle to create a "state" of project object (written
>         to a
>         StringIO object), and inserted in a "history" stack/list.
>         This way we could have a undo/redo system, but a history
>         system as well,
>         with the possibility to go back to any previous state of the
>         working
>         session, and besides it would use a rather simple trick, with
>         parts of
>         code already implemented.
>         History stack size can be limited to a certain number of
>         stages with
>         user preferences system, or set to a reasonable hardcoded
>         value.
>         With some work on set_project_modified() function that can
>         trigger
>         project's state storing action...
>         The doubts I have are about memory usage (not a great issue I
>         suppose
>         using binary protocol of cpickle and with a stack limited to
>         e.g. 10
>         passes) and speed (but cPickle and cStringIO are supposed to
>         be rather
>         fast)
>         what do you think?
>         
>         francesco
>         
>         
>         Il giorno gio, 21/01/2010 alle 09.56 +0000, Andy Finch ha
>         scritto:
>         
>         > I haven't, I've been looking at other stuff. Although I have
>         been
>         > looking around recently at how undo is done in python and
>         came across
>         > this, which may help:
>         >
>         > http://www.nongnu.org/skencil/doc.html
>         >
>         > then follow the link to the undo documentation:
>         >
>         > http://www.nongnu.org/skencil/Doc/devguide-19.html#N1
>         >
>         > Cheers,
>         > Andy.
>         >
>         > 2010/1/21 francesco fantoni <francesco@xxxxxxxxxxxxxxxxxxxx>
>         >         just to know, has someone already started working on
>         the
>         >         undo/history
>         >         thing?
>         >
>         >         best to all,
>         >         francesco
>         >         --
>         >         architetto Francesco Fantoni
>         >         <HVA - Hermanitos Verdes Architetti>
>         >         l.go san giacomo, 38
>         >         I-41100 modena (italia)
>         >         tel.& fax. +39.059.217554
>         >         skype:  hva_studio
>         >         e.mail: francesco@xxxxxxxx
>         >         web:    http://www.hv-a.com
>         >
>         >
>         >         _______________________________________________
>         >         Mailing list:
>         https://launchpad.net/~openshot.developers
>         >         Post to     :
>         openshot.developers@xxxxxxxxxxxxxxxxxxx
>         >         Unsubscribe :
>         https://launchpad.net/~openshot.developers
>         >         More help   : https://help.launchpad.net/ListHelp
>         >
>         
>         --
>         
>         architetto Francesco Fantoni
>         <HVA - Hermanitos Verdes Architetti>
>         l.go san giacomo, 38
>         I-41100 modena (italia)
>         tel.& fax. +39.059.217554
>         skype:  hva_studio
>         e.mail: francesco@xxxxxxxx
>         web:    http://www.hv-a.com
>         
>         
> 
-- 
architetto Francesco Fantoni
<HVA - Hermanitos Verdes Architetti>
l.go san giacomo, 38
I-41100 modena (italia)
tel.& fax. +39.059.217554
skype:  hva_studio
e.mail: francesco@xxxxxxxx
web:    http://www.hv-a.com




Follow ups

References