-
Notifications
You must be signed in to change notification settings - Fork 464
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’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add "Duplicate" button to duplicate display with same config #977
Conversation
ping |
This seems like a very useful addition. Havent tested it, but high level review lgtm. |
@wkentaro thanks for the pr, this is a great feature! I didn't, however, get a new display name (copy of ...) and so I opened a pull request for that: wkentaro#1 Also I'd like to ask you to consider changing the use of the term "copy" with "duplicate". Since you're not exactly copying it in the sense of copy and then paste zero to many times. You're really duplicating an item exactly one time. So if you choose to do "duplicate" instead of "copy", then I'd recommend changing the new display name to be "duplicate of X", change the button to "duplicate" rather than "copy" and consider changing the hotkey of ctrl-c to ctrl-d (or something like that). Thanks again. |
I rethought about the name of copied display, and changed it to be same as the original one. |
It's reasonable, I use "duplicate" term. |
@wjwwood I have updated the commit. |
@wkentaro looks good thanks. I'm testing it out now. As for the new name, I think having something different is a good idea, but I think a suffix or prefix that is too long might not be best, e.g. "duplicate of X" or "X duplicate" or even "X dupe". I thought about suffixing numbers, e.g. "X (1)", then "X (2)", but the logic to get this right is tricky (and to avoid overmatching something the user created). Something simple could be to use the mathematical prime symbol to indicate a duplicate: https://en.wikipedia.org/wiki/Prime_(symbol) That would be easy to implement as you just add a single quote to the end of the name. Anyone else have thoughts? |
I woudn't mind having the duplicates with the exact same name. That is what rviz does already when adding new displays. It defaults to the same name no matter if it exists already or not. But I am not strongly attached to that and all your suggestions seem fine to me, with a preference for a short suffix. I actually think the |
Yeah, there's more issues with the changing of names (as @wkentaro may have discovered and finally decided not to do that). For example, nothing stops you from duplicating I'm thinking of going back to just duplicating it and not changing the name. I also have a change locally that will ensure the duplicated item(s) are selected after duplication. |
@wkentaro I opened wkentaro#2 against this pr. I might do the merge myself later today. |
@wkentaro I merged this manually with a few changes about what is selected after duplicating and deleting displays. Thanks again! |
Demo: https://youtu.be/FxUOrkBzVzs
1
2
3