Changeset 15752 in josm


Ignore:
Timestamp:
2020-01-22T22:31:24+01:00 (5 weeks ago)
Author:
Don-vip
Message:

fix #18523 - Upload dialog: Switch from BorderLayout to GridBagLayout (patch by taylor.smock)

File:
1 edited

Legend:

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

    r15604 r15752  
    44import static org.openstreetmap.josm.tools.I18n.tr;
    55
    6 import java.awt.BorderLayout;
    76import java.awt.GridBagLayout;
    87import java.awt.event.ActionEvent;
     
    6362    private final HistoryComboBox hcbUploadComment = new HistoryComboBox();
    6463    private final HistoryComboBox hcbUploadSource = new HistoryComboBox();
     64    private final transient JCheckBox obtainSourceAutomatically = new JCheckBox(
     65            tr("Automatically obtain source from current layers"));
    6566    /** the panel with a summary of the upload parameters */
    6667    private final UploadParameterSummaryPanel pnlUploadParameterSummary = new UploadParameterSummaryPanel();
     
    9495            }
    9596        });
    96         JCheckBox obtainSourceAutomatically = new JCheckBox(tr("Automatically obtain source from current layers"));
    9797        obtainSourceAutomatically.setSelected(Config.getPref().getBoolean("upload.source.obtainautomatically", false));
    9898        obtainSourceAutomatically.addActionListener(e -> {
     
    177177
    178178    protected void build() {
    179         setLayout(new BorderLayout());
     179        setLayout(new GridBagLayout());
    180180        setBorder(BorderFactory.createEmptyBorder(3, 3, 3, 3));
    181         add(buildUploadCommentPanel(), BorderLayout.NORTH);
    182         add(pnlUploadParameterSummary, BorderLayout.CENTER);
    183         add(cbRequestReview, BorderLayout.SOUTH);
     181        add(buildUploadCommentPanel(), GBC.eol().fill(GBC.BOTH));
     182        add(pnlUploadParameterSummary, GBC.eol().fill(GBC.HORIZONTAL));
     183        add(cbRequestReview, GBC.eol().fill(GBC.HORIZONTAL));
    184184        cbRequestReview.addItemListener(e -> changesetReviewModel.setReviewRequested(e.getStateChange() == ItemEvent.SELECTED));
    185185    }
     
    228228        hcbUploadSource.addCurrentItemToHistory();
    229229        Config.getPref().putList(SOURCE_HISTORY_KEY, hcbUploadSource.getHistory());
     230
     231        // store current value of obtaining source automatically
     232        Config.getPref().putBoolean("upload.source.obtainautomatically", obtainSourceAutomatically.isSelected());
    230233    }
    231234
Note: See TracChangeset for help on using the changeset viewer.