#14864 closed enhancement (wontfix)
[PATCH] Add a new preference to remember changeset tags, and include them by default in all changesets
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());
Attachments (0)
Change History (6)
comment:1 by , 7 years ago
Description: | modified (diff) |
---|
comment:2 by , 7 years ago
Resolution: | → wontfix |
---|---|
Status: | new → closed |
follow-up: 4 comment:3 by , 7 years ago
Rats! :(
This change was partially motivated by the fact that JOSM doesn't remember changeset tags between changesets. So if you want to add an extra tags you need to do it manually. I would be happy with JOSM remembering the previously entered changeset tags and automatically using them.
The reason I want to do it is to put things in the clacks.
follow-up: 5 comment:4 by , 7 years ago
Replying to rorym:
Rats! :(
This change was partially motivated by the fact that JOSM doesn't remember changeset tags between changesets. So if you want to add an extra tags you need to do it manually. I would be happy with JOSM remembering the previously entered changeset tags and automatically using them.
I also see no reason to integrate this. But you can make a plugin for this purpose ;-)
The reason I want to do it is to put things in the clacks.
Well, JOSM website does not forget to handle the overhead properly. You are not alone.
comment:5 by , 7 years ago
The reason I want to do it is to put things in the clacks.
Well, JOSM website does not forget to handle the overhead properly. You are not alone.
BTW: There are people out there, which simply install all available plugins, even a possible pterry.jar :-)
Rorym, thanks for the patch! I'm not in favor of applying the patch, because it is essential a new feature that is only accessible by Einstein settings. It means we have to maintain non-trivial code that is known to and used by a very small group of people (possibly just you).
Most typical use of advanced preferences is to make a hard-coded value configurable, but your patch does a bit more than that.