Changeset 31482 in osm for applications/editors/josm/plugins/mapillary/src
- Timestamp:
- 2015-08-11T15:43:11+02:00 (10 years ago)
- Location:
- applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/oauth/UploadUtils.java
r31475 r31482 176 176 } 177 177 this.ex.shutdown(); 178 PluginState.finishUpload();179 178 } 180 179 } -
applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/utils/PluginState.java
r31474 r31482 18 18 private static int runningDownloads = 0; 19 19 /** Images that have to be uploaded. */ 20 p ublicstatic int imagesToUpload = 0;20 protected static int imagesToUpload = 0; 21 21 /** Images that have been uploaded. */ 22 22 public static int imagesUploaded = 0; … … 33 33 */ 34 34 public static void finishDownload() { 35 if (runningDownloads == 0) 36 throw new IllegalStateException( 37 "The amount of running downlaods is less or equals to 0"); 35 38 runningDownloads--; 36 39 } … … 43 46 public static boolean isDownloading() { 44 47 return runningDownloads > 0; 45 }46 47 /**48 * Called when an upload is finished.49 */50 public static void finishUpload() {51 if (imagesUploaded >= imagesToUpload) {52 imagesUploaded = 0;53 imagesToUpload = 0;54 }55 48 } 56 49 … … 71 64 */ 72 65 public static void imagesToUpload(int amount) { 66 if (imagesToUpload <= imagesUploaded) { 67 imagesToUpload = 0; 68 imagesUploaded = 0; 69 } 73 70 imagesToUpload += amount; 74 71 } … … 80 77 imagesUploaded++; 81 78 if (imagesToUpload == imagesUploaded) { 82 finishedUploadDialog(); 79 if (Main.main != null) 80 finishedUploadDialog(); 83 81 } 84 82 }
Note:
See TracChangeset
for help on using the changeset viewer.