Changeset 13973 in josm for trunk/src


Ignore:
Timestamp:
2018-06-24T19:50:06+02:00 (13 months ago)
Author:
Don-vip
Message:

fix #15707 - NoSuchElementException at remotecontrol.AddTagsDialog (patch by skorbut, modified)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/io/remotecontrol/handler/LoadAndZoomHandler.java

    r13929 r13973  
    1313import java.util.Set;
    1414import java.util.concurrent.Future;
     15
     16import javax.swing.JOptionPane;
    1517
    1618import org.openstreetmap.josm.actions.AutoScaleAction;
     
    3133import org.openstreetmap.josm.gui.MainApplication;
    3234import org.openstreetmap.josm.gui.MapFrame;
     35import org.openstreetmap.josm.gui.Notification;
    3336import org.openstreetmap.josm.gui.util.GuiHelper;
    3437import org.openstreetmap.josm.io.remotecontrol.AddTagsDialog;
     
    192195                }
    193196                toSelect.clear();
    194                 isKeepingCurrentSelection = false;
    195197                ds.setSelected(newSel);
    196198                zoom(newSel, bbox);
     
    235237        }
    236238
    237         AddTagsDialog.addTags(args, sender, forTagAdd);
     239        // add tags to objects
     240        if (args.containsKey("addtags")) {
     241            // needs to run in EDT since forTagAdd is updated in EDT as well
     242            GuiHelper.executeByMainWorkerInEDT(() -> {
     243                if (!forTagAdd.isEmpty()) {
     244                    AddTagsDialog.addTags(args, sender, forTagAdd);
     245                } else {
     246                    new Notification(isKeepingCurrentSelection
     247                            ? tr("You clicked on a JOSM remotecontrol link that would apply tags onto selected objects.\n"
     248                                    + "Since no objects have been selected before this click, no tags were added.\n"
     249                                    + "Select one or more objects and click the link again.")
     250                            : tr("You clicked on a JOSM remotecontrol link that would apply tags onto objects.\n"
     251                                    + "Unfortunately that link seems to be broken.\n"
     252                                    + "Technical explanation: the URL query parameter ''select='' or ''search='' has an invalid value.\n"
     253                                    + "Ask someone at the origin of the clicked link to fix this.")
     254                        ).setIcon(JOptionPane.WARNING_MESSAGE).setDuration(Notification.TIME_LONG).show();
     255                }
     256            });
     257        }
    238258    }
    239259
Note: See TracChangeset for help on using the changeset viewer.