Ignore:
Timestamp:
2009-07-25T10:35:53+02:00 (15 years ago)
Author:
jttt
Message:

Enable validate action only when there is edit layer available

Location:
applications/editors/josm/plugins/validator/src/org/openstreetmap/josm/plugins/validator
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/validator/src/org/openstreetmap/josm/plugins/validator/OSMValidatorPlugin.java

    r13497 r16681  
    7272    /** The list of errors per layer*/
    7373    Map<Layer, List<TestError>> layerErrors = new HashMap<Layer, List<TestError>>();
    74    
     74
    7575    /** Grid detail, multiplier of east,north values for valuable cell sizing */
    7676    public static double griddetail;
     
    122122        }
    123123    }
    124    
     124
    125125    private void loadIgnoredErrors() {
    126126        ignoredErrors.clear();
     
    250250    /**
    251251     * Initialize grid details based on current projection system. Values based on
    252      * the original value fixed for EPSG:4326 (10000) using heuristics (that is, test&error 
     252     * the original value fixed for EPSG:4326 (10000) using heuristics (that is, test&error
    253253     * until most bugs were discovered while keeping the processing time reasonable)
    254254     */
     
    261261            OSMValidatorPlugin.griddetail = 0.1;
    262262    }
    263    
     263
    264264    /**
    265265     * Initializes all tests
  • applications/editors/josm/plugins/validator/src/org/openstreetmap/josm/plugins/validator/ValidateAction.java

    r16629 r16681  
    111111        DataSet.fireSelectionChanged(Main.main.getCurrentDataSet().getSelected());
    112112    }
     113
     114    @Override
     115    public void updateEnabledState() {
     116        setEnabled(getEditLayer() != null);
     117    }
    113118}
  • applications/editors/josm/plugins/validator/src/org/openstreetmap/josm/plugins/validator/ValidatorDialog.java

    r16629 r16681  
    9898        selectButton.setEnabled(false);
    9999        buttonPanel.add(selectButton);
    100         buttonPanel.add(new SideButton(marktr("Validate"), "refresh", "Validator",
    101                 tr("Validate either current selection or complete dataset."), this));
     100        buttonPanel.add(new SideButton(plugin.validateAction), "refresh");
    102101        fixButton = new SideButton(marktr("Fix"), "fix", "Validator", tr("Fix the selected errors."), this);
    103102        fixButton.setEnabled(false);
     
    302301        if (actionCommand.equals("Select"))
    303302            setSelectedItems();
    304         else if (actionCommand.equals("Validate"))
    305             plugin.validateAction.actionPerformed(e);
    306303        else if (actionCommand.equals("Fix"))
    307304            fixErrors(e);
Note: See TracChangeset for help on using the changeset viewer.