Changeset 1509 in josm for trunk/src/org
- Timestamp:
- 2009-03-20T08:17:45+01:00 (15 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/GpxExportAction.java
r1397 r1509 132 132 gpxData = ((GpxLayer)layer).data; 133 133 else 134 gpxData = OsmDataLayer.toGpxData(Main.ds );134 gpxData = OsmDataLayer.toGpxData(Main.ds, file); 135 135 // TODO: add copyright, etc. 136 136 try { -
trunk/src/org/openstreetmap/josm/gui/GettingStarted.java
r1507 r1509 85 85 } 86 86 } 87 try { 88 vers = wr.read(baseurl + "/version?format=txt"); 89 motd = motd.replace("</html>", getVersionNumber(vers)+"</html>"); 90 } catch (IOException ioe) {} 87 motd = motd.replace("<!-- VERSION -->", tr("- running version is {0}", 88 AboutAction.getVersionString())); 91 89 // Save this to prefs in case JOSM is updated so MOTD can be refreshed 92 90 Main.pref.putInteger("cache.motd.html.version", myVersion); … … 105 103 // everytime because of something we can't read. 106 104 return Main.pref.getInteger("cache.motd.html.version", myVersion) == myVersion; 107 }108 109 /**110 * Tries to read the version number from a given Future<String>111 * @param Future<String> that contains the version page112 * @return String with HTML Code113 */114 private String getVersionNumber(String str) {115 try {116 Matcher m = Pattern.compile(".*josm-tested\\.jar: *(\\d+).*", Pattern.DOTALL).matcher(str);117 m.matches();118 int curVersion = Integer.parseInt(m.group(1));119 m = Pattern.compile(".*josm-latest\\.jar: *(\\d+).*", Pattern.DOTALL).matcher(str);120 m.matches();121 int latest = Integer.parseInt(m.group(1));122 return "<div style=\"text-align:right;font-size:small;font-weight:normal;\">"123 + "<b>"124 + (curVersion > myVersion ? tr("Update available") + " — ": "")125 + tr("Version Details:") + "</b> "126 + tr("Yours: {2}; Current: {0}; <font style=\"font-size:x-small\">"127 + "(latest untested: {1} – not recommended)</font>",128 curVersion, latest, myVersion)129 + "</div>";130 } catch(Exception e) {131 // e.printStackTrace();132 }133 134 return "";135 105 } 136 106 }
Note:
See TracChangeset
for help on using the changeset viewer.