copy and paste in diamond tree produces different behaviour when object being pasted to is active or not
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Spud |
Fix Released
|
Low
|
Fraser Waters |
Bug Description
NOTE: all of the above is with the released package of diamond (not any of the bugfix branches on which behaviour may have changed).
- Take the attached schema and options file (dummy.rng and dummy.dml) and open them in diamond.
- Copy the field "Something" (doesn't seem to matter if this is done using CTRL+C or using right-click).
- Activate a new field.
- Paste into the new field and all works well (the modified attribute gets set, the field information appears copied, you can save an reopen and all is well with the world).
Now, repeat but this time don't activate a new field, just paste to an inactive field. With both CTRL+C and right-click I get the terminal error:
Traceback (most recent call last):
File "/usr/lib/
self.
File "/usr/lib/
new_tree = parent_
File "/usr/lib/
self.
ValueError: <diamond.tree.Tree instance at 0x1933998> is not in list
The new field is sort of activated (in that the plus has turned into a minus) but it appears blue (incomplete) and doesn't allow you to drop down the options beneath it. No modified attribute is set and closing doesn't prompt a save and doesn't modify the file.
If you force a save and close and reopen the file then the field now appears to have been copied successfully.
Related branches
- Fraser Waters: Approve
- Patrick Farrell: Approve
- Cian Wilson: Approve
-
Diff: 482 lines (+86/-108)4 files modifieddiamond/diamond/choice.py (+23/-47)
diamond/diamond/interface.py (+41/-29)
diamond/diamond/schema.py (+16/-21)
diamond/diamond/tree.py (+6/-11)
Changed in spud: | |
status: | Confirmed → Fix Released |
This is very odd. The paste code calls the same method as if clicking the + button before doing doing any of it's paste business.