﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
14864	[PATCH] Add a new preference to remember changeset tags, and include them by default in all changesets	rorym	team	"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.

{{{
#!diff
Index: src/org/openstreetmap/josm/gui/io/UploadDialog.java
===================================================================
--- src/org/openstreetmap/josm/gui/io/UploadDialog.java	(revision 12285)
+++ src/org/openstreetmap/josm/gui/io/UploadDialog.java	(working copy)
@@ -16,6 +16,7 @@
 import java.beans.PropertyChangeEvent;
 import java.beans.PropertyChangeListener;
 import java.lang.Character.UnicodeBlock;
+import java.util.Arrays;
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Collections;
@@ -269,6 +270,7 @@
     /**
      * Sets the tags for this upload based on (later items overwrite earlier ones):
      * <ul>
+     * <li>From the upload.changeset.tags.additional prefence</li>
      * <li>previous ""source"" and ""comment"" input</li>
      * <li>the tags set in the dataset (see {@link DataSet#getChangeSetTags()})</li>
      * <li>the tags from the selected open changeset</li>
@@ -280,6 +282,13 @@
     public void setChangesetTags(DataSet dataSet) {
         final Map<String, String> tags = new HashMap<>();
 
+        // From preferences
+        // TODO is there a better way to read this, as a Map, rather than List/Collection?
+        Collection<String> tags_from_prefs = Main.pref.getCollection(""upload.changeset.tags.additional"", Arrays.asList(new String[] {}));
+        for (Iterator<String> iterator = tags_from_prefs.iterator(); iterator.hasNext();) {
+            tags.put(iterator.next(), iterator.next());
+        }
+
         // obtain from previous input
         tags.put(""source"", getLastChangesetSourceFromHistory());
         tags.put(""comment"", getLastChangesetCommentFromHistory());
}}}"	enhancement	closed	normal		Core	latest	wontfix	tags, changeset, upload	
