Ignore:
Timestamp:
2017-07-23T01:09:45+02:00 (7 years ago)
Author:
Don-vip
Message:

fix #5869 - Download dialog, bookmarks: add "home location" bookmark (if set in OSM user settings) + last 15 changesets bookmarks

Location:
trunk/src/org/openstreetmap/josm/io
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/io/ChangesetQuery.java

    r12470 r12495  
    1919import org.openstreetmap.josm.data.Bounds;
    2020import org.openstreetmap.josm.data.coor.LatLon;
     21import org.openstreetmap.josm.gui.JosmUserIdentityManager;
    2122import org.openstreetmap.josm.tools.CheckParameterUtil;
    2223import org.openstreetmap.josm.tools.Utils;
     
    6162    public static ChangesetQuery buildFromUrlQuery(String query) throws ChangesetQueryUrlException {
    6263        return new ChangesetQueryUrlParser().parse(query);
     64    }
     65
     66    /**
     67     * Replies a changeset query object restricted to the current user, if known.
     68     * @return a changeset query object restricted to the current user, if known
     69     * @throws IllegalStateException if current user is anonymous
     70     * @since 12495
     71     */
     72    public static ChangesetQuery forCurrentUser() {
     73        JosmUserIdentityManager im = JosmUserIdentityManager.getInstance();
     74        if (im.isAnonymous()) {
     75            throw new IllegalStateException("anonymous user");
     76        }
     77        ChangesetQuery query = new ChangesetQuery();
     78        if (im.isFullyIdentified()) {
     79            return query.forUser(im.getUserId());
     80        } else {
     81            return query.forUser(im.getUserName());
     82        }
    6383    }
    6484
  • trunk/src/org/openstreetmap/josm/io/OsmChangesetParser.java

    r10212 r12495  
    153153                    throwException(tr("Illegal value for attribute ''{0}''. Got ''{1}''.", "max_lat", maxLatStr));
    154154                }
    155                 current.setMax(new LatLon(maxLon, maxLat));
     155                current.setMax(new LatLon(maxLat, maxLon));
    156156            }
    157157
Note: See TracChangeset for help on using the changeset viewer.