Ignore:
Timestamp:
2015-05-02T00:38:57+02:00 (9 years ago)
Author:
bastiK
Message:

applied #10902 - TMS simultaneous connections (patch by wiktorn)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/preferences/imagery/TMSSettingsPanel.java

    r8168 r8307  
    3333    private final JSpinner maxElementsOnDisk;
    3434    private final JSpinner maxConcurrentDownloads;
     35    private final JSpinner maxDownloadsPerHost;
    3536
    3637
     
    4445        maxElementsOnDisk = new JSpinner(new SpinnerNumberModel(TMSCachedTileLoader.MAX_OBJECTS_ON_DISK.get().intValue(), 0, Integer.MAX_VALUE, 1));
    4546        maxConcurrentDownloads = new JSpinner(new SpinnerNumberModel(TMSCachedTileLoaderJob.THREAD_LIMIT.get().intValue(), 0, Integer.MAX_VALUE, 1));
     47        maxDownloadsPerHost = new JSpinner(new SpinnerNumberModel(TMSCachedTileLoaderJob.HOST_LIMIT.get().intValue(), 0, Integer.MAX_VALUE, 1));
    4648
    4749        add(new JLabel(tr("Auto zoom by default: ")), GBC.std());
     
    7375        add(maxConcurrentDownloads, GBC.eol());
    7476
     77        add(new JLabel(tr("Maximum concurrent downloads per host: ")), GBC.std());
     78        add(GBC.glue(5, 0), GBC.std());
     79        add(maxDownloadsPerHost, GBC.eol());
     80
     81
    7582        add(new JLabel(tr("Maximum elements in disk cache: ")), GBC.std());
    7683        add(GBC.glue(5, 0), GBC.std());
     
    9198        this.maxElementsOnDisk.setValue(TMSCachedTileLoader.MAX_OBJECTS_ON_DISK.get());
    9299        this.maxConcurrentDownloads.setValue(TMSCachedTileLoaderJob.THREAD_LIMIT.get());
     100        this.maxDownloadsPerHost.setValue(TMSCachedTileLoaderJob.HOST_LIMIT.get());
    93101    }
    94102
     
    111119        TMSCachedTileLoader.MAX_OBJECTS_ON_DISK.put((Integer) this.maxElementsOnDisk.getValue());
    112120
    113         if (!TMSCachedTileLoaderJob.THREAD_LIMIT.get().equals(this.maxConcurrentDownloads.getValue())) {
    114             restartRequired = true;
    115             TMSCachedTileLoaderJob.THREAD_LIMIT.put((Integer) this.maxConcurrentDownloads.getValue());
    116         }
     121        TMSCachedTileLoaderJob.THREAD_LIMIT.put((Integer) this.maxConcurrentDownloads.getValue());
     122        TMSCachedTileLoaderJob.HOST_LIMIT.put((Integer) this.maxDownloadsPerHost.getValue());
     123        TMSCachedTileLoaderJob.reconfigureDownloadDispatcher();
    117124
    118125        if (!TMSLayer.PROP_TILECACHE_DIR.get().equals(this.tilecacheDir.getText())) {
Note: See TracChangeset for help on using the changeset viewer.