CLI undo edit?

David Hampton hampton-gnucash at rainbolthampton.net
Sun Aug 7 11:58:04 EDT 2005


On Sun, 2005-08-07 at 00:04 +0100, Neil Williams wrote:

> A list would be more flexible - undo lists have to be sequential so a generic 
> qof_undo() would need a single GList of all changes and rolling such a list 
> in strict sequential order back and forth (i.e. a redo as well as undo) is 
> far faster than iterating / searching.

My vote would be for a single unro/redo list.  I think a list per entity
would be very confusing, and it would require exposing the internals of
gnucash (the entity) to all users so they can understand how to use the
undo functionality.

> A Timespec in qof_undo would solve David's request for a time since first 
> change too. Simply read the first value in the GList and return ts or 
> ts.tv_sec.

:-)

> Each would return silently if the end of the list is reached in the 
> appropriate direction. Maybe they should return gboolean so that the UI can 
> tell if more steps are available? Or should that be a separate function:
> gboolean qof_can_undo(); gboolean qof_can_redo();
> Both would return FALSE after a save operation.

The UI must be able to find out if there are items available for
undo/redo.  It needs to provide this information to the user by
correctly dimming the Undo and Redo menu items.

David





More information about the gnucash-devel mailing list