Changeset 12946 in josm for trunk/src/org/openstreetmap/josm


Ignore:
Timestamp:
2017-10-08T14:46:53+02:00 (7 years ago)
Author:
bastiK
Message:

see #15410 - fix deleting color entries; do not display unchanged layer colors (this gets excessive if user opens may gpx files over time)

Location:
trunk/src/org/openstreetmap/josm
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/data/Preferences.java

    r12945 r12946  
    642642        for (final Entry<String, Setting<?>> e : defaultsMap.entrySet()) {
    643643            if (e.getKey().startsWith(COLOR_PREFIX) && e.getValue() instanceof StringSetting) {
     644                if (e.getKey().startsWith(COLOR_PREFIX+"layer."))
     645                    continue; // do not add unchanged layer colors
    644646                StringSetting d = (StringSetting) e.getValue();
    645647                if (d.getValue() != null) {
  • trunk/src/org/openstreetmap/josm/gui/preferences/display/ColorPreference.java

    r12942 r12946  
    9797        Map<String, String> colorKeyListLayer = new TreeMap<>();
    9898        for (String key : colorMap.keySet()) {
    99             if (key.startsWith("layer ")) {
     99            if (key.startsWith("layer.")) {
    100100                colorKeyListLayer.put(getName(key), key);
    101101            } else if (key.startsWith("mappaint.")) {
     
    251251
    252252    Boolean isRemoveColor(int row) {
    253         return ((String) colors.getValueAt(row, 0)).startsWith("layer ");
     253        return ((String) colors.getValueAt(row, 0)).startsWith("layer.");
    254254    }
    255255
     
    273273        boolean ret = false;
    274274        for (String d : del) {
    275             Config.getPref().put("color."+d, null);
     275            Main.pref.putColor(d, null);
    276276        }
    277277        for (int i = 0; i < colors.getRowCount(); ++i) {
Note: See TracChangeset for help on using the changeset viewer.