Changeset 3435 in josm for trunk/src/org
- Timestamp:
- 2010-08-14T07:39:38+02:00 (14 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/AutosaveTask.java
r3381 r3435 244 244 } 245 245 246 public List<OsmDataLayer> getUnsavedLayers() { 247 List<OsmDataLayer> result = new ArrayList<OsmDataLayer>(); 248 246 public List<File> getUnsavedLayersFiles() { 247 List<File> result = new ArrayList<File>(); 249 248 File[] files = autosaveDir.listFiles(); 250 249 if (files == null) 251 250 return result; 252 for (File f: autosaveDir.listFiles()) { 253 if (f.isDirectory()) { 254 continue; 255 } 251 for (File file: files) { 252 if (file.isFile()) { 253 result.add(file); 254 } 255 } 256 return result; 257 } 258 259 public List<OsmDataLayer> getUnsavedLayers() { 260 List<OsmDataLayer> result = new ArrayList<OsmDataLayer>(); 261 262 for (File f: getUnsavedLayersFiles()) { 256 263 try { 257 264 DataSet ds = OsmReader.parseDataSet(new FileInputStream(f), NullProgressMonitor.INSTANCE); -
trunk/src/org/openstreetmap/josm/gui/MainApplication.java
r3431 r3435 10 10 import java.awt.event.WindowAdapter; 11 11 import java.awt.event.WindowEvent; 12 import java.io.File; 12 13 import java.net.Authenticator; 13 14 import java.net.ProxySelector; … … 247 248 248 249 AutosaveTask autosaveTask = new AutosaveTask(); 249 List< OsmDataLayer> unsavedLayers = autosaveTask.getUnsavedLayers();250 if (!unsavedLayer s.isEmpty()) {250 List<File> unsavedLayerFiles = autosaveTask.getUnsavedLayersFiles(); 251 if (!unsavedLayerFiles.isEmpty()) { 251 252 ExtendedDialog dialog = new ExtendedDialog( 252 253 Main.parent, … … 255 256 ); 256 257 dialog.setContent(tr("JOSM found {0} unsaved osm data layers. It looks like JOSM crashed last time. Do you want to restore data?", 257 unsavedLayers.size())); 258 dialog.setIcon(JOptionPane.INFORMATION_MESSAGE); 258 unsavedLayerFiles.size())); 259 259 dialog.setButtonIcons(new String[] {"ok.png", "cancel.png"}); 260 260 dialog.showDialog(); 261 261 if (dialog.getValue() == 1) { 262 for (OsmDataLayer layer: unsavedLayers) {262 for (OsmDataLayer layer: autosaveTask.getUnsavedLayers()) { 263 263 Main.main.addLayer(layer); 264 264 } … … 305 305 if (version.startsWith("1.5") || version.startsWith("5")) { 306 306 JLabel ho = new JLabel("<html>"+ 307 tr("<h2>JOSM requires Java version 6.</h2>"+308 "Detected Java version: {0}.<br>"+309 "You can <ul><li>update your Java (JRE) or</li>"+310 "<li>use an earlier (Java 5 compatible) version of JOSM.</li></ul>"+311 "More Info:", version)+"</html>");307 tr("<h2>JOSM requires Java version 6.</h2>"+ 308 "Detected Java version: {0}.<br>"+ 309 "You can <ul><li>update your Java (JRE) or</li>"+ 310 "<li>use an earlier (Java 5 compatible) version of JOSM.</li></ul>"+ 311 "More Info:", version)+"</html>"); 312 312 JTextArea link = new JTextArea("http://josm.openstreetmap.de/wiki/Help/SystemRequirements"); 313 313 link.setEditable(false);
Note:
See TracChangeset
for help on using the changeset viewer.