Changeset 13213 in josm
- Timestamp:
- 2017-12-17T20:36:48+01:00 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/layer/MainLayerManager.java
r13152 r13213 14 14 import org.openstreetmap.josm.data.osm.DataSet; 15 15 import org.openstreetmap.josm.gui.MainApplication; 16 import org.openstreetmap.josm.gui.io.AsynchronousUploadPrimitivesTask; 16 17 import org.openstreetmap.josm.gui.util.GuiHelper; 17 18 … … 274 275 @Override 275 276 protected Collection<Layer> realRemoveSingleLayer(Layer layer) { 277 if ((layer instanceof OsmDataLayer) && (((OsmDataLayer) layer).isReadOnly())) { 278 GuiHelper.runInEDT(() -> JOptionPane.showMessageDialog(MainApplication.parent, 279 tr("Trying to delete the layer with background upload. Please wait until the upload is finished."))); 280 281 // Return an empty collection for allowing to delete other layers 282 return new ArrayList<>(); 283 } 284 276 285 if (layer == activeLayer || layer == editLayer) { 277 286 Layer nextActive = suggestNextActiveLayer(layer); … … 409 418 @Override 410 419 protected synchronized void realResetState() { 411 // active and edit layer are unset automatically 412 super.realResetState(); 413 414 activeLayerChangeListeners.clear(); 415 layerAvailabilityListeners.clear(); 420 // Reset state if no asynchronous upload is under progress 421 if (!AsynchronousUploadPrimitivesTask.getCurrentAsynchronousUploadTask().isPresent()) { 422 // active and edit layer are unset automatically 423 super.realResetState(); 424 425 activeLayerChangeListeners.clear(); 426 layerAvailabilityListeners.clear(); 427 } else { 428 GuiHelper.runInEDT(() -> JOptionPane.showMessageDialog(MainApplication.parent, 429 tr("A background upload is already in progress. Cannot reset state until the upload is finished."))); 430 } 416 431 } 417 432
Note:
See TracChangeset
for help on using the changeset viewer.