- Timestamp:
- 2009-09-07T23:58:54+02:00 (15 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/io
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/io/OsmReader.java
r2070 r2078 338 338 String value = atts.getValue("v"); 339 339 current.rememberTag(key, value); 340 } else { 341 throwException(tr("Undefined element ''{0}'' found in input stream. Aborting.", qName)); 340 342 } 341 343 } -
trunk/src/org/openstreetmap/josm/io/OsmServerWriter.java
r2074 r2078 90 90 protected void uploadChangesIndividually(Collection<OsmPrimitive> primitives, Changeset changeset, ChangesetProcessingType changesetProcessingType, ProgressMonitor progressMonitor) throws OsmTransferException { 91 91 try { 92 progressMonitor.beginTask(tr("Starting to upload with one request per primitive ...")); 92 93 progressMonitor.setTicksCount(primitives.size()); 93 94 if (changesetProcessingType.isUseNew()) { … … 102 103 String msg = ""; 103 104 switch(OsmPrimitiveType.from(osm)) { 104 105 106 105 case NODE: msg = marktr("{0}% ({1}/{2}), {3} left. Uploading node ''{4}'' (id: {5})"); break; 106 case WAY: msg = marktr("{0}% ({1}/{2}), {3} left. Uploading way ''{4}'' (id: {5})"); break; 107 case RELATION: msg = marktr("{0}% ({1}/{2}), {3} left. Uploading relation ''{4}'' (id: {5})"); break; 107 108 } 108 109 progressMonitor.subTask( … … 135 136 closeException.setChangeset(api.getCurrentChangeset()); 136 137 throw closeException; 138 } finally { 139 progressMonitor.finishTask(); 137 140 } 138 141 } … … 150 153 // 151 154 try { 155 progressMonitor.beginTask(tr("Starting to upload in one request ...")); 152 156 if (changesetProcessingType.isUseNew()) { 153 157 api.createChangeset(changeset,progressMonitor.createSubTaskMonitor(0, false)); … … 167 171 closeException.setChangeset(api.getCurrentChangeset()); 168 172 throw closeException; 169 } 173 } finally { 174 progressMonitor.finishTask(); 175 } 176 170 177 } 171 178 } … … 179 186 public void uploadOsm(String apiVersion, Collection<OsmPrimitive> primitives, Changeset changeset, ChangesetProcessingType changesetProcessingType, ProgressMonitor progressMonitor) throws OsmTransferException { 180 187 processed = new LinkedList<OsmPrimitive>(); 181 188 progressMonitor.beginTask(tr("Uploading data ...")); 182 189 api.initialize(progressMonitor); 183 190 try { … … 185 192 // 186 193 boolean casUseDiffUploads = api.hasSupportForDiffUploads(); 194 if (apiVersion == null) { 195 System.out.println(tr("WARNING: no API version defined for data to upload. Falling back to version 0.6")); 196 apiVersion = "0.6"; 197 } 187 198 boolean useDiffUpload = Main.pref.getBoolean("osm-server.atomic-upload", apiVersion.compareTo("0.6")>=0); 188 199 if (useDiffUpload && ! casUseDiffUploads) { … … 192 203 193 204 if (useDiffUpload) { 194 progressMonitor.beginTask(tr("Starting to upload in one request ...")); 195 uploadChangesAsDiffUpload(primitives,changeset, changesetProcessingType, progressMonitor); 205 uploadChangesAsDiffUpload(primitives,changeset, changesetProcessingType, progressMonitor.createSubTaskMonitor(0,false)); 196 206 } else { 197 progressMonitor.beginTask(tr("Starting to upload with one request per primitive ...")); 198 uploadChangesIndividually(primitives,changeset,changesetProcessingType, progressMonitor); 207 uploadChangesIndividually(primitives,changeset,changesetProcessingType, progressMonitor.createSubTaskMonitor(0,false)); 199 208 } 200 209 } finally {
Note:
See TracChangeset
for help on using the changeset viewer.