Ignore:
Timestamp:
2018-08-18T19:04:31+02:00 (6 years ago)
Author:
donvip
Message:

update to JOSM 14153

File:
1 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/osmarender/src/org/openstreetmap/josm/plugins/osmarender/OsmarenderPlugin.java

    r34396 r34537  
    3030import javax.swing.JTextField;
    3131
    32 import org.openstreetmap.josm.Main;
    3332import org.openstreetmap.josm.actions.JosmAction;
    3433import org.openstreetmap.josm.data.Bounds;
     34import org.openstreetmap.josm.data.Preferences;
    3535import org.openstreetmap.josm.data.coor.LatLon;
    3636import org.openstreetmap.josm.data.osm.DataSet;
     
    5151import org.openstreetmap.josm.plugins.Plugin;
    5252import org.openstreetmap.josm.plugins.PluginInformation;
     53import org.openstreetmap.josm.spi.preferences.Config;
    5354import org.openstreetmap.josm.tools.GBC;
    5455import org.openstreetmap.josm.tools.Logging;
    55 import org.openstreetmap.josm.tools.PlatformHookWindows;
     56import org.openstreetmap.josm.tools.PlatformManager;
    5657import org.openstreetmap.josm.tools.Utils;
    5758
     
    8485            }
    8586
    86             String firefox = Main.pref.get("osmarender.firefox", "firefox");
     87            String firefox = Config.getPref().get("osmarender.firefox", "firefox");
    8788            String pluginDir = getPluginDirs().getUserDataDirectory(false).getPath();
    8889            try (OsmWriter w = OsmWriterFactory.createOsmWriter(new PrintWriter(new OutputStreamWriter(
     
    129130                // get the exec line
    130131                String argument;
    131                 if (Main.platform instanceof PlatformHookWindows)
     132                if (PlatformManager.isPlatformWindows())
    132133                    argument = "file:///"+pluginDir.replace('\\','/').replace(" ","%20")+File.separator+"generated.xml\"";
    133134                else
     
    137138                Runtime.getRuntime().exec(new String[]{firefox, argument});
    138139            } catch (IOException e1) {
    139                 JOptionPane.showMessageDialog(Main.parent,
     140                JOptionPane.showMessageDialog(MainApplication.getMainFrame(),
    140141                        tr("Firefox not found. Please set firefox executable in the Map Settings page of the preferences."));
    141142            }
     
    168169    @Deprecated
    169170    public String _getPluginDir() {
    170         return new File(Main.pref.getPluginsDirectory(), getPluginInformation().name).getPath();
     171        return new File(Preferences.main().getPluginsDirectory(), getPluginInformation().name).getPath();
    171172    }
    172173
     
    222223            panel.add(firefox, GBC.eol().insets(0,5,0,0).fill(GBC.HORIZONTAL));
    223224            panel.add(Box.createVerticalGlue(), GBC.eol().fill(GBC.BOTH));
    224             firefox.setText(Main.pref.get("osmarender.firefox"));
     225            firefox.setText(Config.getPref().get("osmarender.firefox"));
    225226            gui.getMapPreference().getTabPane().addTab(tr("Osmarender"), panel);
    226227        }
     
    228229        @Override
    229230        public boolean ok() {
    230             Main.pref.put("osmarender.firefox", firefox.getText());
     231            Config.getPref().put("osmarender.firefox", firefox.getText());
    231232            return false;
    232233        }
Note: See TracChangeset for help on using the changeset viewer.