Ignore:
Timestamp:
2017-08-06T20:13:06+02:00 (7 years ago)
Author:
michael2402
Message:

Apply #15057: Improve the over pass turbo dialog

Adds the ability to add favorites and a new wizard dialog with examples.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/download/DownloadDialog.java

    r12523 r12574  
    2020import java.util.ArrayList;
    2121import java.util.List;
     22import java.util.Optional;
    2223
    2324import javax.swing.AbstractAction;
     
    458459
    459460    /**
    460      * Replies the currently selected download area.
    461      * @return the currently selected download area. May be {@code null}, if no download area is selected yet.
    462      */
    463     public Bounds getSelectedDownloadArea() {
    464         return currentBounds;
     461     * Returns an {@link Optional} of the currently selected download area.
     462     * @return An {@link Optional} of the currently selected download area.
     463     * @since 12574 Return type changed to optional
     464     */
     465    public Optional<Bounds> getSelectedDownloadArea() {
     466        return Optional.ofNullable(currentBounds);
    465467    }
    466468
     
    525527
    526528        public void run() {
    527             if (currentBounds == null) {
    528                 JOptionPane.showMessageDialog(
    529                         DownloadDialog.this,
    530                         tr("Please select a download area first."),
    531                         tr("Error"),
    532                         JOptionPane.ERROR_MESSAGE
    533                 );
    534                 return;
    535             }
     529            /*
     530             * Checks if the user selected the type of data to download. At least one the following
     531             * must be chosen : raw osm data, gpx data, notes.
     532             * If none of those are selected, then the corresponding dialog is shown to inform the user.
     533             */
    536534            if (!isDownloadOsmData() && !isDownloadGpxData() && !isDownloadNotes()) {
    537535                JOptionPane.showMessageDialog(
    538536                        DownloadDialog.this,
    539537                        tr("<html>Neither <strong>{0}</strong> nor <strong>{1}</strong> nor <strong>{2}</strong> is enabled.<br>"
    540                                 + "Please choose to either download OSM data, or GPX data, or Notes, or all.</html>",
     538                                        + "Please choose to either download OSM data, or GPX data, or Notes, or all.</html>",
    541539                                cbDownloadOsmData.getText(),
    542540                                cbDownloadGpxData.getText(),
     
    548546                return;
    549547            }
     548
    550549            setCanceled(false);
    551550            setVisible(false);
Note: See TracChangeset for help on using the changeset viewer.