Changeset 13769 in josm
- Timestamp:
- 2018-05-15T02:42:22+02:00 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/Preferences.java
r13647 r13769 7 7 import static org.openstreetmap.josm.tools.Utils.getSystemProperty; 8 8 9 import java.awt.GraphicsEnvironment; 9 10 import java.io.File; 10 11 import java.io.IOException; … … 552 553 Logging.warn(tr("Failed to initialize preferences. Preference directory ''{0}'' is not a directory.", 553 554 prefDir.getAbsoluteFile())); 554 JOptionPane.showMessageDialog( 555 Main.parent, 556 tr("<html>Failed to initialize preferences.<br>Preference directory ''{0}'' is not a directory.</html>", 557 prefDir.getAbsoluteFile()), 558 tr("Error"), 559 JOptionPane.ERROR_MESSAGE 560 ); 555 if (!GraphicsEnvironment.isHeadless()) { 556 JOptionPane.showMessageDialog( 557 Main.parent, 558 tr("<html>Failed to initialize preferences.<br>Preference directory ''{0}'' is not a directory.</html>", 559 prefDir.getAbsoluteFile()), 560 tr("Error"), 561 JOptionPane.ERROR_MESSAGE 562 ); 563 } 561 564 return; 562 565 } … … 565 568 Logging.warn(tr("Failed to initialize preferences. Failed to create missing preference directory: {0}", 566 569 prefDir.getAbsoluteFile())); 567 JOptionPane.showMessageDialog( 568 Main.parent, 569 tr("<html>Failed to initialize preferences.<br>Failed to create missing preference directory: {0}</html>", 570 prefDir.getAbsoluteFile()), 571 tr("Error"), 572 JOptionPane.ERROR_MESSAGE 573 ); 570 if (!GraphicsEnvironment.isHeadless()) { 571 JOptionPane.showMessageDialog( 572 Main.parent, 573 tr("<html>Failed to initialize preferences.<br>Failed to create missing preference directory: {0}</html>", 574 prefDir.getAbsoluteFile()), 575 tr("Error"), 576 JOptionPane.ERROR_MESSAGE 577 ); 578 } 574 579 return; 575 580 } … … 591 596 } catch (IOException e) { 592 597 Logging.error(e); 593 JOptionPane.showMessageDialog( 594 Main.parent, 595 tr("<html>Failed to initialize preferences.<br>Failed to reset preference file to default: {0}</html>", 596 getPreferenceFile().getAbsoluteFile()), 597 tr("Error"), 598 JOptionPane.ERROR_MESSAGE 599 ); 598 if (!GraphicsEnvironment.isHeadless()) { 599 JOptionPane.showMessageDialog( 600 Main.parent, 601 tr("<html>Failed to initialize preferences.<br>Failed to reset preference file to default: {0}</html>", 602 getPreferenceFile().getAbsoluteFile()), 603 tr("Error"), 604 JOptionPane.ERROR_MESSAGE 605 ); 606 } 600 607 return; 601 608 } … … 606 613 Logging.error(e); 607 614 File backupFile = new File(prefDir, "preferences.xml.bak"); 608 JOptionPane.showMessageDialog( 609 Main.parent, 610 tr("<html>Preferences file had errors.<br> Making backup of old one to <br>{0}<br> " + 611 "and creating a new default preference file.</html>", 612 backupFile.getAbsoluteFile()), 613 tr("Error"), 614 JOptionPane.ERROR_MESSAGE 615 ); 615 if (!GraphicsEnvironment.isHeadless()) { 616 JOptionPane.showMessageDialog( 617 Main.parent, 618 tr("<html>Preferences file had errors.<br> Making backup of old one to <br>{0}<br> " + 619 "and creating a new default preference file.</html>", 620 backupFile.getAbsoluteFile()), 621 tr("Error"), 622 JOptionPane.ERROR_MESSAGE 623 ); 624 } 616 625 Main.platform.rename(preferenceFile, backupFile); 617 626 try {
Note:
See TracChangeset
for help on using the changeset viewer.