Changeset 16557 in josm


Ignore:
Timestamp:
2020-06-07T15:42:48+02:00 (4 years ago)
Author:
GerdP
Message:

fix #19346: Automatically select newly created multipolygons

  • if a new multipolygon relation is created, select the multipolygon only, but if preference multipoly.show-relation-editor is set to true keep the ways selected.
  • if Update multipolygon (Ctrl+Shift+B) is used, don't change the selection, but if preference multipoly.show-relation-editor is set to true remove the updated relation from the selection before opening the relation editor.
File:
1 edited

Legend:

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

    r16554 r16557  
    115115            // to avoid EDT violations
    116116            SwingUtilities.invokeLater(() -> {
    117                     UndoRedoHandler.getInstance().add(command);
     117                UndoRedoHandler.getInstance().add(command);
    118118                final Relation relation = (Relation) MainApplication.getLayerManager().getEditDataSet()
    119119                        .getPrimitiveById(commandAndRelation.b);
     120                if (relation == null || relation.getDataSet() == null)
     121                    return; // should not happen
    120122
    121123                // Use 'SwingUtilities.invokeLater' to make sure the relationListDialog
     
    127129                    if (Config.getPref().getBoolean("multipoly.show-relation-editor", false)) {
    128130                        //Open relation edit window, if set up in preferences
     131                        // see #19346 un-select updated multipolygon
     132                        MainApplication.getLayerManager().getEditDataSet().clearSelection(relation);
    129133                        RelationEditor editor = RelationEditor
    130134                                .getEditor(MainApplication.getLayerManager().getEditLayer(), relation, null);
     
    133137                    } else {
    134138                        MainApplication.getLayerManager().getEditLayer().setRecentRelation(relation);
     139                        if (multipolygonRelation == null) {
     140                            // see #19346 select new multipolygon
     141                            MainApplication.getLayerManager().getEditDataSet().setSelected(relation);
     142                        }
    135143                    }
    136144                });
Note: See TracChangeset for help on using the changeset viewer.