Changeset 12846 in josm for trunk/src/org/openstreetmap/josm/gui/io/BasicUploadSettingsPanel.java
- Timestamp:
- 2017-09-13T23:24:50+02:00 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/io/BasicUploadSettingsPanel.java
r12841 r12846 28 28 import javax.swing.event.HyperlinkEvent; 29 29 30 import org.openstreetmap.josm.Main;31 30 import org.openstreetmap.josm.data.osm.Changeset; 32 31 import org.openstreetmap.josm.gui.MainApplication; 33 32 import org.openstreetmap.josm.gui.widgets.HistoryComboBox; 34 33 import org.openstreetmap.josm.gui.widgets.JMultilineLabel; 34 import org.openstreetmap.josm.spi.preferences.Config; 35 35 import org.openstreetmap.josm.tools.CheckParameterUtil; 36 36 import org.openstreetmap.josm.tools.GBC; … … 78 78 hcbUploadComment.setToolTipText(tr("Enter an upload comment")); 79 79 hcbUploadComment.setMaxTextLength(Changeset.MAX_CHANGESET_TAG_LENGTH); 80 List<String> cmtHistory = new LinkedList<>( Main.pref.getList(HISTORY_KEY, new LinkedList<String>()));80 List<String> cmtHistory = new LinkedList<>(Config.getPref().getList(HISTORY_KEY, new LinkedList<String>())); 81 81 Collections.reverse(cmtHistory); // we have to reverse the history, because ComboBoxHistory will reverse it again in addElement() 82 82 hcbUploadComment.setPossibleItems(cmtHistory); … … 100 100 hcbUploadSource.setToolTipText(tr("Enter a source")); 101 101 hcbUploadSource.setMaxTextLength(Changeset.MAX_CHANGESET_TAG_LENGTH); 102 List<String> sourceHistory = new LinkedList<>( Main.pref.getList(SOURCE_HISTORY_KEY, getDefaultSources()));102 List<String> sourceHistory = new LinkedList<>(Config.getPref().getList(SOURCE_HISTORY_KEY, getDefaultSources())); 103 103 Collections.reverse(sourceHistory); // we have to reverse the history, because ComboBoxHistory will reverse it again in addElement() 104 104 hcbUploadSource.setPossibleItems(sourceHistory); … … 166 166 // store the history of comments 167 167 hcbUploadComment.addCurrentItemToHistory(); 168 Main.pref.putList(HISTORY_KEY, hcbUploadComment.getHistory());169 Main.pref.putInt(HISTORY_LAST_USED_KEY, (int) (TimeUnit.MILLISECONDS.toSeconds(System.currentTimeMillis())));168 Config.getPref().putList(HISTORY_KEY, hcbUploadComment.getHistory()); 169 Config.getPref().putInt(HISTORY_LAST_USED_KEY, (int) (TimeUnit.MILLISECONDS.toSeconds(System.currentTimeMillis()))); 170 170 // store the history of sources 171 171 hcbUploadSource.addCurrentItemToHistory(); 172 Main.pref.putList(SOURCE_HISTORY_KEY, hcbUploadSource.getHistory());172 Config.getPref().putList(SOURCE_HISTORY_KEY, hcbUploadSource.getHistory()); 173 173 } 174 174
Note:
See TracChangeset
for help on using the changeset viewer.