Changeset 8071 in josm for trunk/src/org


Ignore:
Timestamp:
2015-02-15T21:10:53+01:00 (10 years ago)
Author:
Don-vip
Message:

fix #10960 - Add note API search dialog (modified patch by ToeBee). Enable notes by default

Location:
trunk/src/org/openstreetmap/josm
Files:
1 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/data/Preferences.java

    r7987 r8071  
    16841684
    16851685        String[] obsolete = {
     1686                "osm.notes.enableDownload" // was used prior to r8071 when notes was an hidden feature. To remove end of 2015
    16861687        };
    16871688        for (String key : obsolete) {
  • trunk/src/org/openstreetmap/josm/gui/MainMenu.java

    r7694 r8071  
    7878import org.openstreetmap.josm.actions.SaveAction;
    7979import org.openstreetmap.josm.actions.SaveAsAction;
     80import org.openstreetmap.josm.actions.SearchNotesDownloadAction;
    8081import org.openstreetmap.josm.actions.SelectAllAction;
    8182import org.openstreetmap.josm.actions.SelectNonBranchingWaySequencesAction;
     
    152153    /** File / Download object... **/
    153154    public final DownloadPrimitiveAction downloadPrimitive = new DownloadPrimitiveAction();
     155    /** File / Search Notes... **/
     156    public final SearchNotesDownloadAction searchNotes = new SearchNotesDownloadAction();
    154157    /** File / Download parent ways/relations... **/
    155158    public final DownloadReferrersAction downloadReferrers = new DownloadReferrersAction();
     
    615618        add(fileMenu, download);
    616619        add(fileMenu, downloadPrimitive);
     620        add(fileMenu, searchNotes);
    617621        add(fileMenu, downloadReferrers);
    618622        add(fileMenu, update);
  • trunk/src/org/openstreetmap/josm/gui/MapFrame.java

    r7852 r8071  
    243243        addToggleDialog(new ChangesetDialog(), true);
    244244        addToggleDialog(new MapPaintDialog());
    245         //TODO: remove this if statement once note support is complete
    246         if(Main.pref.getBoolean("osm.notes.enableDownload", false)) {
    247             addToggleDialog(noteDialog = new NotesDialog());
    248         }
     245        addToggleDialog(noteDialog = new NotesDialog());
    249246        toolBarToggle.setFloatable(false);
    250247
  • trunk/src/org/openstreetmap/josm/gui/download/DownloadDialog.java

    r7808 r8071  
    9999        cbDownloadGpxData = new JCheckBox(tr("Raw GPS data"));
    100100        cbDownloadGpxData.setToolTipText(tr("Select to download GPS traces in the selected download area."));
    101         //TODO: uncomment this and remove logic below once notes are enabled
    102         //pnl.add(cbDownloadGpxData,  GBC.std().insets(5,5,1,5));
     101        pnl.add(cbDownloadGpxData,  GBC.std().insets(5,5,1,5));
    103102        cbDownloadNotes = new JCheckBox(tr("Notes"));
    104103        cbDownloadNotes.setToolTipText(tr("Select to download notes in the selected download area."));
    105         if (Main.pref.getBoolean("osm.notes.enableDownload", false)) {
    106             pnl.add(cbDownloadGpxData,  GBC.std().insets(5,5,1,5));
    107             pnl.add(cbDownloadNotes, GBC.eol().insets(50, 5, 1, 5));
    108         } else {
    109             pnl.add(cbDownloadGpxData,  GBC.eol().insets(5,5,1,5));
    110         }
     104        pnl.add(cbDownloadNotes, GBC.eol().insets(50, 5, 1, 5));
    111105
    112106        // hook for subclasses
     
    205199    }
    206200
     201    /**
     202     * Constructs a new {@code DownloadDialog}.
     203     * @param parent the parent component
     204     */
    207205    public DownloadDialog(Component parent) {
    208206        super(JOptionPane.getFrameForComponent(parent),tr("Download"), ModalityType.DOCUMENT_MODAL);
     
    247245    /**
    248246     * Distributes a "bounding box changed" from one DownloadSelection
    249      * object to the others, so they may update or clear their input
    250      * fields.
     247     * object to the others, so they may update or clear their input fields.
    251248     *
    252249     * @param eventSource - the DownloadSelection object that fired this notification.
     
    347344        cbDownloadOsmData.setSelected(Main.pref.getBoolean("download.osm", true));
    348345        cbDownloadGpxData.setSelected(Main.pref.getBoolean("download.gps", false));
    349         //TODO: This is to make sure notes are not downloaded if the Notes checkbox isn't being displayed.
    350         //      Make it look like the ones above when notes are enabled
    351         boolean downloadNotes = Main.pref.getBoolean("download.notes", false)
    352                 && Main.pref.getBoolean("osm.notes.enableDownload", false);
    353         cbDownloadNotes.setSelected(downloadNotes);
     346        cbDownloadNotes.setSelected(Main.pref.getBoolean("download.notes", false));
    354347        cbNewLayer.setSelected(Main.pref.getBoolean("download.newlayer", false));
    355348        cbStartup.setSelected( isAutorunEnabled() );
     
    485478            }
    486479            if (!isDownloadOsmData() && !isDownloadGpxData() && !isDownloadNotes()) {
    487                 //TODO: When notes are enabled, change this message to include downloading notes
    488480                JOptionPane.showMessageDialog(
    489481                        DownloadDialog.this,
    490                         tr("<html>Neither <strong>{0}</strong> nor <strong>{1}</strong> is enabled.<br>"
    491                                 + "Please choose to either download OSM data, or GPX data, or both.</html>",
     482                        tr("<html>Neither <strong>{0}</strong> nor <strong>{1}</strong> nor <strong>{2}</strong> is enabled.<br>"
     483                                + "Please choose to either download OSM data, or GPX data, or Notes, or all.</html>",
    492484                                cbDownloadOsmData.getText(),
    493                                 cbDownloadGpxData.getText()
     485                                cbDownloadGpxData.getText(),
     486                                cbDownloadNotes.getText()
    494487                        ),
    495488                        tr("Error"),
Note: See TracChangeset for help on using the changeset viewer.