Ignore:
Timestamp:
2020-01-05T16:36:31+01:00 (4 years ago)
Author:
Don-vip
Message:

fix #18514 - make all changeset actions and dialogs only accessible in expert mode

File:
1 edited

Legend:

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

    r15445 r15633  
    4444import javax.swing.plaf.basic.BasicSplitPaneUI;
    4545
     46import org.openstreetmap.josm.actions.ExpertToggleAction;
    4647import org.openstreetmap.josm.actions.mapmode.DeleteAction;
    4748import org.openstreetmap.josm.actions.mapmode.DrawAction;
     
    671672            JPopupMenu menu = new JPopupMenu();
    672673            for (HideableButton b : buttons) {
    673                 final HideableButton t = b;
    674                 menu.add(new JCheckBoxMenuItem(new AbstractAction() {
    675                     {
    676                         putValue(NAME, t.getActionName());
    677                         putValue(SMALL_ICON, t.getIcon());
    678                         putValue(SELECTED_KEY, t.isButtonVisible());
    679                         putValue(SHORT_DESCRIPTION, tr("Hide or show this toggle button"));
    680                     }
    681 
    682                     @Override
    683                     public void actionPerformed(ActionEvent e) {
    684                         if ((Boolean) getValue(SELECTED_KEY)) {
    685                             t.showButton();
    686                         } else {
    687                             t.hideButton();
     674                if (!b.isExpert() || ExpertToggleAction.isExpert()) {
     675                    final HideableButton t = b;
     676                    menu.add(new JCheckBoxMenuItem(new AbstractAction() {
     677                        {
     678                            putValue(NAME, t.getActionName());
     679                            putValue(SMALL_ICON, t.getIcon());
     680                            putValue(SELECTED_KEY, t.isButtonVisible());
     681                            putValue(SHORT_DESCRIPTION, tr("Hide or show this toggle button"));
    688682                        }
    689                         validateToolBarsVisibility();
    690                     }
    691                 }));
     683
     684                        @Override
     685                        public void actionPerformed(ActionEvent e) {
     686                            if ((Boolean) getValue(SELECTED_KEY)) {
     687                                t.showButton();
     688                            } else {
     689                                t.hideButton();
     690                            }
     691                            validateToolBarsVisibility();
     692                        }
     693                    }));
     694                }
    692695            }
    693696            if (button != null && button.isShowing()) {
Note: See TracChangeset for help on using the changeset viewer.