Ignore:
Timestamp:
2020-11-10T18:06:57+01:00 (3 years ago)
Author:
GerdP
Message:

see #7548: Re-organize the preference dialog

  • move code for expert toggle into expertChanged() and make sure that a tab is selected
  • always use SwingUtilities.invokeLater() when the PreferenceDialog should be opened with a special tab
File:
1 edited

Legend:

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

    r17265 r17307  
    77import java.awt.event.ActionEvent;
    88import java.awt.event.KeyEvent;
     9
     10import javax.swing.SwingUtilities;
    911
    1012import org.openstreetmap.josm.gui.MainApplication;
     
    106108    public void run() {
    107109        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        });
    115119        p.setVisible(true);
    116120    }
Note: See TracChangeset for help on using the changeset viewer.