Ticket #15817: 15817-units.patch

File 15817-units.patch, 1.5 KB (added by simon04, 5 months ago)
  • src/org/openstreetmap/josm/gui/preferences/imagery/CacheContentsPanel.java

    diff --git a/src/org/openstreetmap/josm/gui/preferences/imagery/CacheContentsPanel.java b/src/org/openstreetmap/josm/gui/preferences/imagery/CacheContentsPanel.java
    index f930bc52d..5ecab8afc 100644
    a b  
    88import java.util.ArrayList;
    99import java.util.Comparator;
    1010import java.util.List;
     11import java.util.Locale;
    1112import java.util.Map;
    1213import java.util.Map.Entry;
    1314import java.util.Set;
     
    3637import org.openstreetmap.josm.tools.GBC;
    3738import org.openstreetmap.josm.tools.Logging;
    3839import org.openstreetmap.josm.tools.Pair;
     40import org.openstreetmap.josm.tools.Utils;
    3941
    4042/**
    4143 * Panel for cache content management.
    public CacheContentsPanel() { 
    5961
    6062    private void addToPanel(final CacheAccess<String, BufferedImageCacheEntry> cache, final String name) {
    6163        final Long cacheSize = getCacheSize(cache);
     64        final String sizeString = Utils.getSizeString(cacheSize, Locale.getDefault());
    6265        final TableModel tableModel = getTableModel(cache);
    6366
    6467        GuiHelper.runInEDT(() -> {
    65             add(new JLabel(tr("{0} cache, total cache size: {1} bytes", name, cacheSize)),
     68            add(new JLabel(tr("{0} cache, total cache size: {1}", name, sizeString)),
    6669                GBC.eol().insets(5, 5, 0, 0));
    6770            add(new JScrollPane(getTableForCache(cache, tableModel)),
    6871                GBC.eol().fill(GBC.BOTH));