Changeset 18768 in josm for trunk/src/org/openstreetmap


Ignore:
Timestamp:
2023-06-22T23:12:56+02:00 (13 months ago)
Author:
taylor.smock
Message:

Fix #22534: Inform users when the clipboard has too much data

Location:
trunk/src/org/openstreetmap/josm
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/actions/mapmode/SelectAction.java

    r18767 r18768  
    786786            startEN = currentEN; // drag can continue after scaling/rotation
    787787
    788             if (mode != Mode.ROTATE && mode != Mode.SCALE || SwingUtilities.isRightMouseButton(mouseEvent)) {
     788            if ((mode != Mode.ROTATE && mode != Mode.SCALE) || SwingUtilities.isRightMouseButton(mouseEvent)) {
    789789                return false;
    790790            }
  • trunk/src/org/openstreetmap/josm/gui/dialogs/OsmIdSelectionDialog.java

    r18208 r18768  
    3030import org.openstreetmap.josm.data.osm.SimplePrimitiveId;
    3131import org.openstreetmap.josm.gui.ExtendedDialog;
     32import org.openstreetmap.josm.gui.Notification;
    3233import org.openstreetmap.josm.gui.datatransfer.ClipboardUtils;
    3334import org.openstreetmap.josm.gui.widgets.HistoryComboBox;
     
    222223        String buf = ClipboardUtils.getClipboardStringContent();
    223224        if (Utils.isEmpty(buf)) return;
    224         if (buf.length() > Config.getPref().getInt("downloadprimitive.max-autopaste-length", 2000)) return;
     225        final int maxPasteLength = Config.getPref().getInt("downloadprimitive.max-autopaste-length", 2000);
     226        if (buf.length() > maxPasteLength) {
     227            new Notification(tr("Clipboard has more than {0} characters. Not auto-pasting.\n" +
     228                    "You may want to use Overpass instead.", maxPasteLength))
     229                    .setIcon(JOptionPane.WARNING_MESSAGE)
     230                    .show();
     231            return;
     232        }
    225233        final List<SimplePrimitiveId> ids = SimplePrimitiveId.fuzzyParse(buf);
    226234        if (!ids.isEmpty()) {
Note: See TracChangeset for help on using the changeset viewer.