Changeset 5061 in josm for trunk/src/org/openstreetmap/josm/gui/GettingStarted.java
- Timestamp:
- 2012-03-08T22:03:42+01:00 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/GettingStarted.java
r4865 r5061 9 9 import java.awt.event.InputEvent; 10 10 import java.awt.event.KeyEvent; 11 import java.io.IOException; 11 12 import java.io.UnsupportedEncodingException; 12 13 import java.net.URL; … … 57 58 * Grabs current MOTD from cache or webpage and parses it. 58 59 */ 59 private static class MotdContent extends CacheCustomContent< RuntimeException> {60 private static class MotdContent extends CacheCustomContent<IOException> { 60 61 public MotdContent() { 61 62 super("motd.html", CacheCustomContent.INTERVAL_DAILY); … … 70 71 */ 71 72 @Override 72 protected byte[] updateData() {73 protected byte[] updateData() throws IOException { 73 74 String motd = new WikiReader().readLang("StartupPage"); 74 if (motd.length() == 0) {75 motd = "<html>" + STYLE + "<h1>" + "JOSM - " + tr("Java OpenStreetMap Editor")76 + "</h1>\n<h2 align=\"center\">(" + tr("Message of the day not available") + ")</h2></html>";77 }78 75 // Save this to prefs in case JOSM is updated so MOTD can be refreshed 79 76 Main.pref.putInteger("cache.motd.html.version", myVersion); … … 118 115 // Asynchronously get MOTD to speed-up JOSM startup 119 116 Thread t = new Thread(new Runnable() { 117 @Override 120 118 public void run() { 121 if (content.length() == 0 && Main.pref.getBoolean("help.displaymotd", true)) { 122 content = new MotdContent().updateIfRequiredString(); 119 if (content.isEmpty() && Main.pref.getBoolean("help.displaymotd", true)) { 120 try { 121 content = new MotdContent().updateIfRequiredString(); 122 } catch (IOException ex) { 123 System.out.println(tr("Warning: failed to read MOTD. Exception was: {1}", ex.toString())); 124 content = "<html>" + STYLE + "<h1>" + "JOSM - " + tr("Java OpenStreetMap Editor") 125 + "</h1>\n<h2 align=\"center\">(" + tr("Message of the day not available") + ")</h2></html>"; 126 } 123 127 } 124 128 125 129 EventQueue.invokeLater(new Runnable() { 130 @Override 126 131 public void run() { 127 132 lg.setText(fixImageLinks(content));
Note:
See TracChangeset
for help on using the changeset viewer.