Changeset 9447 in josm for trunk/src/org
- Timestamp:
- 2016-01-14T18:23:23+01:00 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/AutoScaleAction.java
r8900 r9447 221 221 */ 222 222 protected Layer getFirstSelectedLayer() { 223 if (Main.main.getActiveLayer() == null) { 224 return null; 225 } 223 226 List<Layer> layers = LayerListDialog.getInstance().getModel().getSelectedLayers(); 224 227 if (layers.isEmpty()) … … 246 249 break; 247 250 case "layer": 248 if (Main.main.getActiveLayer() == null)249 return null;250 251 // try to zoom to the first selected layer 251 252 Layer l = getFirstSelectedLayer(); … … 290 291 lastZoomTime = -1; 291 292 } 292 DataSet dataset = Main.main.getCurrentDataSet();293 final DataSet dataset = getCurrentDataSet(); 293 294 if (dataset != null) { 294 295 List<DataSource> dataSources = new ArrayList<>(dataset.getDataSources()); … … 323 324 break; 324 325 case "layer": 325 if (!Main.isDisplayingMapView() || Main.map.mapView.getAllLayersAsList().isEmpty()) { 326 setEnabled(false); 327 } else { 328 // FIXME: should also check for whether a layer is selected in the layer list dialog 329 setEnabled(true); 330 } 326 setEnabled(getFirstSelectedLayer() != null); 331 327 break; 332 328 case "conflict": 333 329 setEnabled(Main.map != null && Main.map.conflictDialog.getSelectedConflict() != null); 330 break; 331 case "download": 332 setEnabled(getCurrentDataSet() != null && !getCurrentDataSet().getDataSources().isEmpty()); 334 333 break; 335 334 case "problem": … … 414 413 } 415 414 } 415 updateEnabledState(); 416 416 } 417 417 }
Note:
See TracChangeset
for help on using the changeset viewer.