diff -rc DirectUpload/README DirectUpload_patched/README
*** DirectUpload/README	Wed Mar 31 13:03:44 2010
--- DirectUpload_patched/README	Wed Mar 31 12:57:53 2010
***************
*** 1,4 ****
  Directly uploads GPX from active layer in JOSM to OpenStreetMap Server.
- This currently uses OSM Api 0.5.
  
  More Details and FAQ's at : http://wiki.openstreetmap.org/index.php/User:Subhodip/GSoC_Doc#DirectUpload_Plugin_in_JOSM_:
--- 1,3 ----
diff -rc DirectUpload/src/org/openstreetmap/josm/plugins/DirectUpload/UploadDataGuiPlugin.java DirectUpload_patched/src/org/openstreetmap/josm/plugins/DirectUpload/UploadDataGuiPlugin.java
*** DirectUpload/src/org/openstreetmap/josm/plugins/DirectUpload/UploadDataGuiPlugin.java	Wed Mar 31 13:03:44 2010
--- DirectUpload_patched/src/org/openstreetmap/josm/plugins/DirectUpload/UploadDataGuiPlugin.java	Wed Mar 31 12:56:55 2010
***************
*** 10,15 ****
--- 10,16 ----
  
  import java.awt.event.ActionEvent;
  import java.awt.event.KeyEvent;
+ import java.util.List;
  
  import org.openstreetmap.josm.Main;
  import org.openstreetmap.josm.actions.JosmAction;
***************
*** 43,49 ****
  
          @Override
  		protected void updateEnabledState() {
!             if(Main.map == null
                      || Main.map.mapView == null
                      || Main.map.mapView.getActiveLayer() == null
                      || !(Main.map.mapView.getActiveLayer() instanceof GpxLayer)) {                
--- 44,51 ----
  
          @Override
  		protected void updateEnabledState() {
!            	// enable button if there is "one active GpxLayer" or "exactly one GpxLayer in the list of all layers available"
!            	if(Main.map == null
                      || Main.map.mapView == null
                      || Main.map.mapView.getActiveLayer() == null
                      || !(Main.map.mapView.getActiveLayer() instanceof GpxLayer)) {                
***************
*** 52,57 ****
--- 54,65 ----
              	setEnabled(true);
              }
  
+         	if(Main.map != null && Main.map.mapView.getNumLayers() > 1) {
+         		List<GpxLayer> list = Main.map.mapView.getLayersOfType(GpxLayer.class);
+         		if (list.size() == 1)
+         			setEnabled(true);
+         	}
+ 
  		}		
      }
  }
\ No newline at end of file
