Changeset 7041 in josm for trunk/src/org/openstreetmap/josm/gui
- Timestamp:
- 2014-05-02T00:34:56+02:00 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/preferences/map/MapPaintPreference.java
r7005 r7041 214 214 private boolean insertNewDefaults(List<SourceEntry> list) { 215 215 boolean changed = false; 216 217 boolean addedMapcssStyle = false; // Migration code can be removed ~ Nov. 2014 216 218 217 219 Collection<String> knownDefaults = new TreeSet<>(Main.pref.getCollection("mappaint.style.known-defaults")); … … 231 233 insertionIdx++; 232 234 changed = true; 235 /* Migration code can be removed ~ Nov. 2014 */ 236 if (Utils.equal(def.url, "resource://styles/standard/elemstyles.mapcss")) { 237 addedMapcssStyle = true; 238 } 233 239 } else { 234 240 if (i >= insertionIdx) { … … 243 249 Main.pref.putCollection("mappaint.style.known-defaults", knownDefaults); 244 250 251 /* Migration code can be removed ~ Nov. 2014 */ 252 if (addedMapcssStyle) { 253 // change title of the XML entry 254 // only do this once. If the user changes it afterward, do not touch 255 if (!Main.pref.getBoolean("mappaint.style.migration.changedXmlName", false)) { 256 SourceEntry josmXml = Utils.find(list, new Predicate<SourceEntry>() { 257 @Override 258 public boolean evaluate(SourceEntry se) { 259 return Utils.equal(se.url, "resource://styles/standard/elemstyles.xml"); 260 } 261 }); 262 if (josmXml != null) { 263 josmXml.title = tr("JOSM default (XML; old version)"); 264 } 265 Main.pref.put("mappaint.style.migration.changedXmlName", true); 266 } 267 } 268 245 269 return changed; 246 270 } … … 248 272 @Override 249 273 public Collection<ExtendedSourceEntry> getDefault() { 250 ExtendedSourceEntry defJOSM = new ExtendedSourceEntry("elemstyles.xml", "resource://styles/standard/elemstyles.xml"); 251 defJOSM.active = true; 252 defJOSM.name = "standard"; 253 defJOSM.title = tr("JOSM Internal Style"); 254 defJOSM.description = tr("Internal style to be used as base for runtime switchable overlay styles"); 274 ExtendedSourceEntry defJosmXml = new ExtendedSourceEntry("elemstyles.xml", "resource://styles/standard/elemstyles.xml"); 275 defJosmXml.active = true; 276 defJosmXml.name = "standard"; 277 defJosmXml.title = tr("JOSM default (XML; old version)"); 278 defJosmXml.description = tr("Internal style to be used as base for runtime switchable overlay styles"); 279 ExtendedSourceEntry defJosmMapcss = new ExtendedSourceEntry("elemstyles.mapcss", "resource://styles/standard/elemstyles.mapcss"); 280 defJosmMapcss.active = false; 281 defJosmMapcss.name = "standard"; 282 defJosmMapcss.title = tr("JOSM default (MapCSS)"); 283 defJosmMapcss.description = tr("Internal style to be used as base for runtime switchable overlay styles"); 255 284 ExtendedSourceEntry defPL2 = new ExtendedSourceEntry("potlatch2.mapcss", "resource://styles/standard/potlatch2.mapcss"); 256 285 defPL2.active = false; … … 259 288 defPL2.description = tr("the main Potlatch 2 style"); 260 289 261 return Arrays.asList(new ExtendedSourceEntry[] { defJ OSM, defPL2 });290 return Arrays.asList(new ExtendedSourceEntry[] { defJosmXml, defJosmMapcss, defPL2 }); 262 291 } 263 292
Note:
See TracChangeset
for help on using the changeset viewer.