Changeset 7597 in josm for trunk/src


Ignore:
Timestamp:
2014-10-04T17:54:40+02:00 (5 years ago)
Author:
Don-vip
Message:

fix #10588 - DownloadGpsTask ignores the ProgressMonitor argument given in its constructor

Location:
trunk/src/org/openstreetmap/josm
Files:
4 edited

Legend:

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

    r7575 r7597  
    6868    public Future<?> loadUrl(boolean newLayer, String url, ProgressMonitor progressMonitor) {
    6969        CheckParameterUtil.ensureParameterNotNull(url, "url");
    70         if (url.matches(PATTERN_TRACE_ID) || url.matches(PATTERN_EXTERNAL_GPX_SCRIPT) || url.matches(PATTERN_EXTERNAL_GPX_FILE)) {
     70        if (url.matches(PATTERN_TRACE_ID)
     71         || url.matches(PATTERN_EXTERNAL_GPX_SCRIPT)
     72         || url.matches(PATTERN_EXTERNAL_GPX_FILE)) {
    7173            downloadTask = new DownloadTask(newLayer,
    7274                    new OsmServerLocationReader(url), progressMonitor);
     
    101103
    102104        public DownloadTask(boolean newLayer, OsmServerReader reader, ProgressMonitor progressMonitor) {
    103             super(tr("Downloading GPS data"));
     105            super(tr("Downloading GPS data"), progressMonitor, false);
    104106            this.reader = reader;
    105107            this.newLayer = newLayer;
     
    132134            String name = newLayerName != null ? newLayerName : tr("Downloaded GPX Data");
    133135
    134             GpxImporterData layers = GpxImporter.loadLayers(rawData, reader.isGpxParsedProperly(), name, tr("Markers from {0}", name));
     136            GpxImporterData layers = GpxImporter.loadLayers(rawData, reader.isGpxParsedProperly(), name,
     137                    tr("Markers from {0}", name));
    135138
    136139            GpxLayer gpxLayer = addOrMergeLayer(layers.getGpxLayer(), findGpxMergeLayer());
  • trunk/src/org/openstreetmap/josm/actions/downloadtasks/DownloadNotesTask.java

    r7531 r7597  
    7272
    7373        public DownloadTask(OsmServerReader reader, ProgressMonitor progressMonitor) {
    74             super(tr("Downloading Notes"));
     74            super(tr("Downloading Notes"), progressMonitor, false);
    7575            this.reader = reader;
    7676        }
    77 
    7877
    7978        @Override
  • trunk/src/org/openstreetmap/josm/gui/PleaseWaitRunnable.java

    r6830 r7597  
    3232    /**
    3333     * Create the runnable object with a given message for the user.
     34     * @param title message for the user
    3435     */
    3536    public PleaseWaitRunnable(String title) {
    3637        this(title, false);
    3738    }
     39
    3840    /**
    3941     * Create the runnable object with a given message for the user.
     
    6567    }
    6668
     69    /**
     70     * Create the runnable object with a given message for the user
     71     *
     72     * @param title message for the user
     73     * @param progressMonitor progress monitor
     74     * @param ignoreException If true, exception will be propagated to calling code. If false then
     75     * exception will be thrown directly in EDT. When this runnable is executed using executor framework
     76     * then use false unless you read result of task (because exception will get lost if you don't)
     77     * @throws IllegalArgumentException thrown if parent is null
     78     */
    6779    public PleaseWaitRunnable(String title, ProgressMonitor progressMonitor, boolean ignoreException) {
    6880        this.title = title;
     
    175187    protected abstract void finish();
    176188
     189    /**
     190     * Relies the progress monitor.
     191     * @return the progress monitor
     192     */
    177193    public ProgressMonitor getProgressMonitor() {
    178194        return progressMonitor;
  • trunk/src/org/openstreetmap/josm/plugins/PluginDownloadTask.java

    r7596 r7597  
    155155        File pluginDir = Main.pref.getPluginsDirectory();
    156156        if (!pluginDir.exists() && !pluginDir.mkdirs()) {
    157             //lastException = new PluginDownloadException(tr("Failed to create plugin directory ''{0}''", pluginDir.toString()));
     157            /*lastException =*/ new PluginDownloadException(tr("Failed to create plugin directory ''{0}''", pluginDir.toString()));
    158158            failed.addAll(toUpdate);
    159159            return;
Note: See TracChangeset for help on using the changeset viewer.