Changeset 6631 in josm for trunk/src/org
- Timestamp:
- 2014-01-05T13:22:24+01:00 (11 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/UploadAction.java
r6590 r6631 236 236 tags.put("source", Main.map.mapView.getLayerInformationForSourceTag()); 237 237 } 238 if (!tags.containsKey("comment")) { 239 tags.put("comment", dialog.getLastChangesetCommentFromHistory()); 240 } 238 241 dialog.setDefaultChangesetTags(tags); 239 242 } -
trunk/src/org/openstreetmap/josm/gui/io/BasicUploadSettingsPanel.java
r6587 r6631 142 142 */ 143 143 public void startUserInput() { 144 List<String> history = hcbUploadComment.getHistory();145 int age = (int) (System.currentTimeMillis()/1000 - Main.pref.getInteger(HISTORY_LAST_USED_KEY, 0));146 // only pre-select latest entry if used less than 4 hours ago.147 if (age < Main.pref.getInteger(HISTORY_MAX_AGE_KEY, 4 * 3600 * 1000) && history != null && !history.isEmpty()) {148 hcbUploadComment.setText(history.get(0));149 }150 144 hcbUploadComment.requestFocusInWindow(); 151 145 hcbUploadComment.getEditor().getEditorComponent().requestFocusInWindow(); -
trunk/src/org/openstreetmap/josm/gui/io/UploadDialog.java
r6594 r6631 589 589 setTitle(tr("Upload to ''{0}''", url)); 590 590 } 591 592 public String getLastChangesetCommentFromHistory() { 593 Collection<String> history = Main.pref.getCollection(BasicUploadSettingsPanel.HISTORY_KEY, new ArrayList<String>()); 594 int age = (int) (System.currentTimeMillis() / 1000 - Main.pref.getInteger(BasicUploadSettingsPanel.HISTORY_LAST_USED_KEY, 0)); 595 if (age < Main.pref.getInteger(BasicUploadSettingsPanel.HISTORY_MAX_AGE_KEY, 4 * 3600 * 1000) && history != null && !history.isEmpty()) { 596 return history.iterator().next(); 597 } else { 598 return null; 599 } 600 } 591 601 }
Note:
See TracChangeset
for help on using the changeset viewer.