Ignore:
Timestamp:
2020-10-19T00:54:46+02:00 (4 years ago)
Author:
Don-vip
Message:

see #17634 - enforce upload policy again (broken after #19381 changes)

File:
1 edited

Legend:

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

    r16697 r17238  
    2222abstract class UploadTextComponentValidator extends AbstractTextComponentValidator {
    2323    private final JLabel feedback;
     24    protected boolean uploadRejected;
    2425
    2526    UploadTextComponentValidator(JTextComponent tc, JLabel feedback) {
     
    6061
    6162    /**
     63     * Determines if the input validator considers the violation bad enough to reject upload.
     64     * @return {@code true} if the input validator considers the violation bad enough to reject upload
     65     * @since 17238
     66     */
     67    public final boolean isUploadRejected() {
     68        return uploadRejected;
     69    }
     70
     71    /**
    6272     * Validator for the changeset {@code comment} tag
    6373     */
     
    8595                String rejection = UploadDialog.UploadAction.validateUploadTag(uploadComment, "upload.comment",
    8696                        Collections.emptyList(), Collections.emptyList(), Collections.emptyList());
    87                 if (rejection != null) {
     97                uploadRejected = rejection != null;
     98                if (uploadRejected) {
    8899                    feedbackWarning(tr("Your upload comment is <i>rejected</i>.") + "<br />" + rejection);
    89100                } else {
     
    120131                final String rejection = UploadDialog.UploadAction.validateUploadTag(
    121132                        uploadSource, "upload.source", Collections.emptyList(), Collections.emptyList(), Collections.emptyList());
    122                 if (rejection != null) {
     133                uploadRejected = rejection != null;
     134                if (uploadRejected) {
    123135                    feedbackWarning(tr("Your changeset source is <i>rejected</i>.") + "<br />" + rejection);
    124136                } else {
Note: See TracChangeset for help on using the changeset viewer.