- Timestamp:
- 2024-03-07T20:05:10+01:00 (9 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/MainApplication.java
r18999 r19012 55 55 import javax.swing.InputMap; 56 56 import javax.swing.JComponent; 57 import javax.swing.JDialog; 57 58 import javax.swing.JLabel; 58 59 import javax.swing.JOptionPane; … … 184 185 */ 185 186 private static volatile List<String> commandLineArgs; 187 /** 188 * The preference key for the startup failure counter 189 */ 190 private static final String PREF_STARTUP_FAILURE_COUNTER = "josm.startup.failure.count"; 186 191 187 192 /** … … 878 883 checkIPv6(); 879 884 885 // After IPv6 check since that may restart JOSM, must be after Preferences.main().init() 886 final int failures = prefs.getInt(PREF_STARTUP_FAILURE_COUNTER, 0); 887 // Always increment failures 888 prefs.putInt(PREF_STARTUP_FAILURE_COUNTER, failures + 1); 889 if (failures > 3) { 890 final int selection = JOptionPane.showOptionDialog(new JDialog(), 891 tr("JOSM has failed to start up {0} times. Reset JOSM?", failures), 892 tr("Reset JOSM?"), 893 JOptionPane.YES_NO_OPTION, 894 JOptionPane.ERROR_MESSAGE, 895 null, 896 null, 897 null); 898 if (selection == JOptionPane.YES_OPTION) { 899 Preferences.main().init(true); 900 } 901 } 902 880 903 processOffline(args); 881 904 … … 1010 1033 } 1011 1034 mainFrame.setVisible(true); 1035 Config.getPref().put(PREF_STARTUP_FAILURE_COUNTER, null); 1012 1036 }); 1013 1037
Note:
See TracChangeset
for help on using the changeset viewer.