Changeset 29635 in osm


Ignore:
Timestamp:
2013-06-07T00:43:13+02:00 (11 years ago)
Author:
donvip
Message:

[josm_osmarenderer] Make plugin work under Windows with latest Java

Location:
applications/editors/josm/plugins/osmarender
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/osmarender/.project

    r21422 r29635  
    11<?xml version="1.0" encoding="UTF-8"?>
    22<projectDescription>
    3         <name>osmarender</name>
     3        <name>JOSM-osmarender</name>
    44        <comment></comment>
    55        <projects>
  • applications/editors/josm/plugins/osmarender/src/org/openstreetmap/josm/plugins/osmarender/OsmarenderPlugin.java

    r29351 r29635  
    4141import org.openstreetmap.josm.plugins.PluginInformation;
    4242import org.openstreetmap.josm.tools.GBC;
     43import org.openstreetmap.josm.tools.PlatformHookWindows;
    4344
    4445public class OsmarenderPlugin extends Plugin {
     
    107108
    108109                // get the exec line
    109                 String exec = firefox;
    110                 if (System.getProperty("os.name").startsWith("Windows"))
    111                     exec += " file:///"+getPluginDir().replace('\\','/').replace(" ","%20")+File.separator+"generated.xml\"";
     110                String argument;
     111                if (Main.platform instanceof PlatformHookWindows)
     112                    argument = "file:///"+getPluginDir().replace('\\','/').replace(" ","%20")+File.separator+"generated.xml\"";
    112113                else
    113                     exec += " "+getPluginDir()+File.separator+"generated.xml";
     114                    argument = getPluginDir()+File.separator+"generated.xml";
    114115
    115116                // launch up the viewer
    116                 Runtime.getRuntime().exec(exec);
     117                Runtime.getRuntime().exec(new String[]{firefox, argument});
    117118            } catch (IOException e1) {
    118119                JOptionPane.showMessageDialog(Main.parent, tr("Firefox not found. Please set firefox executable in the Map Settings page of the preferences."));
Note: See TracChangeset for help on using the changeset viewer.