- Timestamp:
- 2020-11-10T18:06:57+01:00 (4 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/PreferencesAction.java
r17265 r17307 7 7 import java.awt.event.ActionEvent; 8 8 import java.awt.event.KeyEvent; 9 10 import javax.swing.SwingUtilities; 9 11 10 12 import org.openstreetmap.josm.gui.MainApplication; … … 106 108 public void run() { 107 109 final PreferenceDialog p = new PreferenceDialog(MainApplication.getMainFrame()); 108 if (tab != null) { 109 p.selectPreferencesTabByClass(tab); 110 } else if (subTab != null) { 111 p.selectSubPreferencesTabByClass(subTab); 112 } else { 113 p.selectPreviouslySelectedPreferences(); 114 } 110 SwingUtilities.invokeLater(() -> { 111 if (tab != null) { 112 p.selectPreferencesTabByClass(tab); 113 } else if (subTab != null) { 114 p.selectSubPreferencesTabByClass(subTab); 115 } else { 116 p.selectPreviouslySelectedPreferences(); 117 } 118 }); 115 119 p.setVisible(true); 116 120 } -
trunk/src/org/openstreetmap/josm/gui/dialogs/ToggleDialog.java
r16913 r17307 582 582 pref.addActionListener(e -> { 583 583 final PreferenceDialog p = new PreferenceDialog(MainApplication.getMainFrame()); 584 if (TabPreferenceSetting.class.isAssignableFrom(preferenceClass)) { 585 p.selectPreferencesTabByClass((Class<? extends TabPreferenceSetting>) preferenceClass); 586 } else if (SubPreferenceSetting.class.isAssignableFrom(preferenceClass)) { 587 p.selectSubPreferencesTabByClass((Class<? extends SubPreferenceSetting>) preferenceClass); 588 } 584 SwingUtilities.invokeLater(() -> { 585 if (TabPreferenceSetting.class.isAssignableFrom(preferenceClass)) { 586 p.selectPreferencesTabByClass((Class<? extends TabPreferenceSetting>) preferenceClass); 587 } else if (SubPreferenceSetting.class.isAssignableFrom(preferenceClass)) { 588 p.selectSubPreferencesTabByClass((Class<? extends SubPreferenceSetting>) preferenceClass); 589 } 590 }); 589 591 p.setVisible(true); 590 592 }); -
trunk/src/org/openstreetmap/josm/gui/preferences/PreferenceTabbedPane.java
r17306 r17307 528 528 private void addGUITabs(boolean clear) { 529 529 boolean expert = ExpertToggleAction.isExpert(); 530 Component sel = getSelectedComponent();531 530 if (clear) { 532 531 removeAll(); … … 561 560 }); 562 561 } 562 setSelectedIndex(-1); 563 } 564 565 @Override 566 public void expertChanged(boolean isExpert) { 567 Component sel = getSelectedComponent(); 568 addGUITabs(true); 563 569 int index = -1; 564 570 if (sel != null) { 565 571 index = indexOfComponent(sel); 566 572 } 567 setSelectedIndex(index); 568 } 569 570 @Override 571 public void expertChanged(boolean isExpert) { 572 addGUITabs(true); 573 setSelectedIndex(Math.max(index, 0)); 573 574 } 574 575 -
trunk/src/org/openstreetmap/josm/gui/preferences/ToolbarPreferences.java
r17227 r17307 52 52 import javax.swing.ListSelectionModel; 53 53 import javax.swing.MenuElement; 54 import javax.swing.SwingUtilities; 54 55 import javax.swing.TransferHandler; 55 56 import javax.swing.event.PopupMenuEvent; … … 513 514 public void actionPerformed(ActionEvent e) { 514 515 final PreferenceDialog p = new PreferenceDialog(MainApplication.getMainFrame()); 515 p.selectPreferencesTabByName("toolbar");516 SwingUtilities.invokeLater(() -> p.selectPreferencesTabByName("toolbar")); 516 517 p.setVisible(true); 517 518 } … … 523 524 final PreferenceDialog p = new PreferenceDialog(MainApplication.getMainFrame()); 524 525 p.getTabbedPane().getShortcutPreference().setDefaultFilter(act.getDisplayName()); 525 p.selectPreferencesTabByName("shortcuts");526 SwingUtilities.invokeLater(() -> p.selectPreferencesTabByName("shortcuts")); 526 527 p.setVisible(true); 527 528 // refresh toolbar to try using changed shortcuts without restart
Note:
See TracChangeset
for help on using the changeset viewer.