- Timestamp:
- 2016-03-28T01:22:28+02:00 (9 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/ShowStatusReportAction.java
r10058 r10063 19 19 import java.util.Map.Entry; 20 20 import java.util.Set; 21 import java.util.TreeSet; 21 22 22 23 import org.openstreetmap.josm.Main; … … 26 27 import org.openstreetmap.josm.data.preferences.Setting; 27 28 import org.openstreetmap.josm.gui.ExtendedDialog; 29 import org.openstreetmap.josm.gui.preferences.SourceEditor; 30 import org.openstreetmap.josm.gui.preferences.SourceEditor.ExtendedSourceEntry; 31 import org.openstreetmap.josm.gui.preferences.SourceEntry; 32 import org.openstreetmap.josm.gui.preferences.map.MapPaintPreference; 33 import org.openstreetmap.josm.gui.preferences.map.TaggingPresetPreference; 34 import org.openstreetmap.josm.gui.preferences.validator.ValidatorTagCheckerRulesPreference; 28 35 import org.openstreetmap.josm.plugins.PluginHandler; 29 36 import org.openstreetmap.josm.tools.PlatformHookUnixoid; … … 158 165 text.append('\n').append(PluginHandler.getBugReportText()).append('\n'); 159 166 160 Collection<String> errorsWarnings = Main.getLastErrorAndWarnings(); 161 if (!errorsWarnings.isEmpty()) { 162 text.append("Last errors/warnings:\n"); 163 for (String s : errorsWarnings) { 164 text.append("- ").append(s).append('\n'); 167 appendCollection(text, "Tagging presets", getCustomUrls(TaggingPresetPreference.PresetPrefHelper.INSTANCE)); 168 appendCollection(text, "Map paint styles", getCustomUrls(MapPaintPreference.MapPaintPrefHelper.INSTANCE)); 169 appendCollection(text, "Validator rules", getCustomUrls(ValidatorTagCheckerRulesPreference.RulePrefHelper.INSTANCE)); 170 appendCollection(text, "Last errors/warnings", Main.getLastErrorAndWarnings()); 171 172 return text.toString(); 173 } 174 175 protected static Collection<String> getCustomUrls(SourceEditor.SourcePrefHelper helper) { 176 Set<String> set = new TreeSet<>(); 177 for (SourceEntry entry : helper.get()) { 178 set.add(entry.url); 179 } 180 for (ExtendedSourceEntry def : helper.getDefault()) { 181 set.remove(def.url); 182 } 183 return set; 184 } 185 186 protected static <T> void appendCollection(StringBuilder text, String label, Collection<T> col) { 187 if (!col.isEmpty()) { 188 text.append(label+":\n"); 189 for (T o : col) { 190 text.append("- ").append(o.toString()).append('\n'); 165 191 } 166 192 text.append('\n'); 167 193 } 168 169 return text.toString();170 194 } 171 195 -
trunk/src/org/openstreetmap/josm/data/Preferences.java
r9978 r10063 1460 1460 } 1461 1461 // drop in November 2016 1462 if (loadedVersion < 9965) { 1463 Setting<?> setting = settingsMap.get("mappaint.style.entries"); 1462 removeUrlFromEntries(loadedVersion, 9965, 1463 "mappaint.style.entries", 1464 "josm.openstreetmap.de/josmfile?page=Styles/LegacyStandard"); 1465 // drop in December 2016 1466 removeUrlFromEntries(loadedVersion, 10063, 1467 "validator.org.openstreetmap.josm.data.validation.tests.MapCSSTagChecker.entries", 1468 "resource://data/validator/power.mapcss"); 1469 1470 for (String key : OBSOLETE_PREF_KEYS) { 1471 if (settingsMap.containsKey(key)) { 1472 settingsMap.remove(key); 1473 Main.info(tr("Preference setting {0} has been removed since it is no longer used.", key)); 1474 } 1475 } 1476 } 1477 1478 private void removeUrlFromEntries(int loadedVersion, int versionMax, String key, String urlPart) { 1479 if (loadedVersion < versionMax) { 1480 Setting<?> setting = settingsMap.get(key); 1464 1481 if (setting instanceof MapListSetting) { 1465 1482 List<Map<String, String>> l = new LinkedList<>(); … … 1467 1484 for (Map<String, String> map: ((MapListSetting) setting).getValue()) { 1468 1485 String url = map.get("url"); 1469 if (url != null && url.contains( "josm.openstreetmap.de/josmfile?page=Styles/LegacyStandard")) {1486 if (url != null && url.contains(urlPart)) { 1470 1487 modified = true; 1471 1488 } else { … … 1474 1491 } 1475 1492 if (modified) { 1476 putListOfStructs( "mappaint.style.entries", l);1493 putListOfStructs(key, l); 1477 1494 } 1478 }1479 }1480 1481 for (String key : OBSOLETE_PREF_KEYS) {1482 if (settingsMap.containsKey(key)) {1483 settingsMap.remove(key);1484 Main.info(tr("Preference setting {0} has been removed since it is no longer used.", key));1485 1495 } 1486 1496 }
Note:
See TracChangeset
for help on using the changeset viewer.