Changeset 15823 in josm


Ignore:
Timestamp:
2020-02-06T21:51:52+01:00 (2 weeks ago)
Author:
Don-vip
Message:

fix #18678 - fix DownloadAlong with locked layers

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

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/actions/DownloadAlongWayAction.java

    r15363 r15823  
    4343    @Override
    4444    protected PleaseWaitRunnable createTask() {
    45         Collection<Way> selectedWays = getLayerManager().getEditDataSet().getSelectedWays();
    46 
     45        Collection<Way> selectedWays = getLayerManager().getActiveDataSet().getSelectedWays();
    4746        if (selectedWays.isEmpty()) {
    4847            JOptionPane.showMessageDialog(MainApplication.getMainFrame(), tr("Please select 1 or more ways to download along"));
  • trunk/src/org/openstreetmap/josm/gui/layer/gpx/DownloadAlongPanel.java

    r15586 r15823  
    152152     * @param listener The listener that will be notified of each combobox change
    153153     */
    154     protected final void addChangeListener(ChangeListener listener) {
     154    protected final void addAndFireChangeListener(ChangeListener listener) {
    155155        cbDownloadGpxData.addChangeListener(listener);
    156156        cbDownloadOsmData.addChangeListener(listener);
     157        listener.stateChanged(null);
    157158    }
    158159
     
    185186        };
    186187
    187         addChangeListener(e -> options[0].setEnabled(isDownloadOsmData() || isDownloadGpxData()));
     188        addAndFireChangeListener(e -> {
     189            boolean somethingToDownload = isDownloadOsmData() || isDownloadGpxData();
     190            options[0].setEnabled(somethingToDownload && MainApplication.getLayerManager().getEditLayer() != null);
     191            options[1].setEnabled(somethingToDownload);
     192        });
    188193
    189194        int ret = HelpAwareOptionPane.showOptionDialog(MainApplication.getMainFrame(), this, title,
Note: See TracChangeset for help on using the changeset viewer.