Ticket #7548: 7548-no-empty.patch

File 7548-no-empty.patch, 2.4 KB (added by GerdP, 5 years ago)

@Klumbumbus Please try this patch. It solves the problem on both my PC and the laptop

  • src/org/openstreetmap/josm/actions/PreferencesAction.java

     
    77import java.awt.event.ActionEvent;
    88import java.awt.event.KeyEvent;
    99
    10 import javax.swing.SwingUtilities;
    11 
    1210import org.openstreetmap.josm.gui.MainApplication;
    1311import org.openstreetmap.josm.gui.preferences.PreferenceDialog;
    1412import org.openstreetmap.josm.gui.preferences.SubPreferenceSetting;
     
    107105    @Override
    108106    public void run() {
    109107        final PreferenceDialog p = new PreferenceDialog(MainApplication.getMainFrame());
    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         });
     108        if (tab != null) {
     109            p.selectPreferencesTabByClass(tab);
     110        } else if (subTab != null) {
     111            p.selectSubPreferencesTabByClass(subTab);
     112        } else {
     113            p.selectPreviouslySelectedPreferences();
     114        }
    119115        p.setVisible(true);
    120116    }
    121117}
  • src/org/openstreetmap/josm/gui/preferences/PreferenceDialog.java

     
    153153            tpPreferences.selectSubTabByPref(previouslySelected.b);
    154154        } else if (previouslySelected != null && previouslySelected.a != null) {
    155155            tpPreferences.selectTabByPref(previouslySelected.a);
     156        } else {
     157            tpPreferences.setSelectedIndex(0);
    156158        }
    157159    }
    158160
  • src/org/openstreetmap/josm/gui/preferences/PreferenceTabbedPane.java

     
    558558                setSelectedIndex(index);
    559559            }
    560560        }
     561        setSelectedIndex(-1);
    561562    }
    562563
    563564    @Override