Changeset 17097 in josm


Ignore:
Timestamp:
2020-10-07T19:49:00+02:00 (8 weeks ago)
Author:
GerdP
Message:

fix #19876: Preference dialog only shows Advanced Preferences
Use SwingUtilities.invokeLater() so that dialog is completely build before last tab or wanted tab is restored

Location:
trunk/src/org/openstreetmap/josm
Files:
2 edited

Legend:

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

    r16966 r17097  
    77import java.awt.event.ActionEvent;
    88import java.awt.event.KeyEvent;
     9
     10import javax.swing.SwingUtilities;
    911
    1012import org.openstreetmap.josm.gui.MainApplication;
     
    105107    public void run() {
    106108        final PreferenceDialog p = new PreferenceDialog(MainApplication.getMainFrame());
    107         if (tab != null) {
    108             p.selectPreferencesTabByClass(tab);
    109         } else if (subTab != null) {
    110             p.selectSubPreferencesTabByClass(subTab);
    111         } else {
    112             p.selectPreviouslySelectedPreferences();
    113         }
     109        SwingUtilities.invokeLater(() -> {
     110            if (tab != null) {
     111                p.selectPreferencesTabByClass(tab);
     112            } else if (subTab != null) {
     113                p.selectSubPreferencesTabByClass(subTab);
     114            } else {
     115                p.selectPreviouslySelectedPreferences();
     116            }
     117        });
    114118        p.setVisible(true);
    115119    }
  • trunk/src/org/openstreetmap/josm/gui/preferences/PreferenceDialog.java

    r16966 r17097  
    230230        previouslySelected = tpPreferences.getSelectedTab();
    231231        removeWindowListener(windowEventHandler);
     232        setVisible(false); // save current geometry
    232233        super.dispose();
    233234    }
Note: See TracChangeset for help on using the changeset viewer.