Skip to content

Commit

Permalink
add shortcut parsing hints
Browse files Browse the repository at this point in the history
  • Loading branch information
stoecker committed Nov 30, 2024
1 parent a04618b commit 0c4a889
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ public ImageColorPicker() {
colorPanel.setPreferredSize(new Dimension(COLOR_AREA, COLOR_AREA));
tempColorPanel.setPreferredSize(new Dimension(COLOR_AREA, COLOR_AREA));

/* SHORTCUT(Mapillary: Copy color, mapillary:copy_to_clipboard_Copy_color, CHAR_UNDEFINED, NONE) */
copyAction = new ClipboardAction(tr("Copy color"), tr("Copied color to clipboard"), null);
final MapillaryButton copyButton = new MapillaryButton(copyAction, true);
copyAction.setPopupParent(copyButton);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ public class ClipboardAction extends MapillaryAction {
public ClipboardAction(final String name, final String successMessage, final Transferable contents) {
super(tr(name), "copy", tr("Copy {0} to clipboard", tr(name)),
Shortcut.registerShortcut("mapillary:copy_to_clipboard_" + name.replace(' ', '_'),
/* NO-SHORTCUT - add definition in classes using ClipboardAction */
tr("Mapillary: {0}", tr(name)), KeyEvent.CHAR_UNDEFINED, Shortcut.NONE),
false, "mapillary:copy_to_clipboard_" + name.replace(' ', '_'), false);
this.contents = contents;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,10 +122,12 @@ private ImageInfoPanel() {

imgLinkAction = new WebLinkAction(marktr("View in browser"), null);

/* SHORTCUT(Mapillary: Copy URL, mapillary:copy_to_clipboard_Copy_URL, CHAR_UNDEFINED, NONE) */
copyImgUrlAction = new ClipboardAction(marktr("Copy URL"), tr("Copied URL to clipboard …"), null);
final var copyUrlButton = new MapillaryButton(copyImgUrlAction, true);
copyImgUrlAction.setPopupParent(copyUrlButton);

/* SHORTCUT(Mapillary: Copy key, mapillary:copy_to_clipboard_Copy_key, CHAR_UNDEFINED, NONE) */
copyImgKeyAction = new ClipboardAction(marktr("Copy key"), tr("Copied key to clipboard …"), null);
final var copyKeyButton = new MapillaryButton(copyImgKeyAction, true);
copyImgKeyAction.setPopupParent(copyKeyButton);
Expand Down

0 comments on commit 0c4a889

Please sign in to comment.