Changeset 19438 in josm


Ignore:
Timestamp:
2025-08-26T13:54:39+02:00 (4 months ago)
Author:
GerdP
Message:

fix #24444: Too many wrong notifications "Relation modified outside of relation editor with pending changes. Conflict resolution required"

  • Don't warn about an "outside modification" if the current relation editor window was used to save / apply changes and thus a change command was generated
Location:
trunk
Files:
5 edited

Legend:

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

    r19398 r19438  
    161161     */
    162162    private final ArrayList<FlavorListener> clipboardListeners = new ArrayList<>();
     163    /**
     164     * Flag that signals that this instance of the relation editor is currently saving the relation
     165     */
     166    private boolean isSaving;
    163167
    164168    /**
     
    10711075                if (!isDirtyEditor()) {
    10721076                    reloadDataFromRelation();
    1073                 } else {
     1077                } else if (!isSaving) {
    10741078                    new Notification(tr("Relation modified outside of relation editor with pending changes. Conflict resolution required."))
    10751079                    .setIcon(JOptionPane.WARNING_MESSAGE).show();
     
    10861090                tagEditorPanel.getModel().isDirty() || relation == null || relation.getDataSet() == null;
    10871091    }
     1092
     1093    @Override
     1094    public void setIsSaving(boolean b) {
     1095        isSaving = b;
     1096    }
    10881097}
  • trunk/src/org/openstreetmap/josm/gui/dialogs/relation/IRelationEditor.java

    r19399 r19438  
    6767
    6868    /**
     69     * Set the isSaving flag to the given value. See #24444
     70     * @param b the flag value
     71     * @since 19438
     72     */
     73    void setIsSaving(boolean b);
     74
     75    /**
    6976     * Reloads data from relation.
    7077     */
  • trunk/src/org/openstreetmap/josm/gui/dialogs/relation/RelationEditor.java

    r19432 r19438  
    116116    @Override
    117117    public final void setRelation(Relation relation) {
     118        setIsSaving(false); // see #24444
    118119        setRelationSnapshot((relation == null) ? null : new Relation(relation));
    119120        Relation oldValue = this.relation;
  • trunk/src/org/openstreetmap/josm/gui/dialogs/relation/actions/SavingAction.java

    r19398 r19438  
    172172                        return false;
    173173                    }
     174                    getEditor().setIsSaving(true); // see #24444
    174175                    applyExistingConflictingRelation(getTagModel());
    175176                    hideEditor();
     
    178179                    return false;
    179180            } else {
     181                getEditor().setIsSaving(true); // see #24444
    180182                applyExistingNonConflictingRelation(getTagModel());
    181183            }
  • trunk/test/unit/org/openstreetmap/josm/gui/dialogs/relation/GenericRelationEditorTest.java

    r19398 r19438  
    122122            public OsmDataLayer getLayer() {
    123123                return layer;
     124            }
     125
     126            @Override
     127            public void setIsSaving(boolean b) {
     128                // do nothing
    124129            }
    125130        };
Note: See TracChangeset for help on using the changeset viewer.