Changeset 5850 in josm
- Timestamp:
- 2013-04-14T00:42:40+02:00 (12 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/Version.java
r5839 r5850 153 153 } 154 154 155 /** 156 * Initializes version info 157 */ 155 158 public void init() { 156 159 URL u = Main.class.getResource("/REVISION"); … … 209 212 } 210 213 214 /** 215 * Returns the User-Agent string 216 * @return The User-Agent 217 */ 211 218 public String getAgentString() { 212 219 int v = getVersion(); … … 218 225 s += " SVN"; 219 226 } 220 return "JOSM/1.5 ("+ s+" "+LanguageInfo.getJOSMLocaleCode()+") " + System.getProperty("os.name");227 return "JOSM/1.5 ("+ s+" "+LanguageInfo.getJOSMLocaleCode()+") " + Main.platform.getOSDescription(); 221 228 } 222 229 } -
trunk/src/org/openstreetmap/josm/tools/PlatformHook.java
r4971 r5850 4 4 import java.io.File; 5 5 import java.io.IOException; 6 import java.util.HashMap;7 6 8 7 /** … … 93 92 94 93 public boolean rename(File from, File to); 94 95 /** 96 * Returns a detailed OS description (at least family + version). 97 * @return A detailed OS description. 98 * @since 5850 99 */ 100 public String getOSDescription(); 95 101 } -
trunk/src/org/openstreetmap/josm/tools/PlatformHookOsx.java
r5450 r5850 250 250 return false; 251 251 } 252 253 /* (non-Javadoc) 254 * @see org.openstreetmap.josm.tools.PlatformHookUnixoid#getOSDescription() 255 */ 256 @Override 257 public String getOSDescription() { 258 return System.getProperty("os.name"); 259 } 252 260 } -
trunk/src/org/openstreetmap/josm/tools/PlatformHookUnixoid.java
r5001 r5850 6 6 import java.awt.GraphicsEnvironment; 7 7 import java.awt.event.KeyEvent; 8 import java.io.BufferedReader; 8 9 import java.io.File; 9 10 import java.io.IOException; 10 import java.util.HashMap; 11 12 import org.openstreetmap.josm.Main; 11 import java.io.InputStreamReader; 13 12 14 13 /** … … 86 85 return from.renameTo(to); 87 86 } 87 88 @Override 89 public String getOSDescription() { 90 String osName = System.getProperty("os.name"); 91 if ("Linux".equalsIgnoreCase(osName)) { 92 try { 93 Process p = Runtime.getRuntime().exec("lsb_release -ds"); 94 BufferedReader input = new BufferedReader(new InputStreamReader(p.getInputStream())); 95 String line = Utils.strip(input.readLine()); 96 input.close(); 97 if (line != null && !line.isEmpty()) { 98 return line; 99 } 100 } catch (IOException e) { 101 e.printStackTrace(); 102 } 103 } 104 return osName; 105 } 88 106 } -
trunk/src/org/openstreetmap/josm/tools/PlatformHookWindows.java
r5355 r5850 12 12 import static java.awt.event.KeyEvent.VK_ENTER; 13 13 import static java.awt.event.KeyEvent.VK_ESCAPE; 14 import static java.awt.event.KeyEvent.VK_F1;15 14 import static java.awt.event.KeyEvent.VK_F10; 16 15 import static java.awt.event.KeyEvent.VK_F4; … … 124 123 return from.renameTo(to); 125 124 } 125 126 /* (non-Javadoc) 127 * @see org.openstreetmap.josm.tools.PlatformHookUnixoid#getOSDescription() 128 */ 129 @Override 130 public String getOSDescription() { 131 return Utils.strip(System.getProperty("os.name")) + " " + 132 ((System.getenv("ProgramFiles(x86)") == null) ? "32" : "64") + "-Bit"; 133 } 126 134 }
Note:
See TracChangeset
for help on using the changeset viewer.