Ignore:
Timestamp:
2009-10-25T23:09:53+01:00 (15 years ago)
Author:
Gubaer
Message:

Added canceling of DownloadOsmTaskLists
Removed error remembering in the progress dialog

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/actions/DownloadAction.java

    r2138 r2322  
    88import java.awt.event.ActionEvent;
    99import java.awt.event.KeyEvent;
     10import java.util.List;
     11import java.util.concurrent.Future;
    1012
    1113import javax.swing.JOptionPane;
     
    1315
    1416import org.openstreetmap.josm.Main;
     17import org.openstreetmap.josm.actions.downloadtasks.DownloadTask;
     18import org.openstreetmap.josm.actions.downloadtasks.PostDownloadHandler;
     19import org.openstreetmap.josm.gui.ExceptionDialogUtil;
    1520import org.openstreetmap.josm.gui.ExtendedDialog;
    1621import org.openstreetmap.josm.gui.download.DownloadDialog;
    17 import org.openstreetmap.josm.gui.download.DownloadDialog.DownloadTask;
     22import org.openstreetmap.josm.tools.ExceptionUtil;
    1823import org.openstreetmap.josm.tools.Shortcut;
    1924import org.openstreetmap.josm.tools.WindowGeometry;
     
    6974                    Main.pref.put("download."+task.getPreferencesSuffix(), task.getCheckBox().isSelected());
    7075                    if (task.getCheckBox().isSelected()) {
    71                         task.download(this, dialog.minlat, dialog.minlon, dialog.maxlat, dialog.maxlon, null);
     76                        // asynchronously launch the download task ...
     77                        Future<?> future = task.download(this, dialog.minlat, dialog.minlon, dialog.maxlat, dialog.maxlon, null);
     78                        // ... and the continuation when the download task is finished
     79                        Main.worker.submit(new PostDownloadHandler(task, future));
    7280                        finish = true;
    7381                    }
Note: See TracChangeset for help on using the changeset viewer.