Changeset 10696 in josm
- Timestamp:
- 2016-08-01T21:17:23+02:00 (8 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/ShowStatusReportAction.java
r10463 r10696 19 19 import java.util.Map.Entry; 20 20 import java.util.Set; 21 import java.util. TreeSet;21 import java.util.stream.Collectors; 22 22 23 23 import org.openstreetmap.josm.Main; … … 28 28 import org.openstreetmap.josm.gui.ExtendedDialog; 29 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 30 import org.openstreetmap.josm.gui.preferences.map.MapPaintPreference; 33 31 import org.openstreetmap.josm.gui.preferences.map.TaggingPresetPreference; … … 37 35 import org.openstreetmap.josm.tools.PlatformHookUnixoid; 38 36 import org.openstreetmap.josm.tools.Shortcut; 37 import org.openstreetmap.josm.tools.Utils; 39 38 import org.openstreetmap.josm.tools.bugreport.BugReportSender; 40 39 import org.openstreetmap.josm.tools.bugreport.DebugTextDisplay; … … 153 152 } 154 153 } 155 text.append( '\n').append(PluginHandler.getBugReportText()).append('\n');156 154 text.append("\n"); 155 appendCollection(text, "Plugins", Utils.transform(PluginHandler.getBugReportInformation(), i -> "+ " + i)); 157 156 appendCollection(text, "Tagging presets", getCustomUrls(TaggingPresetPreference.PresetPrefHelper.INSTANCE)); 158 157 appendCollection(text, "Map paint styles", getCustomUrls(MapPaintPreference.MapPaintPrefHelper.INSTANCE)); 159 158 appendCollection(text, "Validator rules", getCustomUrls(ValidatorTagCheckerRulesPreference.RulePrefHelper.INSTANCE)); 160 appendCollection(text, "Last errors/warnings", Main.getLastErrorAndWarnings());159 appendCollection(text, "Last errors/warnings", Utils.transform(Main.getLastErrorAndWarnings(), i -> "- " + i)); 161 160 162 161 String osmApi = OsmApi.getOsmApi().getServerUrl(); … … 169 168 170 169 private static Collection<String> getCustomUrls(SourceEditor.SourcePrefHelper helper) { 171 Set<String> set = new TreeSet<>(); 172 for (SourceEntry entry : helper.get()) { 173 set.add(entry.url); 174 } 175 for (ExtendedSourceEntry def : helper.getDefault()) { 176 set.remove(def.url); 177 } 178 return set; 170 final Set<String> defaultUrls = helper.getDefault().stream() 171 .map(i -> i.url) 172 .collect(Collectors.toSet()); 173 return helper.get().stream() 174 .filter(i -> !defaultUrls.contains(i.url)) 175 .map(i -> (i.active ? "+ " : "- ") + i.url) 176 .collect(Collectors.toList()); 179 177 } 180 178 … … 224 222 } 225 223 226 private static <T> void appendCollection(StringBuilder text, String label, Collection<T> col) {224 private static void appendCollection(StringBuilder text, String label, Collection<String> col) { 227 225 if (!col.isEmpty()) { 228 text.append(label +":\n");229 for ( To : col) {230 text.append( "- ").append(paramCleanup(o.toString())).append('\n');226 text.append(label).append(":\n"); 227 for (String o : col) { 228 text.append(paramCleanup(o)).append('\n'); 231 229 } 232 230 text.append('\n'); -
trunk/src/org/openstreetmap/josm/plugins/PluginHandler.java
r10647 r10696 1377 1377 /** 1378 1378 * Returns the list of loaded plugins as a {@code String} to be displayed in status report. Useful for bug reports. 1379 * @return The list of loaded plugins (one plugin per line) 1380 */ 1381 public static String getBugReportText() { 1382 StringBuilder text = new StringBuilder(); 1383 List<String> pl = new LinkedList<>(Main.pref.getCollection("plugins", new LinkedList<String>())); 1379 * @return The list of loaded plugins 1380 */ 1381 public static Collection<String> getBugReportInformation() { 1382 final Collection<String> pl = new TreeSet<>(Main.pref.getCollection("plugins", new LinkedList<>())); 1384 1383 for (final PluginProxy pp : pluginList) { 1385 1384 PluginInformation pi = pp.getPluginInformation(); … … 1388 1387 ? pi.localversion : "unknown") + ')'); 1389 1388 } 1390 Collections.sort(pl); 1391 if (!pl.isEmpty()) { 1392 text.append("Plugins:\n"); 1393 } 1394 for (String s : pl) { 1395 text.append("- ").append(s).append('\n'); 1396 } 1397 return text.toString(); 1389 return pl; 1398 1390 } 1399 1391
Note:
See TracChangeset
for help on using the changeset viewer.