Changeset 16695 in josm


Ignore:
Timestamp:
2020-06-21T14:08:21+02:00 (3 weeks ago)
Author:
simon04
Message:

see #19381 - Upload dialog: allow to disable text validation

  • message.upload_comment_is_empty_or_very_short
  • message.upload_source_is_empty
Location:
trunk/src/org/openstreetmap/josm/gui
Files:
2 edited

Legend:

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

    r16673 r16695  
    6565        @Override
    6666        public void validate() {
     67            if (!Config.getPref().getBoolean("message.upload_comment_is_empty_or_very_short", true)) {
     68                feedbackDisabled();
     69                return;
     70            }
    6771            String uploadComment = getComponent().getText();
    6872            if (UploadDialog.UploadAction.isUploadCommentTooShort(uploadComment)) {
     
    97101        @Override
    98102        public void validate() {
     103            if (!Config.getPref().getBoolean("message.upload_source_is_empty", true)) {
     104                feedbackDisabled();
     105                return;
     106            }
    99107            String uploadSource = getComponent().getText();
    100108            if (Utils.isStripEmpty(uploadSource)) {
  • trunk/src/org/openstreetmap/josm/gui/widgets/AbstractTextComponentValidator.java

    r16675 r16695  
    8989        if (hasChanged(msg, Status.VALID)) {
    9090            // only provide feedback if the validity has changed. This avoids unnecessary UI updates.
    91             tc.setBorder(VALID_BORDER);
     91            tc.setBorder(msg == null ? UIManager.getBorder("TextField.border") : VALID_BORDER);
    9292            tc.setBackground(UIManager.getColor("TextField.background"));
    9393            tc.setToolTipText(msg == null ? "" : msg);
Note: See TracChangeset for help on using the changeset viewer.