Changeset 2146 in josm


Ignore:
Timestamp:
2009-09-16T17:50:07+02:00 (15 years ago)
Author:
stoecker
Message:

applied #3425 - patch by dmuecke - Import Audio gives excessive warnings

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/layer/GpxLayer.java

    r2105 r2146  
    8181    private boolean isLocalFile;
    8282
     83    private class Markers {
     84        public boolean timedMarkersOmitted = false;
     85        public boolean untimedMarkersOmitted = false;
     86    }
     87
    8388    public GpxLayer(GpxData d) {
    8489        super((String) d.attr.get("name"));
     
    261266                        double firstStartTime = sel[0].lastModified() / 1000.0 /* ms -> seconds */
    262267                        - AudioUtil.getCalibratedDuration(sel[0]);
     268
     269                        Markers m = new Markers();
    263270                        for (int i = 0; i < sel.length; i++) {
    264                             importAudio(sel[i], ml, firstStartTime);
     271                            importAudio(sel[i], ml, firstStartTime, m);
    265272                        }
    266273                    }
     
    949956     * a single marker at the beginning of the track
    950957     * @param wavFile : the file to be associated with the markers in the new marker layer
     958     * @param markers : keeps track of warning messages to avoid repeated warnings
    951959     */
    952     private void importAudio(File wavFile, MarkerLayer ml, double firstStartTime) {
     960    private void importAudio(File wavFile, MarkerLayer ml, double firstStartTime, Markers markers) {
    953961        String uri = "file:".concat(wavFile.getAbsolutePath());
    954962        Collection<WayPoint> waypoints = new ArrayList<WayPoint>();
     
    11511159        }
    11521160
    1153         if (timedMarkersOmitted) {
     1161        if (timedMarkersOmitted && !markers.timedMarkersOmitted) {
    11541162            JOptionPane
    11551163            .showMessageDialog(
    11561164                    Main.parent,
    11571165                    tr("Some waypoints with timestamps from before the start of the track or after the end were omitted or moved to the start."));
    1158         }
    1159         if (untimedMarkersOmitted) {
     1166            markers.timedMarkersOmitted = timedMarkersOmitted;
     1167        }
     1168        if (untimedMarkersOmitted && !markers.untimedMarkersOmitted) {
    11601169            JOptionPane
    11611170            .showMessageDialog(
    11621171                    Main.parent,
    11631172                    tr("Some waypoints which were too far from the track to sensibly estimate their time were omitted."));
     1173            markers.untimedMarkersOmitted = untimedMarkersOmitted;
    11641174        }
    11651175    }
Note: See TracChangeset for help on using the changeset viewer.