Index: applications/editors/josm/plugins/download_along/src/org/openstreetmap/josm/plugin/download_along/DownloadAlong.java
===================================================================
--- applications/editors/josm/plugins/download_along/src/org/openstreetmap/josm/plugin/download_along/DownloadAlong.java	(revision 22294)
+++ applications/editors/josm/plugins/download_along/src/org/openstreetmap/josm/plugin/download_along/DownloadAlong.java	(revision 22295)
@@ -12,4 +12,5 @@
 
 import javax.swing.JLabel;
+import javax.swing.JList;
 import javax.swing.JMenuItem;
 import javax.swing.JOptionPane;
@@ -33,4 +34,7 @@
 
 public class DownloadAlong extends Plugin {
+  private static final String PREF_DOWNLOAD_ALONG_TRACK_DISTANCE = "downloadAlong.downloadAlongTrack.distance";
+  private static final String PREF_DOWNLOAD_ALONG_TRACK_AREA = "downloadAlong.downloadAlongTrack.area";
+
   JMenuItem DownloadAlong;
 
@@ -47,4 +51,5 @@
 		 */
     private static final long serialVersionUID = 1L;
+
     public DownloadAlongAction() {
       super(tr("Download along..."), "download_along",
@@ -71,4 +76,44 @@
       }
 
+      JPanel msg = new JPanel(new GridBagLayout());
+      Integer dist[] = { 5000, 500, 50 };
+      Integer area[] = { 20, 10, 5, 1 };
+
+      msg.add(new JLabel(tr("Download everything within:")), GBC.eol());
+      String s[] = new String[dist.length];
+      for (int i = 0; i < dist.length; ++i) {
+        s[i] = tr("{0} meters", dist[i]);
+      }
+      JList buffer = new JList(s);
+      buffer.setSelectedIndex(Main.pref.getInteger(
+          PREF_DOWNLOAD_ALONG_TRACK_DISTANCE, 0));
+      msg.add(buffer, GBC.eol());
+
+      msg.add(new JLabel(tr("Maximum area per request:")), GBC.eol());
+      s = new String[area.length];
+      for (int i = 0; i < area.length; ++i) {
+        s[i] = tr("{0} sq km", area[i]);
+      }
+      JList maxRect = new JList(s);
+      maxRect.setSelectedIndex(Main.pref.getInteger(
+          PREF_DOWNLOAD_ALONG_TRACK_AREA, 0));
+      msg.add(maxRect, GBC.eol());
+
+      int ret = JOptionPane.showConfirmDialog(Main.parent, msg,
+          tr("Download from OSM along this track"),
+          JOptionPane.OK_CANCEL_OPTION, JOptionPane.QUESTION_MESSAGE);
+      switch (ret) {
+      case JOptionPane.CANCEL_OPTION:
+      case JOptionPane.CLOSED_OPTION:
+        return;
+      default:
+        // continue
+      }
+
+      Main.pref.putInteger(PREF_DOWNLOAD_ALONG_TRACK_DISTANCE, buffer
+          .getSelectedIndex());
+      Main.pref.putInteger(PREF_DOWNLOAD_ALONG_TRACK_AREA, maxRect
+          .getSelectedIndex());
+
       /*
        * Find the average latitude for the data we're contemplating, so we can
@@ -96,12 +141,10 @@
        * because it has more than 50k nodes.
        */
-      // Integer i = buffer.getSelectedIndex();
-      // int buffer_dist = dist[i < 0 ? 0 : i];
-      int buffer_dist = 5000;
+      Integer i = buffer.getSelectedIndex();
+      int buffer_dist = dist[i < 0 ? 0 : i];
       double buffer_y = buffer_dist / 100000.0;
       double buffer_x = buffer_y / scale;
-      // i = maxRect.getSelectedIndex();
-      // double max_area = area[i < 0 ? 0 : i] / 10000.0 / scale;
-      double max_area = 20 / 10000.0 / scale;
+      i = maxRect.getSelectedIndex();
+      double max_area = area[i < 0 ? 0 : i] / 10000.0 / scale;
       Area a = new Area();
       Rectangle2D r = new Rectangle2D.Double();
@@ -148,5 +191,5 @@
       addToDownload(a, a.getBounds(), toDownload, max_area);
 
-      JPanel msg = new JPanel(new GridBagLayout());
+      msg = new JPanel(new GridBagLayout());
 
       msg.add(new JLabel(tr("<html>This action will require {0} individual<br>"
@@ -155,5 +198,5 @@
 
       if (toDownload.size() > 1) {
-        int ret = JOptionPane.showConfirmDialog(Main.parent, msg,
+        ret = JOptionPane.showConfirmDialog(Main.parent, msg,
             tr("Download from OSM along this track"),
             JOptionPane.OK_CANCEL_OPTION, JOptionPane.PLAIN_MESSAGE);
@@ -183,34 +226,38 @@
     }
 
-    private static void addToDownload(Area a, Rectangle2D r, Collection<Rectangle2D> results, double max_area) {
+    private static void addToDownload(Area a, Rectangle2D r,
+        Collection<Rectangle2D> results, double max_area) {
       Area tmp = new Area(r);
       // intersect with sought-after area
       tmp.intersect(a);
       if (tmp.isEmpty())
-          return;
+        return;
       Rectangle2D bounds = tmp.getBounds2D();
       if (bounds.getWidth() * bounds.getHeight() > max_area) {
-          // the rectangle gets too large; split it and make recursive call.
-          Rectangle2D r1;
-          Rectangle2D r2;
-          if (bounds.getWidth() > bounds.getHeight()) {
-              // rectangles that are wider than high are split into a left and right half,
-              r1 = new Rectangle2D.Double(bounds.getX(), bounds.getY(), bounds.getWidth() / 2, bounds.getHeight());
-              r2 = new Rectangle2D.Double(bounds.getX() + bounds.getWidth() / 2, bounds.getY(),
-                      bounds.getWidth() / 2, bounds.getHeight());
-          } else {
-              // others into a top and bottom half.
-              r1 = new Rectangle2D.Double(bounds.getX(), bounds.getY(), bounds.getWidth(), bounds.getHeight() / 2);
-              r2 = new Rectangle2D.Double(bounds.getX(), bounds.getY() + bounds.getHeight() / 2, bounds.getWidth(),
-                      bounds.getHeight() / 2);
-          }
-          addToDownload(a, r1, results, max_area);
-          addToDownload(a, r2, results, max_area);
+        // the rectangle gets too large; split it and make recursive call.
+        Rectangle2D r1;
+        Rectangle2D r2;
+        if (bounds.getWidth() > bounds.getHeight()) {
+          // rectangles that are wider than high are split into a left and right
+          // half,
+          r1 = new Rectangle2D.Double(bounds.getX(), bounds.getY(), bounds
+              .getWidth() / 2, bounds.getHeight());
+          r2 = new Rectangle2D.Double(bounds.getX() + bounds.getWidth() / 2,
+              bounds.getY(), bounds.getWidth() / 2, bounds.getHeight());
+        } else {
+          // others into a top and bottom half.
+          r1 = new Rectangle2D.Double(bounds.getX(), bounds.getY(), bounds
+              .getWidth(), bounds.getHeight() / 2);
+          r2 = new Rectangle2D.Double(bounds.getX(), bounds.getY()
+              + bounds.getHeight() / 2, bounds.getWidth(),
+              bounds.getHeight() / 2);
+        }
+        addToDownload(a, r1, results, max_area);
+        addToDownload(a, r2, results, max_area);
       } else {
-          results.add(bounds);
-      }
-  }
-    
-    
+        results.add(bounds);
+      }
+    }
+
     @Override
     protected void updateEnabledState(
