Ignore:
Timestamp:
2014-06-01T14:07:18+02:00 (6 years ago)
Author:
Don-vip
Message:

fix #10086 - fix EDT violation causing freeze of Save/upload dialog for empty or conflicting layers

File:
1 edited

Legend:

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

    r7026 r7204  
    5656    }
    5757
    58     public static boolean doSave(Layer layer, File file) {
    59         if(!layer.checkSaveConditions())
     58    /**
     59     * Saves a layer to a given file.
     60     * @param layer The layer to save
     61     * @param file The destination file
     62     * @param checkSaveConditions if {@code true}, checks preconditions before saving. Set it to {@code false} to skip it
     63     * if preconditions have already been checked (as this check can prompt UI dialog in EDT it may be best in some cases
     64     * to do it earlier).
     65     * @return {@code true} if the layer has been successfully saved, {@code false} otherwise
     66     * @since 7204
     67     */
     68    public static boolean doSave(Layer layer, File file, boolean checkSaveConditions) {
     69        if (checkSaveConditions && !layer.checkSaveConditions())
    6070            return false;
    6171        return doInternalSave(layer, file);
Note: See TracChangeset for help on using the changeset viewer.