Skip to content

Commit

Permalink
Disable the M shortcut for the dialogs and add hint for the `Shift+…
Browse files Browse the repository at this point in the history
…,` shortcut

The `M` shortcut is already used by JOSM core, so that didn't make sense to set it for multiple (!) mapillary dialogs.
The main dialog now displays a hint to press `Shift+,` in order to download Mapillary images from the server.
  • Loading branch information
floscher committed Feb 28, 2017
1 parent 7002ef5 commit 30f5a13
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ private void init() {
}
createHatchTexture();
if (Main.main != null) {
MapillaryMainDialog.getInstance().mapillaryImageDisplay.repaint();
MapillaryMainDialog.getInstance()
.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW)
.put(KeyStroke.getKeyStroke("DELETE"), "MapillaryDel");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,8 @@ public class MapillaryFilterDialog extends ToggleDialog implements MapillaryData
this.signFilter.crossing, this.signFilter.noTurn};

private MapillaryFilterDialog() {
super(tr("Mapillary filter"), "mapillary-filter",
tr("Open Mapillary filter dialog"), Shortcut.registerShortcut(
tr("Mapillary filter"), tr("Open Mapillary filter dialog"),
KeyEvent.VK_M, Shortcut.NONE), 200);
super(tr("Mapillary filter"), "mapillary-filter", tr("Open Mapillary filter dialog"), null, 200,
false, MapillaryPreferenceSetting.class);

this.signChooser.setEnabled(false);
JPanel signChooserPanel = new JPanel();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,8 @@ public final class MapillaryHistoryDialog extends ToggleDialog implements Mapill
private final ConcurrentHashMap<Object, MapillaryCommand> map;

private MapillaryHistoryDialog() {
super(tr("Mapillary history"), "mapillary-history",
tr("Open Mapillary history dialog"), Shortcut.registerShortcut(
tr("Mapillary history"), tr("Open Mapillary history dialog"),
KeyEvent.VK_M, Shortcut.NONE), 200);
super(tr("Mapillary history"), "mapillary-history", tr("Open Mapillary history dialog"), null, 200,
false, MapillaryPreferenceSetting.class);

MapillaryRecord.getInstance().addListener(this);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

import javax.swing.JComponent;

import org.openstreetmap.josm.plugins.mapillary.MapillaryLayer;
import org.openstreetmap.josm.plugins.mapillary.utils.MapillaryProperties;

/**
Expand Down Expand Up @@ -368,7 +369,7 @@ public void paintComponent(Graphics g) {
}
if (image == null) {
g.setColor(Color.black);
String noImageStr = tr("No image");
String noImageStr = MapillaryLayer.hasInstance() ? tr("No image selected") : tr("Press Shift+, to download images");
Rectangle2D noImageSize = g.getFontMetrics(g.getFont()).getStringBounds(
noImageStr, g);
Dimension size = getSize();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
import java.awt.Color;
import java.awt.Component;
import java.awt.event.ActionEvent;
import java.awt.event.KeyEvent;
import java.awt.image.BufferedImage;
import java.io.ByteArrayInputStream;
import java.io.IOException;
Expand Down Expand Up @@ -99,10 +98,8 @@ public enum MODE {
private MapillaryCache thumbnailCache;

private MapillaryMainDialog() {
super(tr(BASE_TITLE), "mapillary-main", tr("Open Mapillary window"),
Shortcut.registerShortcut(tr("Mapillary dialog"),
tr("Open Mapillary main dialog"), KeyEvent.VK_M, Shortcut.NONE),
200, false, MapillaryPreferenceSetting.class);
super(tr(BASE_TITLE), "mapillary-main", tr("Open Mapillary window"), null, 200,
true, MapillaryPreferenceSetting.class);
addShortcuts();
this.mapillaryImageDisplay = new MapillaryImageDisplay();

Expand Down

0 comments on commit 30f5a13

Please sign in to comment.