Changeset 1023 in josm for trunk/src/org/openstreetmap/josm/tools
- Timestamp:
- 2008-10-05T17:06:27+02:00 (16 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/tools
- Files:
-
- 5 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/tools/OpenBrowser.java
r627 r1023 12 12 /** 13 13 * Helper to open platform web browser on different platforms 14 * 15 * This now delegates the real work to a platform specific class. 16 * 14 17 * @author Imi 15 18 */ … … 30 33 } 31 34 32 String os = System.getProperty("os.name");33 if (os == null)34 return "unknown operating system";35 35 try { 36 if (os != null && os.startsWith("Windows")) 37 windows(url); 38 else if (os.equals("Linux") || os.equals("Solaris") || os.equals("SunOS") || os.equals("AIX") || os.equals("FreeBSD")) 39 linux(url); 40 else if (os.equals("Mac OS") || os.equals("Mac OS X")) 41 mac(url); 42 else 43 return "unknown operating system"; 36 Main.platform.openUrl(url); 44 37 } catch (IOException e) { 45 38 return e.getMessage(); … … 48 41 } 49 42 50 private static void windows(String url) throws IOException {51 Runtime.getRuntime().exec("rundll32 url.dll,FileProtocolHandler " + url);52 }53 54 private static void linux(String url) {55 String[] programs = {"gnome-open", "kfmclient openURL", "firefox"};56 for (String program : programs) {57 try {58 Runtime.getRuntime().exec(program+" "+url);59 return;60 } catch (IOException e) {61 }62 }63 }64 65 private static void mac(String url) throws IOException {66 Runtime.getRuntime().exec("open " + url);67 }68 43 } -
trunk/src/org/openstreetmap/josm/tools/ShortCutLabel.java
r627 r1023 6 6 import java.awt.event.KeyEvent; 7 7 8 8 @Deprecated 9 9 public class ShortCutLabel { 10 @Deprecated 10 11 public static String name(int shortCut, int modifiers) { 11 12 if (shortCut == 0 && modifiers == 0)
Note:
See TracChangeset
for help on using the changeset viewer.