Ticket #18523: 18523.ui_revert.patch
File 18523.ui_revert.patch, 3.6 KB (added by , 5 years ago) |
---|
-
src/org/openstreetmap/josm/gui/io/BasicUploadSettingsPanel.java
3 3 4 4 import static org.openstreetmap.josm.tools.I18n.tr; 5 5 6 import java.awt.BorderLayout; 6 7 import java.awt.GridBagLayout; 7 8 import java.awt.event.ActionEvent; 8 9 import java.awt.event.ActionListener; … … 27 28 import javax.swing.event.ChangeEvent; 28 29 import javax.swing.event.ChangeListener; 29 30 import javax.swing.event.HyperlinkEvent; 31 import javax.swing.event.HyperlinkListener; 30 32 31 33 import org.openstreetmap.josm.data.osm.Changeset; 32 34 import org.openstreetmap.josm.gui.MainApplication; … … 86 88 pnl.add(hcbUploadComment, GBC.eol().fill(GBC.HORIZONTAL)); 87 89 88 90 JEditorPane sourceLabel = new JMultilineLabel("<html><b>" + tr("Specify the data source for the changes") + ":</b>"); 89 pnl.add(sourceLabel, GBC.eol().insets(0, 8, 10, 0).fill(GBC.HORIZONTAL));90 91 JEditorPane obtainSourceOnce = new JMultilineLabel( 91 92 "<html><a href=\"urn:changeset-source\">" + tr("just once") + "</a></html>"); 92 93 obtainSourceOnce.addHyperlinkListener(e -> { … … 105 106 obtainSource.add(obtainSourceAutomatically, GBC.std().anchor(GBC.WEST)); 106 107 obtainSource.add(obtainSourceOnce, GBC.std().anchor(GBC.WEST)); 107 108 obtainSource.add(new JLabel(), GBC.eol().fill(GBC.HORIZONTAL)); 108 pnl.add(obtainSource, GBC.eol().insets(0, 0, 10, 3).fill(GBC.HORIZONTAL)); 109 109 110 // Revert back to previous UI due to #18523. 111 // pnl.add(sourceLabel, GBC.eol().insets(0, 8, 10, 0).fill(GBC.HORIZONTAL)); 112 // pnl.add(obtainSource, GBC.eol().insets(0, 0, 10, 3).fill(GBC.HORIZONTAL)); 113 JMultilineLabel obtainSourceTmp = new JMultilineLabel("<html><b>" + tr("Specify the data source for the changes") 114 + "</b> (<a href=\"urn:changeset-source\">" + tr("obtain from current layers") + "</a>)<b>:</b>"); 115 obtainSourceTmp.addHyperlinkListener(obtainSourceOnce.getListeners(HyperlinkListener.class)[0]); 116 pnl.add(obtainSourceTmp, GBC.eol().insets(0, 8, 10, 3).fill(GBC.HORIZONTAL)); 117 110 118 hcbUploadSource.setToolTipText(tr("Enter a source")); 111 119 hcbUploadSource.setMaxTextLength(Changeset.MAX_CHANGESET_TAG_LENGTH); 112 120 populateHistoryComboBox(hcbUploadSource, SOURCE_HISTORY_KEY, getDefaultSources()); … … 120 128 pnl.addAncestorListener(new AncestorListener() { 121 129 @Override 122 130 public void ancestorAdded(AncestorEvent event) { 131 obtainSourceAutomatically.setSelected(Config.getPref().getBoolean("upload.source.obtainautomatically")); 123 132 if (obtainSourceAutomatically.isSelected()) 124 133 automaticallyAddSource(); 125 134 } … … 176 185 } 177 186 178 187 protected void build() { 179 setLayout(new GridBagLayout());188 setLayout(new BorderLayout()); 180 189 setBorder(BorderFactory.createEmptyBorder(3, 3, 3, 3)); 181 add(buildUploadCommentPanel(), GBC.eol().fill(GBC.BOTH));182 add(pnlUploadParameterSummary, GBC.eol().fill(GBC.BOTH));183 add(cbRequestReview, GBC.eol().fill(GBC.BOTH));190 add(buildUploadCommentPanel(), BorderLayout.NORTH); 191 add(pnlUploadParameterSummary, BorderLayout.CENTER); 192 add(cbRequestReview, BorderLayout.SOUTH); 184 193 cbRequestReview.addItemListener(e -> changesetReviewModel.setReviewRequested(e.getStateChange() == ItemEvent.SELECTED)); 185 194 } 186 195