Ignore:
Timestamp:
2010-03-11T00:58:51+01:00 (16 years ago)
Author:
pieren
Message:

improve download cancellation

File:
1 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/DownloadSVGTask.java

    r20390 r20412  
    4646    private String svg = null;
    4747    private EastNorthBound viewBox = null;
     48    private static String errorMessage;
    4849
    4950    public DownloadSVGTask(WMSLayer wmsLayer) {
     
    5758    public void realRun() throws IOException, OsmTransferException {
    5859        progressMonitor.indeterminateSubTask(tr("Contacting WMS Server..."));
     60        errorMessage = null;
    5961        try {
    6062            if (wmsInterface.retrieveInterface(wmsLayer)) {
     
    7173        } catch (DuplicateLayerException e) {
    7274            System.err.println("removed a duplicated layer");
     75        } catch (WMSException e) {
     76            errorMessage = e.getMessage();
     77            grabber.getWmsInterface().resetCookie();
    7378        }
    7479    }
     
    218223        }
    219224        Main.worker.execute(new DownloadSVGTask(wmsLayer));
     225        if (errorMessage != null)
     226            JOptionPane.showMessageDialog(Main.parent, errorMessage);
    220227    }
    221228
Note: See TracChangeset for help on using the changeset viewer.