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


Ignore:
Timestamp:
2017-07-22T11:52:23+02:00 (7 years ago)
Author:
bastiK
Message:

remember projection choice sub-preferences (e.g. last selected UTM zone) across sessions (not just when changing the default projection) (closes #15013, see #14877)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/preferences/projection/ProjectionPreference.java

    r12306 r12485  
    273273
    274274    private static String projectionChoice;
    275     private static final Map<String, Collection<String>> projectionChoicesSub = new HashMap<>();
    276275   
    277276    private static final StringProperty PROP_PROJECTION_DEFAULT = new StringProperty("projection.default", mercator.getId());
     
    463462        }
    464463        id = pc.getId();
     464        Main.pref.putCollection("projection.sub."+id, pref);
    465465        if (makeDefault) {
    466466            PROP_PROJECTION_DEFAULT.put(id);
    467467            PROP_SUB_PROJECTION_DEFAULT.put(pref);
    468             Main.pref.putCollection("projection.default.sub."+id, pref);
    469468        } else {
    470469            projectionChoice = id;
    471             projectionChoicesSub.put(id, pref);
    472470        }
    473471        pc.setPreferences(pref);
     
    527525
    528526    private static Collection<String> getSubprojectionPreference(ProjectionChoice pc) {
    529         Collection<String> sessionValue = projectionChoicesSub.get(pc.getId());
    530         if (sessionValue != null)
    531             return sessionValue;
    532         return Main.pref.getCollection("projection.default.sub."+pc.getId(), null);
     527        return Main.pref.getCollection("projection.sub."+pc.getId(), null);
    533528    }
    534529
Note: See TracChangeset for help on using the changeset viewer.