Changeset 16066 in josm


Ignore:
Timestamp:
2020-03-08T09:03:30+01:00 (5 years ago)
Author:
simon04
Message:

fix #18870 - DownloadAlongAction: suppress multiple requests dialog for only one server request in DownloadAlong (patch by Hb---, modified)

File:
1 edited

Legend:

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

    r15363 r16066  
    33
    44import static org.openstreetmap.josm.tools.I18n.tr;
     5import static org.openstreetmap.josm.tools.I18n.trn;
    56
    67import java.awt.GraphicsEnvironment;
     
    132133            return;
    133134        }
    134         JPanel msg = new JPanel(new GridBagLayout());
    135         msg.add(new JLabel(
    136                 tr("<html>This action will require {0} individual<br>" + "download requests. Do you wish<br>to continue?</html>",
    137                         toDownload.size())), GBC.eol());
    138         if (!GraphicsEnvironment.isHeadless() && JOptionPane.OK_OPTION != JOptionPane.showConfirmDialog(
    139                 MainApplication.getMainFrame(), msg, title, JOptionPane.OK_CANCEL_OPTION, JOptionPane.PLAIN_MESSAGE)) {
    140             return;
     135        if (toDownload.size() > 1) {
     136            JPanel msg = new JPanel(new GridBagLayout());
     137            msg.add(new JLabel(trn(
     138                    "<html>This action will require {0} individual<br>download request. Do you wish<br>to continue?</html>",
     139                    "<html>This action will require {0} individual<br>download requests. Do you wish<br>to continue?</html>",
     140                    toDownload.size(), toDownload.size())), GBC.eol());
     141            if (!GraphicsEnvironment.isHeadless() && JOptionPane.OK_OPTION != JOptionPane.showConfirmDialog(
     142                    MainApplication.getMainFrame(), msg, title, JOptionPane.OK_CANCEL_OPTION, JOptionPane.PLAIN_MESSAGE)) {
     143                return;
     144            }
    141145        }
    142146        final PleaseWaitProgressMonitor monitor = new PleaseWaitProgressMonitor(tr("Download data"));
Note: See TracChangeset for help on using the changeset viewer.