Paste after copy preserves locked status of items

Bug #1851038 reported by Franck78
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
KiCad
Fix Released
Low
Jeff Young

Bug Description

Mouse select a region of your PCB
Right click 'copy', select center, ok.

Paste it somewhere and Kicad asks "Selection contains locked items. Do you want to continue?"

Yes, of course I want to copy my selection !

Application: KiCad
Version: 5.1.4, release build
Libraries:
    wxWidgets 3.0.2
    libcurl/7.37.0 OpenSSL/1.0.2j zlib/1.2.8 libidn/1.28 libssh2/1.4.3
Platform: Linux 4.4.180-102-default x86_64, 64 bit, Little endian, wxGTK
Build Info:
    wxWidgets: 3.0.2 (wchar_t,STL containers,compatible with 2.8) GTK+ 2.24
    Boost: 1.61.0
    OpenCASCADE Community Edition: 6.9.1
    Curl: 7.37.0
    Compiler: GCC 4.8.5 with C++ ABI 1002

Build settings:
    USE_WX_GRAPHICS_CONTEXT=OFF
    USE_WX_OVERLAY=OFF
    KICAD_SCRIPTING=ON
    KICAD_SCRIPTING_MODULES=ON
    KICAD_SCRIPTING_PYTHON3=OFF
    KICAD_SCRIPTING_WXPYTHON=ON
    KICAD_SCRIPTING_WXPYTHON_PHOENIX=OFF
    KICAD_SCRIPTING_ACTION_MENU=ON
    BUILD_GITHUB_PLUGIN=ON
    KICAD_USE_OCE=ON
    KICAD_USE_OCC=OFF
    KICAD_SPICE=OFF

Tags: pcbnew
Revision history for this message
Jeff Young (jeyjey) wrote :

At the end of the Paste command we call the Move command so that you can place the pasted objects. The Move command is complaining about the locked objects.

There are 2 ways to fix this: special case the move-after-a-paste, or clear the lock flags on a paste.

So the question is, if you copy and paste some locked items, do you expect the pasted items to be locked or not? At first blush I'd say "yes", but then our definition of "locked" is locked to a particular position, and clearly the pasted objects are no longer at that position.

Thoughts?

Changed in kicad:
assignee: nobody → Jeff Young (jeyjey)
importance: Undecided → Low
Revision history for this message
Seth Hillbrand (sethh) wrote :

@Jeff- I'd expect footprints to retain their locked pad status but none of the items to retain their full locked status for the reason you listed. Same for duplicate, incidentally.

Changed in kicad:
milestone: none → 5.1.6
summary: - Paste ask uneeded question
+ Paste after copy preserves locked status of items
Revision history for this message
jean-pierre charras (jp-charras) wrote :

I agree with Seth.
"past preserves locked status of items" is a questionable option.

Revision history for this message
Franck78 (fbourdonnec) wrote :

Jeff wrote "There are 2 ways to fix this: special case the move-after-a-paste, or clear the lock flags on a paste."

Or let a function do her job without UI interactivity not stricly needed.

It is the caller's responsibility to check a move can be done or not.

Probably the same way you 'set' what is in the contextual menu at the end of the region select.

Jeff Young (jeyjey)
Changed in kicad:
status: New → In Progress
Revision history for this message
KiCad Janitor (kicad-janitor) wrote :

Fixed in revision fae86d4dd06b93f3da6cc4be14aea64709cd686d
https://git.launchpad.net/kicad/patch/?id=fae86d4dd06b93f3da6cc4be14aea64709cd686d

Changed in kicad:
status: In Progress → Fix Committed
Revision history for this message
Ian McInerney (imcinerney) wrote :

This is one of the commits that slipped into the 5.1.5-rc1 by accident, so I am retargetting it to 5.1.5.

Changed in kicad:
milestone: 5.1.6 → 5.1.5
Changed in kicad:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.