Changeset 16241 in josm for trunk/src/org/openstreetmap
- Timestamp:
- 2020-04-06T07:59:36+02:00 (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/Preferences.java
r15606 r16241 608 608 } 609 609 } 610 File possiblyGoodBackupFile = new File(prefDir, "preferences.xml_backup"); 610 611 try { 611 612 load(); … … 618 619 MainApplication.getMainFrame(), 619 620 tr("<html>Preferences file had errors.<br> Making backup of old one to <br>{0}<br> " + 620 "and creating a new default preference file.</html>",621 backupFile.getAbsoluteFile() ),621 "and trying to read last good preference file <br>{1}<br>.</html>", 622 backupFile.getAbsoluteFile(), possiblyGoodBackupFile.getAbsoluteFile()), 622 623 tr("Error"), 623 624 JOptionPane.ERROR_MESSAGE … … 625 626 } 626 627 PlatformManager.getPlatform().rename(preferenceFile, backupFile); 628 } 629 if (!initSuccessful) { 627 630 try { 631 if (possiblyGoodBackupFile.exists() && possiblyGoodBackupFile.length() > 0) { 632 Utils.copyFile(possiblyGoodBackupFile, preferenceFile); 633 } 634 635 load(); 636 initSuccessful = true; 637 } catch (IOException | SAXException | XMLStreamException e) { 638 Logging.error(e); 639 Logging.warn(tr("Failed to initialize preferences. Failed to reset preference file to default: {0}", getPreferenceFile())); 640 } 641 } 642 if (!initSuccessful) { 643 try { 644 if (!GraphicsEnvironment.isHeadless()) { 645 JOptionPane.showMessageDialog( 646 MainApplication.getMainFrame(), 647 tr("<html>Preferences file had errors.<br> Creating a new default preference file.</html>"), 648 tr("Error"), 649 JOptionPane.ERROR_MESSAGE 650 ); 651 } 628 652 resetToDefault(); 629 653 save();
Note:
See TracChangeset
for help on using the changeset viewer.