Changeset 31596 in osm for applications/editors/josm


Ignore:
Timestamp:
2015-10-05T21:45:36+02:00 (9 years ago)
Author:
simon04
Message:

JOSM/reverter: Support multiple changesets at the same time - fixes #josm11699

Location:
applications/editors/josm/plugins/reverter/src/reverter
Files:
1 added
2 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/reverter/src/reverter/ChangesetIdQuery.java

    r30737 r31596  
    88import java.awt.event.WindowEvent;
    99import java.awt.event.WindowListener;
     10import java.util.Collection;
    1011import java.util.Collections;
    1112import java.util.LinkedList;
     
    2627import org.openstreetmap.josm.data.osm.DataSet;
    2728import org.openstreetmap.josm.gui.ExtendedDialog;
    28 import org.openstreetmap.josm.gui.widgets.ChangesetIdTextField;
    2929import org.openstreetmap.josm.gui.widgets.HistoryComboBox;
    3030import org.openstreetmap.josm.tools.GBC;
     
    3535public class ChangesetIdQuery extends ExtendedDialog {
    3636    private final JPanel panel = new JPanel(new GridBagLayout());
    37     private final ChangesetIdTextField tcid = new ChangesetIdTextField();
     37    private final ChangesetIdsTextField tcid = new ChangesetIdsTextField();
    3838    private final HistoryComboBox cbId = new HistoryComboBox();
    3939    private final ButtonGroup bgRevertType = new ButtonGroup();
     
    4343    private final JCheckBox cbNewLayer = new JCheckBox(tr("Download as new layer"));
    4444   
    45     public int getChangesetId() {
    46         return tcid.getChangesetId();
     45    public Collection<Integer> getIdsInReverseOrder() {
     46        return tcid.getIdsInReverseOrder();
    4747    }
    4848   
  • applications/editors/josm/plugins/reverter/src/reverter/RevertChangesetAction.java

    r29769 r31596  
    55import java.awt.event.ActionEvent;
    66import java.awt.event.KeyEvent;
     7import java.util.Collection;
    78
    89import org.openstreetmap.josm.Main;
     
    2728        final ChangesetIdQuery dlg = new ChangesetIdQuery();
    2829        if (dlg.showDialog().getValue() != 1) return;
    29         final int changesetId = dlg.getChangesetId();
     30        final Collection<Integer> changesetIds = dlg.getIdsInReverseOrder();
    3031        final RevertType revertType = dlg.getRevertType();
    31         if (changesetId == 0) return;
    3232        if (revertType == null) return;
    3333
    34         boolean newLayer = dlg.isNewLayerRequired();
    35         Main.worker.submit(new RevertChangesetTask(changesetId, revertType, newLayer, newLayer));
     34        final boolean newLayer = dlg.isNewLayerRequired();
     35        final boolean autoConfirmDownload = newLayer || changesetIds.size() > 1;
     36        for (Integer changesetId : changesetIds) {
     37            Main.worker.submit(new RevertChangesetTask(changesetId, revertType, autoConfirmDownload, newLayer));
     38        }
    3639    }
    3740}
Note: See TracChangeset for help on using the changeset viewer.