Changeset 33798 in osm for applications/editors/josm
- Timestamp:
- 2017-11-07T23:50:14+01:00 (7 years ago)
- Location:
- applications/editors/josm/plugins/roadsigns
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/roadsigns/build.xml
r33579 r33798 4 4 <property name="commit.message" value=""/> 5 5 <!-- enter the *lowest* JOSM version this plugin is currently compatible with --> 6 <property name="plugin.main.version" value="1 2678"/>6 <property name="plugin.main.version" value="13007"/> 7 7 8 8 <!-- -
applications/editors/josm/plugins/roadsigns/src/org/openstreetmap/josm/plugins/roadsigns/RoadSignInputDialog.java
r33579 r33798 138 138 Collection<OsmPrimitive> selPrim = MainApplication.getLayerManager().getEditDataSet().getSelected(); 139 139 if (!selPrim.isEmpty()) { 140 Main.pref.put("plugin.roadsigns.addTrafficSignTag", addTrafficSignTag.isSelected()); 140 Main.pref.putBoolean("plugin.roadsigns.addTrafficSignTag", addTrafficSignTag.isSelected()); 141 141 142 142 Command cmd = createCommand(selPrim); -
applications/editors/josm/plugins/roadsigns/src/org/openstreetmap/josm/plugins/roadsigns/RoadSignsPlugin.java
r32673 r33798 26 26 import org.openstreetmap.josm.Main; 27 27 import org.openstreetmap.josm.actions.JosmAction; 28 import org.openstreetmap.josm.data.Preferences.pref; 28 import org.openstreetmap.josm.data.StructUtils; 29 import org.openstreetmap.josm.data.StructUtils.StructEntry; 29 30 import org.openstreetmap.josm.gui.ExtendedDialog; 30 31 import org.openstreetmap.josm.gui.dialogs.properties.PropertiesDialog; … … 63 64 64 65 public static File pluginDir() { 65 File dir = new File(plugin.getPluginDir());66 File dir = plugin.getPluginDirs().getUserDataDirectory(false); 66 67 if (!dir.exists()) { 67 68 dir.mkdirs(); … … 115 116 116 117 public static class PresetMetaData { 117 @ prefpublic String code;118 @ prefpublic String display_name;119 @ prefpublic String preset_path;120 @ prefpublic String icon_path;118 @StructEntry public String code; 119 @StructEntry public String display_name; 120 @StructEntry public String preset_path; 121 @StructEntry public String icon_path; 121 122 122 123 public PresetMetaData() { … … 143 144 public static List<PresetMetaData> getAvailablePresetsMetaData() { 144 145 145 List<PresetMetaData> presetsData = Main.pref.getListOfStructs("plugin.roadsigns.presets", DEFAULT_PRESETS, PresetMetaData.class); 146 List<PresetMetaData> presetsData = StructUtils.getListOfStructs( 147 Main.pref, "plugin.roadsigns.presets", DEFAULT_PRESETS, PresetMetaData.class); 146 148 147 149 String customFile = Main.pref.get("plugin.roadsigns.sources", null); 148 150 if (customFile == null) { 149 151 // for legacy reasons, try both string and collection preference type 150 Collection<String> customFiles = Main.pref.getCollection("plugin.roadsigns.sources", null);152 List<String> customFiles = Main.pref.getList("plugin.roadsigns.sources", null); 151 153 if (customFiles != null && !customFiles.isEmpty()) { 152 154 customFile = customFiles.iterator().next(); … … 164 166 165 167 String customIconDirsStr = Main.pref.get("plugin.roadsigns.icon.sources", null); 166 Collection<String> customIconDirs = null;168 List<String> customIconDirs = null; 167 169 if (customIconDirsStr != null) { 168 170 customIconDirs = new ArrayList<>(Arrays.asList(customIconDirsStr.split(","))); 169 171 } else { 170 customIconDirs = Main.pref.get Collection("plugin.roadsigns.icon.sources", null);172 customIconDirs = Main.pref.getList("plugin.roadsigns.icon.sources", null); 171 173 } 172 174 if (customIconDirs != null) {
Note:
See TracChangeset
for help on using the changeset viewer.