Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add clipboard functionality (cut/copy/paste) to symbol and package editors #442

Merged
merged 11 commits into from Apr 18, 2019

Conversation

2 participants
@ubruhin
Copy link
Member

commented Apr 16, 2019

This implements the clipboard functionality for the library editor. It allows to copy symbol elements (pins, polygons etc.) between symbols, and footprint elements (pads, polygons etc.) between packages. This also works across different libraries, i.e. it's possible to copy elements from one library to another.

I even spent some time to copy the elements as an image to the clipboard, so after pressing CTRL+C you have nice images like these in your clipboard:

grafik grafik

Isn't this cool? 馃榿

The only problem so far is that footprint pads can't be pasted if there is no corresponding package pad available, or if it is already used. That's a limitation of the current file format (a footprint pad must be assigned to a package pad). This might be fixed in a future file format version...

Fixes the first two tasks of #13.

@ubruhin ubruhin added this to the 0.1.1 milestone Apr 16, 2019

@ubruhin ubruhin self-assigned this Apr 16, 2019

@dbrgn

This comment has been minimized.

Copy link
Member

commented Apr 17, 2019

Isn't this cool?

Haha, awesome!

The only problem so far is that footprint pads can't be pasted if there is no corresponding package pad available, or if it is already used.

But if there are 8 package pads available, and you create a footprint pad, can you copy-paste that 7 times so that it uses the next free package pad every time?

@ubruhin

This comment has been minimized.

Copy link
Member Author

commented Apr 17, 2019

But if there are 8 package pads available, and you create a footprint pad, can you copy-paste that 7 times so that it uses the next free package pad every time?

No, currently not. Basically because it could be dangerous as the user don't see to which package pad a footprint pad is connected to. The only way to see it is to open the pad properties dialog. So the pads might not be connected to the package pad you would expect. In addition, it's not clear which the "next free package pad" is - what order of pads should be used?

I'm not sure which variant would be better:

  1. Always choose a "next free package pad", with the risk that it's not the one you would expect.
  2. Don't paste the pin if no exactly matching pad is available, with the drawback that sometimes pasting is not possible, and it feels like a bug - but it's always safe.

I decided to go with variant 2. Would you prefer variant 1 @dbrgn?

@ubruhin ubruhin added this to In Progress in Improve user experience of GUI Apr 17, 2019

@dbrgn

This comment has been minimized.

Copy link
Member

commented Apr 18, 2019

Yeah, maybe 2 is the safe choice for now.

I think it would be good if pads could be unconnected (with a big warning/error in the messages list). One reason for that is that right now you can't swap two package pads because you cannot temporarily disconnect one of them, and you can't have two footprint pads with the same package pad either.

@ubruhin

This comment has been minimized.

Copy link
Member Author

commented Apr 18, 2019

Yep, that's what I mean with the file format limitation ;) Once this limitation is removed, copy&paste of pads can be improved.

@ubruhin ubruhin merged commit 2d31682 into master Apr 18, 2019

4 checks passed

continuous-integration/appveyor/branch AppVeyor build succeeded
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details

@ubruhin ubruhin deleted the 13-implement-clipboard branch Apr 18, 2019

@ubruhin ubruhin moved this from In Progress to Done in Improve user experience of GUI Apr 19, 2019

ubruhin added a commit that referenced this pull request Apr 19, 2019

Merge pull request #442 from LibrePCB/13-implement-clipboard
Add clipboard functionality (cut/copy/paste) to symbol and package editors
(cherry picked from commit 2d31682)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can鈥檛 perform that action at this time.