Changeset 8177 in josm
- Timestamp:
- 2015-04-09T19:53:45+02:00 (10 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/gui/io
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/io/BasicUploadSettingsPanel.java
r7995 r8177 83 83 hcbUploadSource.setToolTipText(tr("Enter a source")); 84 84 hcbUploadSource.setMaxTextLength(Changeset.MAX_CHANGESET_TAG_LENGTH); 85 List<String> sourceHistory = new LinkedList<>(Main.pref.getCollection(SOURCE_HISTORY_KEY, 86 Arrays.asList("knowledge", "survey", "Bing"))); 85 List<String> sourceHistory = new LinkedList<>(Main.pref.getCollection(SOURCE_HISTORY_KEY, getDefaultSources())); 87 86 Collections.reverse(sourceHistory); // we have to reverse the history, because ComboBoxHistory will reverse it again in addElement() 88 87 hcbUploadSource.setPossibleItems(sourceHistory); … … 92 91 pnl.add(hcbUploadSource, GBC.eol().fill(GBC.HORIZONTAL)); 93 92 return pnl; 93 } 94 95 static public List<String> getDefaultSources() { 96 return Arrays.asList("knowledge", "survey", "Bing"); 94 97 } 95 98 -
trunk/src/org/openstreetmap/josm/gui/io/UploadDialog.java
r8126 r8177 570 570 } 571 571 572 private String getLastChangesetTagFromHistory(String historyKey) { 573 Collection<String> history = Main.pref.getCollection(historyKey, new ArrayList<String>());572 private String getLastChangesetTagFromHistory(String historyKey, List<String> def) { 573 Collection<String> history = Main.pref.getCollection(historyKey, def); 574 574 int age = (int) (System.currentTimeMillis() / 1000 - Main.pref.getInteger(BasicUploadSettingsPanel.HISTORY_LAST_USED_KEY, 0)); 575 575 if (age < Main.pref.getInteger(BasicUploadSettingsPanel.HISTORY_MAX_AGE_KEY, 4 * 3600 * 1000) && history != null && !history.isEmpty()) { … … 581 581 582 582 public String getLastChangesetCommentFromHistory() { 583 return getLastChangesetTagFromHistory(BasicUploadSettingsPanel.HISTORY_KEY); 583 return getLastChangesetTagFromHistory(BasicUploadSettingsPanel.HISTORY_KEY, new ArrayList<String>()); 584 584 } 585 585 586 586 public String getLastChangesetSourceFromHistory() { 587 return getLastChangesetTagFromHistory(BasicUploadSettingsPanel.SOURCE_HISTORY_KEY); 587 return getLastChangesetTagFromHistory(BasicUploadSettingsPanel.SOURCE_HISTORY_KEY, BasicUploadSettingsPanel.getDefaultSources()); 588 588 } 589 589 }
Note:
See TracChangeset
for help on using the changeset viewer.