Modify

Opened 5 years ago

Closed 5 years ago

Last modified 5 years ago

#12357 closed enhancement (fixed)

[patch] copy tags shortcut

Reported by: kolesar Owned by: team
Priority: normal Milestone: 16.02
Component: Core shortcuts Version: latest
Keywords: copy tags Cc:

Description

Copying tags from the currently selected object(s) is very common in my workflow. First time I have tried simple Edit/Copy (Ctrl+C), result was:

  way 283084976

Then I have found "Copy all Keys/Values" at properties dialog but many times I have selected a wrong menu item there. Finally I took to click into properties, Ctrl+A, Ctrl+C. This was better than right-click on a tag and find the appropriate menu item.

Today I have created a menu item for copying tags: Edit / Copy Tags (Ctrl+Shift+T).

I have moved existing logic of copying tags from PropertiesDialog to AbstractPrimitive. Appended keyboard shortcut to popup menu of PropertiesDialog. In the same menu there was a hardcoded shortcut (F1), modified to reflect customized keyboard shortcuts.

Attached patch.

Attachments (2)

CopyTagsAction.patch (10.0 KB) - added by kolesar 5 years ago.
CopyTagsShortcut.patch (910 bytes) - added by kolesar 5 years ago.

Download all attachments as: .zip

Change History (23)

Changed 5 years ago by kolesar

Attachment: CopyTagsAction.patch added

comment:1 Changed 5 years ago by simon04

+1 for the "Copy Tags". Some remarks:

  • Unfortunately, almost any shortcut is already taken, see DevelopersGuide/ShortcutsList
  • @since 404 in CopyTagsAction is not correct ;), leave it out when unknown
  • The name AbstractPrimitive#getTagsAsString is rather confusing since it returns a list. When adding the Tag class to AbstractPrimitive, it should be used throughout, i.e., there should be an put(Tag), etc. For now, I would add the required methods to CopyTagsAction, and use it from there for "Copy all Keys/Values".

comment:2 Changed 5 years ago by stoecker

How's that different from PasteTags action where you copy the objects, but only paste the tags?

comment:3 Changed 5 years ago by simon04

The idea of "Copy Tags" is to have the tags copied to the clipboard for use in other applications.

comment:4 Changed 5 years ago by stoecker

This is an utilsplugin change in this case. Should not be in the core (except for the cleanup parts).

Last edited 5 years ago by stoecker (previous) (diff)

comment:5 Changed 5 years ago by kolesar

Why do you relate this to utilsplugin? Core contains copy coordinates and paste tags. This action is closely related to them.

comment:6 Changed 5 years ago by stoecker

The amount of features in core should not be too much. That reduces usability and we already have so many functions in core. utilsplugin is the place for "nice to have" features which aren't important enough to fit into core.

comment:7 Changed 5 years ago by kolesar

Should I create a new ticket or simply modify component to utilsplugin2?

comment:8 Changed 5 years ago by simon04

Since we already have this feature in core (context menu in tags toggle dialog), I support this patch to bring it to a more prominent location in the edit menu.

We only have to find a shortcut ;).

comment:9 in reply to:  8 Changed 5 years ago by kolesar

Replying to simon04:

Since we already have this feature in core (context menu in tags toggle dialog), I support this patch to bring it to a more prominent location in the edit menu.

We only have to find a shortcut ;).

Thank you for support. Ctrl+Shift+T is free in ShortcutsList.

comment:10 Changed 5 years ago by simon04

CMD+SHIFT+T: Unfortunately not – it is used in the reverter plugin …

comment:11 in reply to:  10 ; Changed 5 years ago by bastiK

I'm slightly in favor of the patch.

Replying to simon04:

CMD+SHIFT+T: Unfortunately not – it is used in the reverter plugin …

"Tool: Revert changeset" - Who needs a shortcut for that? We should assert some dominance and reclaim shortcuts from plugins. ;)

comment:12 in reply to:  11 Changed 5 years ago by kolesar

Replying to bastiK:

"Tool: Revert changeset" - Who needs a shortcut for that? We should assert some dominance and reclaim shortcuts from plugins. ;)

Sorry, I have searched only Ctrl+Shift+T there, not Cmd.

I have used revert changeset only once but I copy tags of objects many times per day. I think many people have similar use case. Key T is related closer to Tag than Revert.

comment:13 Changed 5 years ago by stoecker

I'm still against including that in core. If you use it that much or not does not count. Question is if others use it that much or not and most JOSM users probably do not copy information from or to other applications. So this option will further clutter the Edit menu without an advantage to the majority of our users. As we already have that feature in core the need is further reduced.

Move it to utilsplugin where it belongs.

comment:14 Changed 5 years ago by kolesar

What do you think about assigning a shortcut to existing action on properties dialog without an additional entry in Edit menu?

comment:15 in reply to:  14 ; Changed 5 years ago by stoecker

Replying to kolesar:

What do you think about assigning a shortcut to existing action on properties dialog without an additional entry in Edit menu?

Two sides:
a) Having shortcuts for core actions is in principle fine
b) Adding shortcuts for core actions further limits the chances of plugins which is not fine.

Adding an unassigned shortcut is no issue and should always be done when useful. Each user can set it himself to any key in prefs. If that is not done yet in this case it should be fixed.

I agree that having this or that is always nice, but JOSM is already feature overloaded and we need to take care that we don't overdo it.

Changed 5 years ago by kolesar

Attachment: CopyTagsShortcut.patch added

comment:16 in reply to:  15 Changed 5 years ago by kolesar

Replying to stoecker:

Divided last patch to parts as suggested:

  1. Assigned empty shortcut system:copytags to "copy all keys/values" in context menu of properties dialog. Feature was already in the core, now keyboard shortcut can be customized by user to any value. Attached new patch to this ticket.
  1. Added entry in Edit menu to utilsplugin2 with the same shortcut: #12398.
  1. Moved modifications on help item of the same menu into a separate patch: #12395.

I hope you will accept these changes.

comment:17 Changed 5 years ago by kolesar

Summary: [patch] copy tags action[patch] copy tags shortcut

comment:18 Changed 5 years ago by stoecker

Sounds all fine to me.

comment:19 Changed 5 years ago by Don-vip

Component: CoreCore shortcuts
Keywords: copy tags added
Milestone: 16.02

comment:20 Changed 5 years ago by Don-vip

Resolution: fixed
Status: newclosed

In 9592/josm:

fix #12357 - copy tags shortcut (patch by kolesar)

comment:21 Changed 5 years ago by rickmastfan67

The fix in #12398 introduced some 'Registered toolbar action' bugs. See #12470.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain team.
as The resolution will be set.
The resolution will be deleted.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.