Changeset 17633 in josm for trunk


Ignore:
Timestamp:
2021-03-21T23:20:37+01:00 (4 years ago)
Author:
simon04
Message:

see #20258 - Advanced preferences dialog "Change list of maps setting": show entry "name" in list

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/preferences/advanced/MapListEditor.java

    r12881 r17633  
    2626    private final transient List<List<String>> dataKeys;
    2727    private final transient List<List<String>> dataValues;
     28    private final transient List<String> dataLabels;
    2829
    2930    /**
     
    3940        dataKeys = new ArrayList<>();
    4041        dataValues = new ArrayList<>();
     42        dataLabels = new ArrayList<>();
    4143        if (orig != null) {
     44            int index = 0;
    4245            for (Map<String, String> m : orig) {
    4346                List<String> keys = new ArrayList<>();
     
    4952                dataKeys.add(keys);
    5053                dataValues.add(values);
     54                dataLabels.add(m.getOrDefault("name", tr("Entry {0}", index + 1)));
     55                index++;
    5156            }
    5257        }
     
    7782        @Override
    7883        public String getElementAt(int index) {
    79             return tr("Entry {0}", index+1);
     84            return dataLabels.get(index);
    8085        }
    8186
Note: See TracChangeset for help on using the changeset viewer.