Ticket #18523: 18523.patch

File 18523.patch, 2.6 KB (added by taylor.smock, 5 years ago)

Initial patch that "fixes" the problem

  • src/org/openstreetmap/josm/gui/io/BasicUploadSettingsPanel.java

     
    44import static org.openstreetmap.josm.tools.I18n.tr;
    55
    66import java.awt.BorderLayout;
     7import java.awt.Dimension;
    78import java.awt.GridBagLayout;
    89import java.awt.event.ActionEvent;
    910import java.awt.event.ActionListener;
     
    6263    /** the history combo box for the upload comment */
    6364    private final HistoryComboBox hcbUploadComment = new HistoryComboBox();
    6465    private final HistoryComboBox hcbUploadSource = new HistoryComboBox();
     66    private final transient JCheckBox obtainSourceAutomatically = new JCheckBox(
     67            tr("Automatically obtain source from current layers"));
    6568    /** the panel with a summary of the upload parameters */
    6669    private final UploadParameterSummaryPanel pnlUploadParameterSummary = new UploadParameterSummaryPanel();
    6770    /** the checkbox to request feedback from other users */
     
    9396                automaticallyAddSource();
    9497            }
    9598        });
    96         JCheckBox obtainSourceAutomatically = new JCheckBox(tr("Automatically obtain source from current layers"));
    9799        obtainSourceAutomatically.setSelected(Config.getPref().getBoolean("upload.source.obtainautomatically", false));
    98100        obtainSourceAutomatically.addActionListener(e -> {
    99101            if (obtainSourceAutomatically.isSelected())
     
    180182        setBorder(BorderFactory.createEmptyBorder(3, 3, 3, 3));
    181183        add(buildUploadCommentPanel(), BorderLayout.NORTH);
    182184        add(pnlUploadParameterSummary, BorderLayout.CENTER);
     185        Dimension dimUploadParameterSummary = pnlUploadParameterSummary.getMinimumSize();
     186        if (dimUploadParameterSummary.getHeight() <= 0) {
     187            dimUploadParameterSummary.height = 80;
     188            pnlUploadParameterSummary.setMinimumSize(dimUploadParameterSummary);
     189        }
    183190        add(cbRequestReview, BorderLayout.SOUTH);
    184191        cbRequestReview.addItemListener(e -> changesetReviewModel.setReviewRequested(e.getStateChange() == ItemEvent.SELECTED));
    185192    }
     
    227234        // store the history of sources
    228235        hcbUploadSource.addCurrentItemToHistory();
    229236        Config.getPref().putList(SOURCE_HISTORY_KEY, hcbUploadSource.getHistory());
     237
     238        // store current value of obtaining source automatically
     239        Config.getPref().putBoolean("upload.source.obtainautomatically", obtainSourceAutomatically.isSelected());
    230240    }
    231241
    232242    /**