Changeset 30031 in osm for applications/editors/josm/plugins/reverter
- Timestamp:
- 2013-10-27T15:19:50+01:00 (11 years ago)
- Location:
- applications/editors/josm/plugins/reverter/src/reverter
- Files:
-
- 1 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/reverter/src/reverter/ChangesetReverter.java
r30000 r30031 55 55 SELECTION_WITH_UNDELETE 56 56 } 57 58 public static final Collection<Long> MODERATOR_REDACTION_ACCOUNTS = Collections.unmodifiableCollection(Arrays.asList( 59 722137L, // OSMF Redaction Account 60 760215L // pnorman redaction revert 61 )); 57 62 58 63 public final int changesetId; … … 122 127 * @param monitor 123 128 * @throws OsmTransferException 129 * @throws RevertRedactedChangesetException 124 130 */ 125 131 public ChangesetReverter(int changesetId, RevertType revertType, boolean newLayer, ProgressMonitor monitor) 126 throws OsmTransferException {132 throws OsmTransferException, RevertRedactedChangesetException { 127 133 this.changesetId = changesetId; 128 134 if (newLayer) { … … 137 143 OsmServerChangesetReader csr = new OsmServerChangesetReader(); 138 144 monitor.beginTask("", 2); 145 changeset = csr.readChangeset(changesetId, monitor.createSubTaskMonitor(1, false)); 146 if (MODERATOR_REDACTION_ACCOUNTS.contains(changeset.getUser().getId())) { 147 throw new RevertRedactedChangesetException(tr("It is not allowed to revert changeset from {0}", changeset.getUser().getName())); 148 } 139 149 try { 140 changeset = csr.readChangeset(changesetId, monitor.createSubTaskMonitor(1, false));141 150 cds = csr.downloadChangeset(changesetId, monitor.createSubTaskMonitor(1, false)); 142 151 } finally { -
applications/editors/josm/plugins/reverter/src/reverter/RevertChangesetTask.java
r29553 r30031 10 10 import org.openstreetmap.josm.command.Command; 11 11 import org.openstreetmap.josm.command.ConflictAddCommand; 12 import org.openstreetmap.josm.gui.Notification; 12 13 import org.openstreetmap.josm.gui.PleaseWaitRunnable; 13 14 import org.openstreetmap.josm.gui.progress.PleaseWaitProgressMonitor; … … 64 65 protected void realRun() throws OsmTransferException { 65 66 progressMonitor.indeterminateSubTask(tr("Downloading changeset")); 66 rev = new ChangesetReverter(changesetId, revertType, newLayer, 67 progressMonitor.createSubTaskMonitor(0, true)); 67 try { 68 rev = new ChangesetReverter(changesetId, revertType, newLayer, 69 progressMonitor.createSubTaskMonitor(0, true)); 70 } catch (final RevertRedactedChangesetException e) { 71 GuiHelper.runInEDT(new Runnable() { 72 @Override 73 public void run() { 74 new Notification( 75 e.getMessage()+"<br>"+ 76 tr("See {0}", "<a href=\"http://www.openstreetmap.org/redactions\">http://www.openstreetmap.org/redactions</a>")) 77 .setIcon(JOptionPane.ERROR_MESSAGE) 78 .setDuration(Notification.TIME_LONG) 79 .show(); 80 } 81 }); 82 progressMonitor.cancel(); 83 } 68 84 if (progressMonitor.isCanceled()) return; 69 85
Note:
See TracChangeset
for help on using the changeset viewer.