Ticket #262: josm-issue-262.diff
| File josm-issue-262.diff, 1.3 KB (added by , 18 years ago) |
|---|
-
home/dnaber/workspace/JOSM/src/org/openstreetmap/josm/gui/dialogs/LayerListDialog.java
22 22 import javax.swing.JButton; 23 23 import javax.swing.JLabel; 24 24 import javax.swing.JList; 25 import javax.swing.JOptionPane; 25 26 import javax.swing.JPanel; 26 27 import javax.swing.JScrollPane; 27 28 import javax.swing.ListSelectionModel; … … 70 71 Layer l = layer != null ? layer : (Layer)instance.getSelectedValue(); 71 72 if (l instanceof OsmDataLayer && !DontShowAgainInfo.show("delete_layer", tr("Do you really want to delete the whole layer?"))) 72 73 return; 74 if (l instanceof OsmDataLayer && ((OsmDataLayer)l).isModified()) { 75 final int answer = JOptionPane.showConfirmDialog( 76 instance, tr("There are unsaved changes. Delete the layer anwyay?"), 77 tr("Unsaved Changes"), JOptionPane.YES_NO_OPTION); 78 if (answer != JOptionPane.YES_OPTION) { 79 return; 80 } 81 } 73 82 Main.main.removeLayer(l); 74 83 if (sel >= instance.getModel().getSize()) 75 84 sel = instance.getModel().getSize()-1;
