Changeset 15606 in josm for trunk/src


Ignore:
Timestamp:
2019-12-21T15:33:07+01:00 (5 years ago)
Author:
Don-vip
Message:

fix #18444 - Changed default to "all" and also revert draw.rawgps.lines with the next update for everyone (patch by Bjoeni)

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

Legend:

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

    r15497 r15606  
    882882            });
    883883        }
     884        if (!getBoolean("preferences.reset.draw.rawgps.lines")) {
     885            // see #18444
     886            // add "preferences.reset.draw.rawgps.lines" to OBSOLETE_PREF_KEYS when removing
     887            putBoolean("preferences.reset.draw.rawgps.lines", true);
     888            putInt("draw.rawgps.lines", -1);
     889        }
    884890        if (modifiedDefault) {
    885891            try {
  • trunk/src/org/openstreetmap/josm/gui/layer/gpx/GpxDrawHelper.java

    r15586 r15606  
    310310
    311311        int l = optInt("lines");
    312         if (!data.fromServer) {
     312        // -1 = global (default: all)
     313        //  0 = none
     314        //  1 = local
     315        //  2 = all
     316        if (!data.fromServer) { //local settings apply
    313317            maxLineLength = optInt("lines.max-length.local");
    314             lines = l != 0; //draw for -1 (default), 1 (local) and 2 (all)
     318            lines = l != 0; // don't draw if "none"
    315319        } else {
    316320            maxLineLength = optInt("lines.max-length");
    317             lines = l == 2; //draw only for 2 (all)
     321            lines = l != 0 && l != 1; //don't draw if "none" or "local only"
    318322        }
    319323        large = optBool("points.large");
  • trunk/src/org/openstreetmap/josm/gui/preferences/display/GPXSettingsPanel.java

    r15586 r15606  
    148148        firstLayer = layers.get(0);
    149149        global = false;
    150         hasLocalFile = layers.stream().anyMatch(GpxLayer::isLocalFile);
    151         hasNonLocalFile = layers.stream().anyMatch(l -> !l.isLocalFile());
     150        hasLocalFile = layers.stream().anyMatch(l -> !l.data.fromServer);
     151        hasNonLocalFile = layers.stream().anyMatch(l -> l.data.fromServer);
    152152        initComponents();
    153153        loadPreferences();
     
    563563        makeAutoMarkers.setSelected(Config.getPref().getBoolean("marker.makeautomarkers", true));
    564564        int lines = global ? prefInt("lines") : prefIntLocal("lines");
    565         if (lines == 2 && hasNonLocalFile) {
     565        // -1 = global (default: all)
     566        //  0 = none
     567        //  1 = local
     568        //  2 = all
     569        if ((lines == 2 && hasNonLocalFile) || (lines == -1 && global)) {
    566570            drawRawGpsLinesAll.setSelected(true);
    567         } else if ((lines == 1 && hasLocalFile) || (lines == -1 && global)) {
     571        } else if (lines == 1 && hasLocalFile) {
    568572            drawRawGpsLinesLocal.setSelected(true);
    569573        } else if (lines == 0) {
Note: See TracChangeset for help on using the changeset viewer.