Opened 9 years ago
Last modified 8 years ago
#14864 closed enhancement
[PATCH] Add a new preference to remember changeset tags, and include them by default in all changesets — at Version 1
| Reported by: | rorym | Owned by: | team |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | Core | Version: | latest |
| Keywords: | tags, changeset, upload | Cc: |
Description (last modified by )
I suggest adding a new preference upload.changeset.tags.additional, a list of Strings, which will be the additional tags that will be added to every changeset by default. This patch enables this feature. It applies clearly on r12285 (current HEAD), and I have tested it when submitting changesets to OSM.org.
There are suggested changeset tags, and this patch makes it easy to "remember" a set of changeset tags by putting them in your preferences. Otherwise you have to enter the changeset tags all the time.
I hope this is merged, but am open to discussion.
-
src/org/openstreetmap/josm/gui/io/UploadDialog.java
16 16 import java.beans.PropertyChangeEvent; 17 17 import java.beans.PropertyChangeListener; 18 18 import java.lang.Character.UnicodeBlock; 19 import java.util.Arrays; 19 20 import java.util.ArrayList; 20 21 import java.util.Collection; 21 22 import java.util.Collections; … … 269 270 /** 270 271 * Sets the tags for this upload based on (later items overwrite earlier ones): 271 272 * <ul> 273 * <li>From the upload.changeset.tags.additional prefence</li> 272 274 * <li>previous "source" and "comment" input</li> 273 275 * <li>the tags set in the dataset (see {@link DataSet#getChangeSetTags()})</li> 274 276 * <li>the tags from the selected open changeset</li> … … 280 282 public void setChangesetTags(DataSet dataSet) { 281 283 final Map<String, String> tags = new HashMap<>(); 282 284 285 // From preferences 286 // TODO is there a better way to read this, as a Map, rather than List/Collection? 287 Collection<String> tags_from_prefs = Main.pref.getCollection("upload.changeset.tags.additional", Arrays.asList(new String[] {})); 288 for (Iterator<String> iterator = tags_from_prefs.iterator(); iterator.hasNext();) { 289 tags.put(iterator.next(), iterator.next()); 290 } 291 283 292 // obtain from previous input 284 293 tags.put("source", getLastChangesetSourceFromHistory()); 285 294 tags.put("comment", getLastChangesetCommentFromHistory());


