Changeset 18177 in josm for trunk/src


Ignore:
Timestamp:
2021-08-25T21:36:32+02:00 (3 years ago)
Author:
Don-vip
Message:

fix #20403 - Relation editor: Enable select relation button of new relation once it is saved

Location:
trunk/src/org/openstreetmap/josm/gui/dialogs/relation/actions
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/dialogs/relation/actions/SavingAction.java

    r17440 r18177  
    2424import org.openstreetmap.josm.gui.HelpAwareOptionPane.ButtonSpec;
    2525import org.openstreetmap.josm.gui.MainApplication;
     26import org.openstreetmap.josm.gui.dialogs.relation.IRelationEditor;
    2627import org.openstreetmap.josm.gui.dialogs.relation.RelationDialogManager;
    2728import org.openstreetmap.josm.gui.dialogs.relation.RelationEditor;
     
    161162
    162163    protected boolean applyChanges() {
    163         if (editorAccess.getEditor().getRelation() == null) {
     164        IRelationEditor editor = editorAccess.getEditor();
     165        if (editor.getRelation() == null) {
    164166            applyNewRelation(getTagModel());
    165167        } else if (isEditorDirty()) {
    166             if (editorAccess.getEditor().isDirtyRelation()) {
     168            if (editor.isDirtyRelation()) {
    167169                if (confirmClosingBecauseOfDirtyState()) {
    168                     if (getLayer().getConflicts().hasConflictForMy(editorAccess.getEditor().getRelation())) {
     170                    if (getLayer().getConflicts().hasConflictForMy(editor.getRelation())) {
    169171                        warnDoubleConflict();
    170172                        return false;
     
    179181            }
    180182        }
    181         editorAccess.getEditor().setRelation(editorAccess.getEditor().getRelation());
     183        editor.setRelation(editor.getRelation());
    182184        return true;
    183185    }
     
    188190            editorAccess.getEditor().setRelation(null);
    189191        }
    190 
    191192    }
    192193
  • trunk/src/org/openstreetmap/josm/gui/dialogs/relation/actions/SelectAction.java

    r14030 r18177  
    2121     */
    2222    public SelectAction(IRelationEditorActionAccess editorAccess) {
    23         super(editorAccess);
     23        super(editorAccess, IRelationEditorUpdateOn.TAG_CHANGE);
    2424        putValue(NAME, tr("Select"));
    2525        putValue(SHORT_DESCRIPTION, tr("Select the currently edited relation"));
Note: See TracChangeset for help on using the changeset viewer.