Ignore:
Timestamp:
2015-10-04T22:32:21+02:00 (9 years ago)
Author:
simon04
Message:

JOSM/reverter: Fix EDT violation - fixes #josm11857

File:
1 edited

Legend:

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

    r30359 r31594  
    44
    55import java.util.List;
     6import java.util.concurrent.Callable;
    67
    78import javax.swing.JOptionPane;
     
    1617import org.openstreetmap.josm.gui.util.GuiHelper;
    1718import org.openstreetmap.josm.io.OsmTransferException;
    18 
    1919import reverter.ChangesetReverter.RevertType;
    2020
     
    4646        if (!rev.hasMissingObjects()) return true;
    4747        if (!downloadConfirmed) {
    48             downloadConfirmed = JOptionPane.showConfirmDialog(Main.parent,
    49                     tr("This changeset has objects that are not present in current dataset.\n" +
    50                             "It is needed to download them before reverting. Do you want to continue?"),
    51                     tr("Confirm"), JOptionPane.YES_NO_OPTION) == JOptionPane.YES_OPTION;
     48            final Integer selectedOption = GuiHelper.runInEDTAndWaitAndReturn(new Callable<Integer>() {
     49                @Override
     50                public Integer call() throws Exception {
     51                    return JOptionPane.showConfirmDialog(Main.parent,
     52                            tr("This changeset has objects that are not present in current dataset.\n" +
     53                                    "It is needed to download them before reverting. Do you want to continue?"),
     54                            tr("Confirm"), JOptionPane.YES_NO_OPTION);
     55                }
     56            });
     57            downloadConfirmed = selectedOption != null && selectedOption == JOptionPane.YES_OPTION;
    5258            if (!downloadConfirmed) return false;
    5359        }
Note: See TracChangeset for help on using the changeset viewer.