Ignore:
Timestamp:
2014-01-06T21:46:07+01:00 (12 years ago)
Author:
simon04
Message:

fix #9514 fix #9484 fix #9502 - Upload dialog: make source field behave like comment field, provide link "obtain from current layers" to insert current layers in field, display Bing layer as "Bing"

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/io/BasicUploadSettingsPanel.java

    r6631 r6654  
    2121import javax.swing.Action;
    2222import javax.swing.BorderFactory;
    23 import javax.swing.JLabel;
     23import javax.swing.JEditorPane;
    2424import javax.swing.JPanel;
     25import javax.swing.event.HyperlinkEvent;
     26import javax.swing.event.HyperlinkListener;
    2527
    2628import org.openstreetmap.josm.Main;
    2729import org.openstreetmap.josm.data.osm.Changeset;
    2830import org.openstreetmap.josm.gui.widgets.HistoryComboBox;
     31import org.openstreetmap.josm.gui.widgets.JosmEditorPane;
    2932import org.openstreetmap.josm.tools.CheckParameterUtil;
    3033import org.openstreetmap.josm.tools.GBC;
     
    5457        pnl.setLayout(new GridBagLayout());
    5558
    56         pnl.add(new JLabel(tr("Provide a brief comment for the changes you are uploading:")), GBC.eol().insets(0, 5, 10, 3));
     59        final JEditorPane commentLabel = JosmEditorPane.createJLabelLikePane();
     60        commentLabel.setText("<html><b>" + tr("Provide a brief comment for the changes you are uploading:"));
     61        pnl.add(commentLabel, GBC.eol().insets(0, 5, 10, 3));
    5762        hcbUploadComment.setToolTipText(tr("Enter an upload comment"));
    5863        hcbUploadComment.setMaxTextLength(Changeset.MAX_COMMENT_LENGTH);
     
    6570        pnl.add(hcbUploadComment, GBC.eol().fill(GBC.HORIZONTAL));
    6671
    67         pnl.add(new JLabel(tr("Specify the data source for the changes:")), GBC.eol().insets(0, 8, 10, 3));
     72        final JEditorPane sourceLabel = JosmEditorPane.createJLabelLikePane();
     73        sourceLabel.setText("<html><b>" + tr("Specify the data source for the changes")
     74                + "</b> (<a href=\"urn:changeset-source\">" + tr("obtain from current layers") + "</a>)<b>:</b>");
     75        sourceLabel.addHyperlinkListener(new HyperlinkListener() {
     76            @Override
     77            public void hyperlinkUpdate(HyperlinkEvent e) {
     78                if (HyperlinkEvent.EventType.ACTIVATED.equals(e.getEventType())) {
     79                    hcbUploadSource.setText(Main.map.mapView.getLayerInformationForSourceTag());
     80                }
     81            }
     82        });
     83        pnl.add(sourceLabel, GBC.eol().insets(0, 8, 10, 3));
     84
    6885        hcbUploadSource.setToolTipText(tr("Enter a source"));
    69         List<String> sourceHistory = new LinkedList<String>(Main.pref.getCollection(SOURCE_HISTORY_KEY, Arrays.asList("knowledge", "survey")));
     86        List<String> sourceHistory = new LinkedList<String>(Main.pref.getCollection(SOURCE_HISTORY_KEY, Arrays.asList("knowledge", "survey", "Bing")));
    7087        Collections.reverse(sourceHistory); // we have to reverse the history, because ComboBoxHistory will reverse it again in addElement()
    7188        hcbUploadSource.setPossibleItems(sourceHistory);
Note: See TracChangeset for help on using the changeset viewer.