Changeset 19000 in josm


Ignore:
Timestamp:
2024-02-29T07:48:30+01:00 (2 months ago)
Author:
GerdP
Message:

fix #23519: Don't automatically enlarge "Validation Results" panel

  • implement new preference validator.force.unfurl.window with default value true, if set to false the window is not unfurled
  • code cleanup to remove duplicate or obsolete code
Location:
trunk/src/org/openstreetmap/josm
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/actions/upload/ValidateUploadHook.java

    r18960 r19000  
    2222import org.openstreetmap.josm.gui.MainApplication;
    2323import org.openstreetmap.josm.gui.dialogs.validator.ValidatorTreePanel;
    24 import org.openstreetmap.josm.gui.layer.ValidatorLayer;
    2524import org.openstreetmap.josm.gui.util.GuiHelper;
    2625import org.openstreetmap.josm.gui.widgets.HtmlPanel;
     
    106105        GuiHelper.destroyComponents(ed, false);
    107106        ed.dispose();
    108         if (rc != 1) {
    109             OsmValidator.initializeTests();
    110             OsmValidator.initializeErrorLayer();
    111             MainApplication.getMap().validatorDialog.unfurlDialog();
    112             MainApplication.getLayerManager().getLayersOfType(ValidatorLayer.class).forEach(ValidatorLayer::invalidate);
    113             return false;
    114         }
    115         return true;
     107        return rc == 1;
    116108    }
    117109}
  • trunk/src/org/openstreetmap/josm/data/preferences/sources/ValidatorPrefHelper.java

    r18960 r19000  
    7272
    7373    /**
     74     * See #23519
     75     * The preferences key for the automatic unfurl of the validation result window
     76     *
     77     */
     78    public static final BooleanProperty PREF_UNFURL = new BooleanProperty(PREFIX + ".force.unfurl.window", true);
     79
     80    /**
    7481     * Constructs a new {@code PresetPrefHelper}.
    7582     */
  • trunk/src/org/openstreetmap/josm/data/validation/ValidationTask.java

    r18964 r19000  
    2424import org.openstreetmap.josm.gui.Notification;
    2525import org.openstreetmap.josm.gui.PleaseWaitRunnable;
    26 import org.openstreetmap.josm.gui.layer.ValidatorLayer;
     26import org.openstreetmap.josm.gui.dialogs.ValidatorDialog;
    2727import org.openstreetmap.josm.gui.progress.ProgressMonitor;
    2828import org.openstreetmap.josm.gui.progress.swing.PleaseWaitProgressMonitor;
     
    143143                if (!map.validatorDialog.isShowing() && errors.isEmpty() && beforeUpload)
    144144                    return;
    145                 map.validatorDialog.unfurlDialog();
     145                if (Boolean.TRUE.equals(ValidatorPrefHelper.PREF_UNFURL.get()))
     146                    map.validatorDialog.unfurlDialog();
    146147                map.validatorDialog.tree.setErrors(errors);
    147148                //FIXME: nicer way to find / invalidate the corresponding error layer
    148                 MainApplication.getLayerManager().getLayersOfType(ValidatorLayer.class).forEach(ValidatorLayer::invalidate);
     149                ValidatorDialog.invalidateValidatorLayers();
    149150                if (!errors.isEmpty()) {
    150151                    OsmValidator.initializeErrorLayer();
  • trunk/src/org/openstreetmap/josm/gui/dialogs/ValidatorDialog.java

    r18952 r19000  
    702702    }
    703703
    704     private static void invalidateValidatorLayers() {
     704    /**
     705     * Invalidate the error layer
     706     */
     707    public static void invalidateValidatorLayers() {
    705708        MainApplication.getLayerManager().getLayersOfType(ValidatorLayer.class).forEach(ValidatorLayer::invalidate);
    706709    }
Note: See TracChangeset for help on using the changeset viewer.