Changeset 4874 in josm for trunk/src/org/openstreetmap/josm/gui/preferences/MapPaintPreference.java
- Timestamp:
- 2012-01-26T21:52:34+01:00 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/preferences/MapPaintPreference.java
r4839 r4874 32 32 33 33 public static final boolean registerSourceProvider(SourceProvider provider) { 34 if (provider != null) {34 if (provider != null) 35 35 return styleSourceProviders.add(provider); 36 }37 36 return false; 38 37 } 39 38 40 39 public static class Factory implements PreferenceSettingFactory { 41 40 public PreferenceSetting createPreferenceSetting() { … … 69 68 } 70 69 } 71 );72 } 73 74 class MapPaintSourceEditor extends SourceEditor {70 ); 71 } 72 73 static class MapPaintSourceEditor extends SourceEditor { 75 74 76 75 final private String iconpref = "mappaint.icon.sources"; … … 118 117 public String getStr(I18nString ident) { 119 118 switch (ident) { 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 119 case AVAILABLE_SOURCES: 120 return tr("Available styles:"); 121 case ACTIVE_SOURCES: 122 return tr("Active styles:"); 123 case NEW_SOURCE_ENTRY_TOOLTIP: 124 return tr("Add a new style by entering filename or URL"); 125 case NEW_SOURCE_ENTRY: 126 return tr("New style entry:"); 127 case REMOVE_SOURCE_TOOLTIP: 128 return tr("Remove the selected styles from the list of active styles"); 129 case EDIT_SOURCE_TOOLTIP: 130 return tr("Edit the filename or URL for the selected active style"); 131 case ACTIVATE_TOOLTIP: 132 return tr("Add the selected available styles to the list of active styles"); 133 case RELOAD_ALL_AVAILABLE: 134 return marktr("Reloads the list of available styles from ''{0}''"); 135 case LOADING_SOURCES_FROM: 136 return marktr("Loading style sources from ''{0}''"); 137 case FAILED_TO_LOAD_SOURCES_FROM: 138 return marktr("<html>Failed to load the list of style sources from<br>" 139 + "''{0}''.<br>" 140 + "<br>" 141 + "Details (untranslated):<br>{1}</html>"); 142 case FAILED_TO_LOAD_SOURCES_FROM_HELP_TOPIC: 143 return "/Preferences/Styles#FailedToLoadStyleSources"; 144 case ILLEGAL_FORMAT_OF_ENTRY: 145 return marktr("Warning: illegal format of entry in style list ''{0}''. Got ''{1}''"); 146 default: throw new AssertionError(); 148 147 } 149 148 } … … 177 176 public MapPaintPrefMigration() { 178 177 super("mappaint.style.sources", 179 "mappaint.style.enable-defaults",180 "mappaint.style.sources-list");178 "mappaint.style.enable-defaults", 179 "mappaint.style.sources-list"); 181 180 } 182 181 … … 215 214 private boolean insertNewDefaults(List<SourceEntry> list) { 216 215 boolean changed = false; 217 216 218 217 Collection<String> knownDefaults = new TreeSet<String>(Main.pref.getCollection("mappaint.style.known-defaults")); 219 218 … … 223 222 int i = Utils.indexOf(list, 224 223 new Predicate<SourceEntry>() { 225 226 227 228 229 224 @Override 225 public boolean evaluate(SourceEntry se) { 226 return Utils.equal(def.url, se.url); 227 } 228 }); 230 229 if (i == -1 && !knownDefaults.contains(def.url)) { 231 230 list.add(insertionIdx, def); … … 268 267 entry.url, 269 268 entry.name == null ? "" : entry.name, 270 entry.title == null ? "" : entry.title,271 Boolean.toString(entry.active)269 entry.title == null ? "" : entry.title, 270 Boolean.toString(entry.active) 272 271 }); 273 272 }
Note:
See TracChangeset
for help on using the changeset viewer.