← Back to team overview

kicad-developers team mailing list archive

Re: Eeschema replace impasse.


On 12/7/2011 2:35 AM, jean-pierre charras wrote:
> Le 06/12/2011 17:12, Wayne Stambaugh a écrit :
>> I am pretty close to completing the Eeschema replace code but I ran into an
>> issue with the undo/redo behavior that I know will confuse users.  The problem
>> lies in that the screen associated with each sheet keeps it's own undo/redo
>> list.  This means that you must open the sheet that you want to perform the
>> undo/redo for that sheet.  My issue is that I designed the find and replace
>> code to allow for descending the entire schematic hierarchy when performing
>> find and replace.  I know this will cause confusion because users will expect
>> to be able to undo all of the replace actions from the current sheet which what
>> I would expect to happen.  Changing the undo/redo feature to support the whole
>> schematic hierarchy will be a non-trivial task and possibly result in user
>> backlash do to the change in bahavior.  So I am left with the following options
>> on the replace feature:
>> 1) Leave it as is and live with the user complaints about having to open each
>> sheet to undo the replace changes.
>> 2) Shelve it until the undo/redo feature can be changed and live with the user
>> confusion caused by the change in the undo/redo behavior.
>> 3) Leave the undo/redo behavior as is and limit the replace feature to the
>> current sheet and live with the complaints as why the user cannot replace the
>> entire hierarchy when you can search the entire hierarchy.
>> I'm leaning toward option 2 but that may push the replace feature out quite
>> ways.  The replace feature is pretty useful as it is right now so some folks
>> may be willing to live with the undo/redo issue.  Anyone else have any thoughts
>> on this?  Thanks in advance.
>> Wayne
> This is rather tricky...
> Text editors that have such feature (search/replace in all loaded files) have
> the same issue.
> I tested a text editor that have this feature: it uses the option 1.

This is what I currently have implemented and I'm fine with committing it as
is.  I just found it odd that I can replace items in the entire hierarchy but I
have to open each sheet individually to undo to the changes.  Maybe I'm being
overly paranoid and no one will complain about the undo issue.  I could always
go back an change the undo/redo behavior later if it is an issue.

> Is the option 2 possible?
> One can undo/redo only the last command.
> So what happen if you undo the last replace all command from a sheet,
> when for an other sheet this is not the last command (i.e. when the last
> command to undo differs between sheets)?

This would require modifying the schematic undo/redo list to include the sheet
path for each item so that each undo/redo would load the correct sheet to
perform the undo/redo against.  It would be similar to how I designed the