Changeset 5661 in josm
- Timestamp:
- 2013-01-04T00:49:01+01:00 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/MainMenu.java
r5460 r5661 100 100 import org.openstreetmap.josm.actions.audio.AudioSlowerAction; 101 101 import org.openstreetmap.josm.actions.search.SearchAction; 102 import org.openstreetmap.josm.data.Preferences.PreferenceChangeEvent; 103 import org.openstreetmap.josm.data.Preferences.PreferenceChangedListener; 102 104 import org.openstreetmap.josm.gui.io.RecentlyOpenedFilesMenu; 103 105 import org.openstreetmap.josm.gui.layer.Layer; … … 557 559 changesetManagerToggleAction.addButtonModel(mi.getModel()); 558 560 559 560 561 if (!Main.pref.getBoolean("audio.menuinvisible", false)) { 562 showAudioMenu(true); 563 } 564 565 Main.pref.addPreferenceChangeListener(new PreferenceChangedListener() { 566 @Override 567 public void preferenceChanged(PreferenceChangeEvent e) { 568 if (e.getKey().equals("audio.menuinvisible")) { 569 showAudioMenu(!Boolean.parseBoolean(e.getNewValue().toString())); 570 } 571 } 572 }); 573 574 helpMenu.add(statusreport); 575 576 current = helpMenu.add(help); // FIXME why is help not a JosmAction? 577 current.setAccelerator(Shortcut.registerShortcut("system:help", tr("Help"), KeyEvent.VK_F1, 578 Shortcut.DIRECT).getKeyStroke()); 579 add(helpMenu, about); 580 581 582 windowMenu.addMenuListener(menuSeparatorHandler); 583 584 new PresetsMenuEnabler(presetsMenu).refreshEnabled(); 585 } 586 587 protected void showAudioMenu(boolean showMenu) { 588 if (showMenu && audioMenu == null) { 561 589 audioMenu = addMenu(marktr("Audio"), KeyEvent.VK_U, defaultMenuPos, ht("/Menu/Audio")); 562 590 add(audioMenu, audioPlayPause); … … 567 595 add(audioMenu, audioSlower); 568 596 add(audioMenu, audioFaster); 569 } 570 571 helpMenu.add(statusreport); 572 573 current = helpMenu.add(help); // FIXME why is help not a JosmAction? 574 current.setAccelerator(Shortcut.registerShortcut("system:help", tr("Help"), KeyEvent.VK_F1, 575 Shortcut.DIRECT).getKeyStroke()); 576 add(helpMenu, about); 577 578 579 windowMenu.addMenuListener(menuSeparatorHandler); 580 581 new PresetsMenuEnabler(presetsMenu).refreshEnabled(); 597 validate(); 598 } else if (!showMenu && audioMenu != null) { 599 remove(audioMenu); 600 audioMenu.removeAll(); 601 audioMenu = null; 602 validate(); 603 } 582 604 } 583 605
Note:
See TracChangeset
for help on using the changeset viewer.