Changeset 2598 in josm for trunk/src/org/openstreetmap/josm/actions/upload/ApiPreconditionCheckerHook.java
- Timestamp:
- 2009-12-09T21:24:32+01:00 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/upload/ApiPreconditionCheckerHook.java
r2569 r2598 23 23 OsmApi api = OsmApi.getOsmApi(); 24 24 try { 25 // FIXME: this should run asynchronously and a progress monitor 26 // should be displayed. 25 27 api.initialize(NullProgressMonitor.INSTANCE); 26 28 long maxNodes = 0; … … 28 30 maxNodes = api.getCapabilities().getLong("waynodes","maximum"); 29 31 } 30 long maxElements = 0;31 if (api.getCapabilities().isDefined("changesets", "maximum_elements")) {32 maxElements = api.getCapabilities().getLong("changesets", "maximum_elements");33 }34 35 32 if (maxNodes > 0) { 36 33 if( !checkMaxNodes(apiData.getPrimitivesToAdd(), maxNodes)) … … 40 37 if( !checkMaxNodes(apiData.getPrimitivesToDelete(), maxNodes)) 41 38 return false; 42 }43 44 if (maxElements > 0) {45 int total = 0;46 total = apiData.getPrimitivesToAdd().size() + apiData.getPrimitivesToUpdate().size() + apiData.getPrimitivesToDelete().size();47 if(total > maxElements) {48 JOptionPane.showMessageDialog(49 Main.parent,50 tr("Current number of changes exceeds the max. number of changes, current is {0}, max is {1}",51 total,52 maxElements53 ),54 tr("API Capabilities Violation"),55 JOptionPane.ERROR_MESSAGE56 );57 return false;58 }59 39 } 60 40 } catch (OsmApiInitializationException e) {
Note:
See TracChangeset
for help on using the changeset viewer.