Ignore:
Timestamp:
2009-08-02T18:02:44+02:00 (17 years ago)
Author:
Gubaer
Message:

fixed two issues in #3141: conflict resolution flags false conflicts on nodes

File:
1 edited

Legend:

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

    r1872 r1881  
    1010import java.util.List;
    1111
    12 import javax.swing.JOptionPane;
    13 
    14 import org.openstreetmap.josm.Main;
    1512import org.openstreetmap.josm.actions.downloadtasks.DownloadOsmTaskList;
    1613import org.openstreetmap.josm.data.osm.DataSource;
    17 import org.openstreetmap.josm.gui.OptionPaneUtil;
    1814import org.openstreetmap.josm.gui.progress.PleaseWaitProgressMonitor;
    1915import org.openstreetmap.josm.tools.Shortcut;
     
    4339        if (! isEnabled())
    4440            return;
     41        if (getEditLayer() == null)
     42            return;
     43
    4544        int bboxCount = 0;
    4645        List<Area> areas = new ArrayList<Area>();
    47         for(DataSource ds : Main.map.mapView.getEditLayer().data.dataSources) {
     46        for(DataSource ds : getEditLayer().data.dataSources) {
    4847            areas.add(new Area(ds.bounds.asRect()));
    4948        }
     
    7372
    7473        if(bboxCount == 0) {
    75             OptionPaneUtil.showMessageDialog(
    76                     Main.parent,
    77                     tr("No data to update found. Have you already opened or downloaded a data layer?"),
    78                     tr("No data"),
    79                     JOptionPane.WARNING_MESSAGE
    80             );
    81             return;
     74            // no bounds defined in the dataset? we update all primitives in the data set
     75            // using a series of multi fetch requests
     76            //
     77            new UpdateSelectionAction().updatePrimitives(getEditLayer().data.allPrimitives());
     78        } else {
     79            // bounds defined? => use the bbox downloader
     80            //
     81            new DownloadOsmTaskList().download(false, areas, new PleaseWaitProgressMonitor());
    8282        }
    83 
    84         new DownloadOsmTaskList().download(false, areas, new PleaseWaitProgressMonitor());
    8583    }
    8684}
Note: See TracChangeset for help on using the changeset viewer.