Ignore:
Timestamp:
2019-07-06T22:15:55+02:00 (5 years ago)
Author:
Don-vip
Message:

fix #13458 - display external resources icons in the preferences

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/data/preferences/sources/PresetPrefHelper.java

    r12825 r15211  
    66import java.util.Collection;
    77import java.util.Collections;
    8 import java.util.HashMap;
    9 import java.util.Map;
     8
     9import org.openstreetmap.josm.tools.ImageProvider;
    1010
    1111/**
     
    3131        ExtendedSourceEntry i = new ExtendedSourceEntry(type, "defaultpresets.xml", "resource://data/defaultpresets.xml");
    3232        i.title = tr("Internal Preset");
     33        i.icon = new ImageProvider("logo").getResource();
    3334        i.description = tr("The default preset for JOSM");
    3435        return Collections.singletonList(i);
    3536    }
    36 
    37     @Override
    38     public Map<String, String> serialize(SourceEntry entry) {
    39         Map<String, String> res = new HashMap<>();
    40         res.put("url", entry.url);
    41         res.put("title", entry.title == null ? "" : entry.title);
    42         return res;
    43     }
    44 
    45     @Override
    46     public SourceEntry deserialize(Map<String, String> s) {
    47         return new SourceEntry(type, s.get("url"), null, s.get("title"), true);
    48     }
    4937}
Note: See TracChangeset for help on using the changeset viewer.