Changeset 6682 in josm for trunk/src/org/openstreetmap/josm/tools/PlatformHookUnixoid.java
- Timestamp:
- 2014-01-13T19:29:33+01:00 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/tools/PlatformHookUnixoid.java
r6443 r6682 4 4 import static org.openstreetmap.josm.tools.I18n.tr; 5 5 6 import java.awt.Desktop; 6 7 import java.awt.Dimension; 7 8 import java.awt.GraphicsEnvironment; … … 12 13 import java.io.IOException; 13 14 import java.io.InputStreamReader; 15 import java.net.URI; 16 import java.net.URISyntaxException; 14 17 import java.util.Arrays; 15 18 … … 41 44 @Override 42 45 public void openUrl(String url) throws IOException { 43 String[] programs = {"gnome-open", "kfmclient openURL", "firefox"};44 for (String program : programs) {46 for (String program : Main.pref.getCollection("browser.unix", 47 Arrays.asList("xdg-open", "#DESKTOP#", "$BROWSER", "gnome-open", "kfmclient openURL", "firefox"))) { 45 48 try { 46 Runtime.getRuntime().exec(program+" "+url); 49 if ("#DESKTOP#".equals(program)) { 50 Desktop.getDesktop().browse(new URI(url)); 51 } else if (program.startsWith("$")) { 52 program = System.getenv().get(program.substring(1)); 53 Runtime.getRuntime().exec(new String[]{program, url}); 54 } else { 55 Runtime.getRuntime().exec(new String[]{program, url}); 56 } 47 57 return; 48 58 } catch (IOException e) { 59 Main.warn(e); 60 } catch (URISyntaxException e) { 49 61 Main.warn(e); 50 62 }
Note:
See TracChangeset
for help on using the changeset viewer.