Changeset 7657 in josm for trunk/src/org


Ignore:
Timestamp:
2014-10-27T21:21:47+01:00 (5 years ago)
Author:
Don-vip
Message:

fix #10678 - open edit relation dialog when double clicking on a relation in selection dialog

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/dialogs/SelectionListDialog.java

    r7120 r7657  
    201201                OsmDataLayer layer = Main.main.getEditLayer();
    202202                if (layer == null) return;
    203                 layer.data.setSelected(Collections.singleton(model.getElementAt(idx)));
     203                OsmPrimitive osm = model.getElementAt(idx);
     204                Collection<OsmPrimitive> sel = layer.data.getSelected();
     205                if (sel.size() != 1 || !sel.iterator().next().equals(osm)) {
     206                    // Select primitive if it's not the whole current selection
     207                    layer.data.setSelected(Collections.singleton(osm));
     208                } else if (osm instanceof Relation) {
     209                    // else open relation editor if applicable
     210                    actEditRelationSelection.actionPerformed(null);
     211                }
    204212            } else if (highlightEnabled && Main.isDisplayingMapView()) {
    205213                if (helper.highlightOnly(model.getElementAt(idx))) {
Note: See TracChangeset for help on using the changeset viewer.