Changeset 4198 in josm


Ignore:
Timestamp:
Jul 3, 2011 2:23:08 PM (23 months ago)
Author:
stoecker
Message:

fix #5911 - silently add attribution information also to old entries, may take some restarts to be done everywhere

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

Legend:

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

    r4195 r4198  
    184184    public void setBounds(Bounds b) { 
    185185        this.bounds = b; 
     186    } 
     187 
     188    public Bounds getBounds() { 
     189        return bounds; 
    186190    } 
    187191 
     
    285289    } 
    286290 
     291    public boolean hasAttribution() 
     292    { 
     293        return attributionText != null; 
     294    } 
     295 
     296    public void copyAttribution(ImageryInfo i) 
     297    { 
     298        this.attributionImage = i.attributionImage; 
     299        this.attributionLinkURL = i.attributionLinkURL; 
     300        this.attributionText = i.attributionText; 
     301        this.termsOfUseURL = i.termsOfUseURL; 
     302    } 
     303 
    287304    public void setAttribution(TMSTileSource s) 
    288305    { 
  • trunk/src/org/openstreetmap/josm/data/imagery/ImageryLayerInfo.java

    r4195 r4198  
    4141        for(Collection<String> c : Main.pref.getArray("imagery.layers", 
    4242                Collections.<Collection<String>>emptySet())) { 
    43             add(new ImageryInfo(c)); 
     43            ImageryInfo i = new ImageryInfo(c); 
     44            /* FIXME: Remove the attribution copy stuff end of 2011 */ 
     45            if(!i.hasAttribution()) { 
     46                String url = i.getUrl(); 
     47                for(ImageryInfo d : defaultLayers) { 
     48                    if(url.equals(d.getUrl())) { 
     49                        i.copyAttribution(d); 
     50                        i.setBounds(d.getBounds()); 
     51                        break; 
     52                    } 
     53                } 
     54            } 
     55            add(i); 
    4456        } 
    4557        Collections.sort(layers); 
  • trunk/src/org/openstreetmap/josm/gui/preferences/ImageryPreference.java

    r4195 r4198  
    836836 
    837837    public static void initialize() { 
     838        ImageryLayerInfo.instance.loadDefaults(false); 
    838839        ImageryLayerInfo.instance.load(); 
    839         ImageryLayerInfo.instance.loadDefaults(false); 
    840840        OffsetBookmark.loadBookmarks(); 
    841841        Main.main.menu.imageryMenu.refreshImageryMenu(); 
Note: See TracChangeset for help on using the changeset viewer.