Changeset 16285 in josm for trunk/src/org


Ignore:
Timestamp:
2020-04-13T09:38:34+02:00 (5 years ago)
Author:
simon04
Message:

fix #19021 - MainMenu: disable menus without edit layer: mode, tools, more tools, selection, not presets

Location:
trunk/src/org/openstreetmap/josm
Files:
2 edited

Legend:

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

    r16138 r16285  
    3030    @Override
    3131    public void actionPerformed(ActionEvent e) {
     32        if (hasActiveDataLayer()) {
     33            TaggingPresetSearchDialog.getInstance().showDialog();
     34        }
     35    }
    3236
    33         if (MainApplication.getLayerManager().getActiveData() == null)
    34             return;
     37    @Override
     38    protected void updateEnabledState() {
     39        setEnabled(hasActiveDataLayer());
     40    }
    3541
    36         TaggingPresetSearchDialog.getInstance().showDialog();
     42    private boolean hasActiveDataLayer() {
     43        return getLayerManager().getActiveData() != null;
    3744    }
    3845}
  • trunk/src/org/openstreetmap/josm/gui/MainMenu.java

    r16105 r16285  
    899899        windowMenu.addMenuListener(menuSeparatorHandler);
    900900
    901         new EditLayerMenuEnabler(Arrays.asList(modeMenu, presetsMenu));
     901        new EditLayerMenuEnabler(Arrays.asList(modeMenu, toolsMenu, moreToolsMenu, selectionMenu));
    902902    }
    903903    // CHECKSTYLE.ON: ExecutableStatementCountCheck
Note: See TracChangeset for help on using the changeset viewer.