Changeset 15650 in josm


Ignore:
Timestamp:
2020-01-06T22:35:31+01:00 (3 months ago)
Author:
Don-vip
Message:

fix #18514 - display changeset toggle dialog entry in the window menu only in expert mode

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/dialogs/ChangesetDialog.java

    r14938 r15650  
    252252                null, /* no keyboard shortcut */
    253253                200, /* the preferred height */
    254                 false /* don't show if there is no preference */
     254                false, /* don't show if there is no preference */
     255                null /* no preferences settings */,
     256                true /* expert only */
    255257        );
    256258        build();
  • trunk/src/org/openstreetmap/josm/gui/dialogs/ToggleDialog.java

    r15649 r15650  
    231231    public ToggleDialog(String name, String iconName, String tooltip, Shortcut shortcut, int preferredHeight, boolean defShow,
    232232            Class<? extends PreferenceSetting> prefClass) {
     233        this(name, iconName, tooltip, shortcut, preferredHeight, defShow, prefClass, false);
     234    }
     235
     236    /**
     237     * Constructor
     238     *
     239     * @param name  the name of the dialog
     240     * @param iconName the name of the icon to be displayed
     241     * @param tooltip  the tool tip
     242     * @param shortcut  the shortcut
     243     * @param preferredHeight the preferred height for the dialog
     244     * @param defShow if the dialog should be shown by default, if there is no preference
     245     * @param prefClass the preferences settings class, or null if not applicable
     246     * @param isExpert {@code true} if this dialog should only be displayed in expert mode
     247     * @since 15650
     248     */
     249    public ToggleDialog(String name, String iconName, String tooltip, Shortcut shortcut, int preferredHeight, boolean defShow,
     250            Class<? extends PreferenceSetting> prefClass, boolean isExpert) {
    233251        super(new BorderLayout());
    234252        this.preferencePrefix = iconName;
     
    257275        Config.getPref().addPreferenceChangeListener(this);
    258276
    259         registerInWindowMenu();
     277        registerInWindowMenu(isExpert);
    260278    }
    261279
    262280    /**
    263281     * Registers this dialog in the window menu. Called in the constructor.
    264      * @since 10467
    265      */
    266     protected void registerInWindowMenu() {
     282     * @param isExpert {@code true} if this dialog should only be displayed in expert mode
     283     * @since 15650
     284     */
     285    protected void registerInWindowMenu(boolean isExpert) {
    267286        windowMenuItem = MainMenu.addWithCheckbox(MainApplication.getMenu().windowMenu,
    268287                (JosmAction) getToggleAction(),
    269                 WindowMenu.WINDOW_MENU_GROUP.TOGGLE_DIALOG, false, true);
     288                WindowMenu.WINDOW_MENU_GROUP.TOGGLE_DIALOG, isExpert, true);
    270289    }
    271290
  • trunk/test/unit/org/openstreetmap/josm/gui/dialogs/layer/LayerVisibilityActionTest.java

    r14138 r15650  
    3636        LayerListModel model = new LayerListDialog(MainApplication.getLayerManager()) {
    3737            @Override
    38             protected void registerInWindowMenu() {
     38            protected void registerInWindowMenu(boolean isExpert) {
    3939                // ignore
    4040            }
Note: See TracChangeset for help on using the changeset viewer.