Changeset 6357 in josm for trunk/src/org/openstreetmap/josm/data
- Timestamp:
- 2013-11-02T21:28:24+01:00 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/AutosaveTask.java
r6248 r6357 34 34 import org.openstreetmap.josm.gui.MapView; 35 35 import org.openstreetmap.josm.gui.MapView.LayerChangeListener; 36 import org.openstreetmap.josm.gui.Notification; 36 37 import org.openstreetmap.josm.gui.layer.Layer; 37 38 import org.openstreetmap.josm.gui.layer.OsmDataLayer; 39 import org.openstreetmap.josm.gui.util.GuiHelper; 38 40 import org.openstreetmap.josm.io.OsmExporter; 39 41 import org.openstreetmap.josm.io.OsmImporter; … … 67 69 public static final IntegerProperty PROP_INTERVAL = new IntegerProperty("autosave.interval", 5 * 60); 68 70 public static final IntegerProperty PROP_INDEX_LIMIT = new IntegerProperty("autosave.index-limit", 1000); 71 /** Defines if a notification should be displayed after each autosave */ 72 public static final BooleanProperty PROP_NOTIFICATION = new BooleanProperty("autosave.notification", false); 69 73 70 74 private static class AutosaveLayerInfo { … … 205 209 } 206 210 changedDatasets.clear(); 211 if (PROP_NOTIFICATION.get() && !layersInfo.isEmpty()) { 212 displayNotification(); 213 } 207 214 } catch (Throwable t) { 208 215 // Don't let exception stop time thread … … 212 219 } 213 220 } 221 } 222 223 protected void displayNotification() { 224 GuiHelper.runInEDT(new Runnable() { 225 @Override 226 public void run() { 227 new Notification(tr("Your work has been saved automatically.")) 228 .setDuration(Notification.TIME_SHORT) 229 .show(); 230 } 231 }); 214 232 } 215 233
Note:
See TracChangeset
for help on using the changeset viewer.