CLI undo edit?

Derek Atkins warlord at MIT.EDU
Thu Aug 25 17:15:48 EDT 2005


Quoting Neil Williams <linux at codehelp.co.uk>:

> On Thursday 25 August 2005 9:21 pm, Derek Atkins wrote:
>> Do you really need to keep track of the operations individually?
>
> Not particularly, it just seemed handy to use an enum initially - I was
> thinking that a switch() statement was going to be needed later. I was
> planning to differentiate a MODIFY from a CREATE but I think that was just a
> hangover from tying the undo idea to events and dirty instances.

Okay.  Well, this is why it's good to talk things over before we write 
code.  ;)
IMHO this is a simpler API :)

>> I would think a much better API would be:
>>   QofOperation qof_book_start_operation(QofBook* book, const char
>> *op_name); void qof_book_end_operation(QofOperation oper);
>
> Makes sense.
>
>> At least that's my take on it all.
>
> What about the number of undo operations to hold relative to the number of
> changes per operation?
>
> It's not a problem for the CLI implementation, it's more for the future.

My personal feeling is that there should be an unlimited number of changes per
operation, but a limited number of operations that are remembered.  Undo/Redo
is per operation, so you should limit that.  But if you have an import
operation it would be BAD if the undo buffer couldn't remember the 
whole import
in order to undo it!

-derek
-- 
       Derek Atkins, SB '93 MIT EE, SM '95 MIT Media Laboratory
       Member, MIT Student Information Processing Board  (SIPB)
       URL: http://web.mit.edu/warlord/    PP-ASEL-IA     N1NWH
       warlord at MIT.EDU                        PGP key available



More information about the gnucash-devel mailing list