Ticket #18870: DownloadAlongAction.patch

File DownloadAlongAction.patch, 1.8 KB (added by Hb---, 4 years ago)
  • /browser/josm/trunk/src/org/openstreetmap/josm/actions/

    old new  
    131131        if (toDownload.isEmpty()) {
    132132            return;
    133133        }
    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;
     134        if (toDownload.size() > 1) {
     135            JPanel msg = new JPanel(new GridBagLayout());
     136            msg.add(new JLabel(
     137                    trn("<html>This action will require {0} individual<br>" + "download request. Do you wish<br>to continue?</html>",
     138                            "<html>This action will require {0} individual<br>" + "download requests. Do you wish<br>to continue?</html>"
     139                            toDownload.size(), toDownload.size()), GBC.eol());
     140            if (!GraphicsEnvironment.isHeadless() && JOptionPane.OK_OPTION != JOptionPane.showConfirmDialog(
     141                    MainApplication.getMainFrame(), msg, title, JOptionPane.OK_CANCEL_OPTION, JOptionPane.PLAIN_MESSAGE)) {
     142                return;
     143            }
    141144        }
    142145        final PleaseWaitProgressMonitor monitor = new PleaseWaitProgressMonitor(tr("Download data"));
    143146        final Future<?> future = new DownloadTaskList(Config.getPref().getBoolean("download.along.zoom-after-download"))