Ignore:
Timestamp:
2013-12-05T22:20:57+01:00 (6 years ago)
Author:
simon04
Message:

Load and display changeset comment in history dialog

Location:
trunk/src/org/openstreetmap/josm/gui/history
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/history/HistoryLoadTask.java

    r6316 r6440  
    1010import java.util.Collection;
    1111import java.util.HashSet;
     12import java.util.List;
    1213import java.util.Set;
    1314
     15import org.openstreetmap.josm.data.osm.Changeset;
    1416import org.openstreetmap.josm.data.osm.OsmPrimitive;
    1517import org.openstreetmap.josm.data.osm.OsmPrimitiveType;
     
    2123import org.openstreetmap.josm.gui.ExceptionDialogUtil;
    2224import org.openstreetmap.josm.gui.PleaseWaitRunnable;
     25import org.openstreetmap.josm.io.ChangesetQuery;
     26import org.openstreetmap.josm.io.OsmServerChangesetReader;
    2327import org.openstreetmap.josm.io.OsmServerHistoryReader;
    2428import org.openstreetmap.josm.io.OsmTransferException;
     
    201205                    reader = new OsmServerHistoryReader(pid.getType(), pid.getUniqueId());
    202206                    ds = reader.parseHistory(progressMonitor.createSubTaskMonitor(1, false));
     207                    // load corresponding changesets (mostly for changeset comment)
     208                    for (final Changeset i : new OsmServerChangesetReader().queryChangesets(
     209                            new ChangesetQuery().forChangesetIds(ds.getChangesetIds()), progressMonitor.createSubTaskMonitor(1, false))) {
     210                        ds.putChangeset(i);
     211                    }
    203212                } catch(OsmTransferException e) {
    204213                    if (canceled)
  • trunk/src/org/openstreetmap/josm/gui/history/VersionInfoPanel.java

    r6340 r6440  
    55
    66import java.awt.BorderLayout;
     7import java.awt.Color;
    78import java.awt.GridBagConstraints;
    89import java.awt.GridBagLayout;
     
    1617import javax.swing.JLabel;
    1718import javax.swing.JPanel;
     19import javax.swing.JTextArea;
    1820
    1921import org.openstreetmap.josm.Main;
     
    3941    private UrlLabel lblUser;
    4042    private UrlLabel lblChangeset;
     43    private JTextArea lblChangesetComment;
    4144
    4245    protected void build() {
     
    5558        pnlUserAndChangeset.add(lblChangeset);
    5659
     60        lblChangesetComment = new JTextArea();
     61        lblChangesetComment.setLineWrap(true);
     62        lblChangesetComment.setEditable(false);
     63        lblChangesetComment.setBackground(new Color(0, 0, 0, 0));
     64
    5765        setLayout(new GridBagLayout());
    5866        GridBagConstraints gc = new GridBagConstraints();
     
    6573        gc.weighty = 0.0;
    6674        add(pnlUserAndChangeset, gc);
     75        gc.gridy = 2;
     76        add(lblChangesetComment, gc);
    6777    }
    6878
     
    132142            lblChangeset.setUrl(url);
    133143            lblChangeset.setDescription(Long.toString(getPrimitive().getChangesetId()));
     144            final String comment = getPrimitive().getChangeset() != null ? getPrimitive().getChangeset().get("comment") : null;
     145            lblChangesetComment.setText(comment);
     146            lblChangesetComment.setToolTipText(tr("Changeset comment"));
    134147
    135148            try {
Note: See TracChangeset for help on using the changeset viewer.