- Timestamp:
- 2015-02-10T22:55:53+01:00 (10 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/gui/layer/geoimage
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/layer/geoimage/GeoImageLayer.java
r7983 r8041 356 356 } 357 357 358 /** 359 * Prepare the string that is displayed if layer information is requested. 360 * @return String with layer information 361 */ 358 362 private String infoText() { 359 int i = 0; 360 for (ImageEntry e : data) 363 int tagged = 0; 364 int newdata = 0; 365 for (ImageEntry e : data) { 361 366 if (e.getPos() != null) { 362 i++; 363 } 364 return trn("{0} image loaded.", "{0} images loaded.", data.size(), data.size()) 365 + " " + trn("{0} was found to be GPS tagged.", "{0} were found to be GPS tagged.", i, i); 367 tagged++; 368 } 369 if (e.hasNewGpsData()) { 370 newdata++; 371 } 372 } 373 return "<html>" 374 + trn("{0} image loaded.", "{0} images loaded.", data.size(), data.size()) 375 + " " + trn("{0} was found to be GPS tagged.", "{0} were found to be GPS tagged.", tagged, tagged) 376 + (newdata > 0 ? "<br>" + trn("{0} has updated GPS data.", "{0} have updated GPS data.", newdata, newdata) : "") 377 + "</html>"; 366 378 } 367 379 … … 1072 1084 } 1073 1085 1086 /** 1087 * Get list of images in layer. 1088 * @return List of images in layer 1089 */ 1074 1090 public List<ImageEntry> getImages() { 1075 1091 List<ImageEntry> copy = new ArrayList<>(data.size()); 1076 1092 for (ImageEntry ie : data) { 1077 copy.add(ie .clone());1093 copy.add(ie); 1078 1094 } 1079 1095 return copy; -
trunk/src/org/openstreetmap/josm/gui/layer/geoimage/ImageEntry.java
r7912 r8041 251 251 /** 252 252 * Indicates that the image has new GPS data. 253 * That flag is used e.g. by the photo_geotagging plugin to decide for which image254 * file the EXIF GPS data needs to be (re-)written.253 * That flag is set by new GPS data providers. It is used e.g. by the photo_geotagging plugin 254 * to decide for which image file the EXIF GPS data needs to be (re-)written. 255 255 * @since 6392 256 256 */ 257 257 public void flagNewGpsData() { 258 258 isNewGpsData = true; 259 // We need to set the GPS time to tell the system (mainly the photo_geotagging plug-in) 260 // that the GPS data has changed. Check for existing GPS time and take EXIF time otherwise. 261 // This can be removed once isNewGpsData is used instead of the GPS time. 262 if (gpsTime == null) { 263 Date time = getExifGpsTime(); 264 if (time == null) { 265 time = getExifTime(); 266 if (time == null) { 267 // Time still not set, take the current time. 268 time = new Date(); 269 } 270 } 271 gpsTime = time; 272 } 273 if (tmp != null && !tmp.hasGpsTime()) { 274 // tmp.gpsTime overrides gpsTime, so we set it too. 275 tmp.gpsTime = gpsTime; 276 } 259 } 260 261 /** 262 * Remove the flag that indicates new GPS data. 263 * The flag is cleared by a new GPS data consumer. 264 */ 265 public void unflagNewGpsData() { 266 isNewGpsData = false; 277 267 } 278 268
Note:
See TracChangeset
for help on using the changeset viewer.