Changeset 34537 in osm for applications/editors/josm/plugins/osmarender/src/org/openstreetmap
- Timestamp:
- 2018-08-18T19:04:31+02:00 (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/osmarender/src/org/openstreetmap/josm/plugins/osmarender/OsmarenderPlugin.java
r34396 r34537 30 30 import javax.swing.JTextField; 31 31 32 import org.openstreetmap.josm.Main;33 32 import org.openstreetmap.josm.actions.JosmAction; 34 33 import org.openstreetmap.josm.data.Bounds; 34 import org.openstreetmap.josm.data.Preferences; 35 35 import org.openstreetmap.josm.data.coor.LatLon; 36 36 import org.openstreetmap.josm.data.osm.DataSet; … … 51 51 import org.openstreetmap.josm.plugins.Plugin; 52 52 import org.openstreetmap.josm.plugins.PluginInformation; 53 import org.openstreetmap.josm.spi.preferences.Config; 53 54 import org.openstreetmap.josm.tools.GBC; 54 55 import org.openstreetmap.josm.tools.Logging; 55 import org.openstreetmap.josm.tools.Platform HookWindows;56 import org.openstreetmap.josm.tools.PlatformManager; 56 57 import org.openstreetmap.josm.tools.Utils; 57 58 … … 84 85 } 85 86 86 String firefox = Main.pref.get("osmarender.firefox", "firefox");87 String firefox = Config.getPref().get("osmarender.firefox", "firefox"); 87 88 String pluginDir = getPluginDirs().getUserDataDirectory(false).getPath(); 88 89 try (OsmWriter w = OsmWriterFactory.createOsmWriter(new PrintWriter(new OutputStreamWriter( … … 129 130 // get the exec line 130 131 String argument; 131 if ( Main.platform instanceofPlatformHookWindows)132 if (PlatformManager.isPlatformWindows()) 132 133 argument = "file:///"+pluginDir.replace('\\','/').replace(" ","%20")+File.separator+"generated.xml\""; 133 134 else … … 137 138 Runtime.getRuntime().exec(new String[]{firefox, argument}); 138 139 } catch (IOException e1) { 139 JOptionPane.showMessageDialog(Main .parent,140 JOptionPane.showMessageDialog(MainApplication.getMainFrame(), 140 141 tr("Firefox not found. Please set firefox executable in the Map Settings page of the preferences.")); 141 142 } … … 168 169 @Deprecated 169 170 public String _getPluginDir() { 170 return new File( Main.pref.getPluginsDirectory(), getPluginInformation().name).getPath();171 return new File(Preferences.main().getPluginsDirectory(), getPluginInformation().name).getPath(); 171 172 } 172 173 … … 222 223 panel.add(firefox, GBC.eol().insets(0,5,0,0).fill(GBC.HORIZONTAL)); 223 224 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")); 225 226 gui.getMapPreference().getTabPane().addTab(tr("Osmarender"), panel); 226 227 } … … 228 229 @Override 229 230 public boolean ok() { 230 Main.pref.put("osmarender.firefox", firefox.getText());231 Config.getPref().put("osmarender.firefox", firefox.getText()); 231 232 return false; 232 233 }
Note:
See TracChangeset
for help on using the changeset viewer.