Ignore:
Timestamp:
2019-04-09T01:32:56+02:00 (5 years ago)
Author:
Don-vip
Message:

ensures consistency of upload comment:

  • fix #11168 - ctrl-z/undo could reset unwanted old changeset comment
  • fix #13474 - selecting "new changeset" after having entered a changeset comment did reset it to the previous value
  • fix #17452 - ctrl-enter while typing a changeset comment did upload with the previous value
  • fix behaviour of upload.comment.max-age: values were reset after 5 months instead of intended 4 hours because seconds were compared to milliseconds
  • avoid creation of unneeded undo/redo internal classes for non-editable text fields
  • ensures consistency of upload dialog if upload.comment properties are modified manually from advanced preferences
  • add a source attribute to preference events to know which class modified the preference entry
  • refactor reflection utils
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/spi/preferences/DefaultPreferenceChangeEvent.java

    r12882 r14977  
    11// License: GPL. For details, see LICENSE file.
    22package org.openstreetmap.josm.spi.preferences;
     3
     4import java.util.EventObject;
    35
    46/**
     
    68 * @since 12881
    79 */
    8 public class DefaultPreferenceChangeEvent implements PreferenceChangeEvent {
    9    
     10public class DefaultPreferenceChangeEvent extends EventObject implements PreferenceChangeEvent {
     11
    1012    private final String key;
    1113    private final Setting<?> oldValue;
    1214    private final Setting<?> newValue;
    1315
    14     public DefaultPreferenceChangeEvent(String key, Setting<?> oldValue, Setting<?> newValue) {
     16    /**
     17     * Constructs a new {@code DefaultPreferenceChangeEvent}.
     18     * @param source the class source of this event
     19     * @param key preference key
     20     * @param oldValue preference old value
     21     * @param newValue preference new value
     22     * @since 14977
     23     */
     24    public DefaultPreferenceChangeEvent(Class<?> source, String key, Setting<?> oldValue, Setting<?> newValue) {
     25        super(source);
    1526        this.key = key;
    1627        this.oldValue = oldValue;
    1728        this.newValue = newValue;
     29    }
     30
     31    @Override
     32    public Class<?> getSource() {
     33        return (Class<?>) super.getSource();
    1834    }
    1935
     
    3248        return newValue;
    3349    }
    34    
     50
    3551}
Note: See TracChangeset for help on using the changeset viewer.