So I found out that the QUndoStack automatically calls the redo method on commands when they are pushed onto the stack. This is actually nice because it saves you from writing a bit of code for every command. Anyways, that's why there were two objects being created. So now the command works correctly. It is only for creating a new object and deleting it on undo though. We need a separate command for editing an object's text value, which is created in the GobjTextInput.__end_editing method. That way all editing operations result in an undoable command.
I pushed the small change to not create two objects. Now I'll go through and refactor what's already working so that the functionality is implemented in commands. -Jeff Tim Blechmann wrote: > ok ... i had a look at your patch ... it doesn't really work, yet ... > > the flow of operations for creating an object is: > > 1. create empty object box (PatcherCanvasScene.mouseDoubleClickEvent) > 2. connect object box to the engine (GobjTextInput.__end_editing) > 3. notification callback is called after object creation is successful > (interpreter.new_connection_callback) or failed > (interpreter.object_creation_failure) > > the undo operation if the creation should be > PatcherGobj.schedule_removal in any case ... > the redo operation needs to combine the points (1) and (2), though ... > > also i found, that after creating objects in your branch, i get two > object boxes ... one initialized and one uninitialized ... > > i know, the whole architecture is not very well documented, yet :) > > cheers, tim > > -- > [EMAIL PROTECTED] ICQ: 96771783 > http://tim.klingt.org > > The price an artist pays for doing what he wants is that he has to do > it. > William S. Burroughs _______________________________________________ nova-dev mailing list [email protected] http://klingt.org/cgi-bin/mailman/listinfo/nova-dev http://tim.klingt.org/nova
