Ignore:
Timestamp:
2010-04-11T11:02:28+02:00 (14 years ago)
Author:
mgarbe
Message:

fixed ticket #4782. Activate Upload if one GPX layer available.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/DirectUpload/src/org/openstreetmap/josm/plugins/DirectUpload/UploadDataGuiPlugin.java

    r19432 r20880  
    1111import java.awt.event.ActionEvent;
    1212import java.awt.event.KeyEvent;
     13import java.util.List;
    1314
    1415import org.openstreetmap.josm.Main;
     
    4445        @Override
    4546                protected void updateEnabledState() {
    46             if(Main.map == null
     47                // enable button if there is "one active GpxLayer" or "exactly one GpxLayer in the list of all layers available"
     48                if(Main.map == null
    4749                    || Main.map.mapView == null
    4850                    || Main.map.mapView.getActiveLayer() == null
     
    5355            }
    5456
    55                 }               
     57            if(Main.map != null && Main.map.mapView.getNumLayers() > 1) {
     58                List<GpxLayer> list = Main.map.mapView.getLayersOfType(GpxLayer.class);
     59                if (list.size() == 1)
     60                    setEnabled(true);
     61            }
     62
     63        }               
    5664    }
    5765}
Note: See TracChangeset for help on using the changeset viewer.