Changeset 12841 in josm for trunk/src/org/openstreetmap/josm/gui/io
- Timestamp:
- 2017-09-13T16:30:27+02:00 (7 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/gui/io
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/io/BasicUploadSettingsPanel.java
r12719 r12841 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.get Collection(HISTORY_KEY, new LinkedList<String>()));80 List<String> cmtHistory = new LinkedList<>(Main.pref.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.get Collection(SOURCE_HISTORY_KEY, getDefaultSources()));102 List<String> sourceHistory = new LinkedList<>(Main.pref.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.put Collection(HISTORY_KEY, hcbUploadComment.getHistory());169 Main.pref.putInt eger(HISTORY_LAST_USED_KEY, (int) (TimeUnit.MILLISECONDS.toSeconds(System.currentTimeMillis())));168 Main.pref.putList(HISTORY_KEY, hcbUploadComment.getHistory()); 169 Main.pref.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.put Collection(SOURCE_HISTORY_KEY, hcbUploadSource.getHistory());172 Main.pref.putList(SOURCE_HISTORY_KEY, hcbUploadSource.getHistory()); 173 173 } 174 174 -
trunk/src/org/openstreetmap/josm/gui/io/ChangesetManagementPanel.java
r12634 r12841 256 256 case ItemEvent.SELECTED: 257 257 firePropertyChange(CLOSE_CHANGESET_AFTER_UPLOAD, false, true); 258 Main.pref.put ("upload.changeset.close", true);258 Main.pref.putBoolean("upload.changeset.close", true); 259 259 break; 260 260 case ItemEvent.DESELECTED: 261 261 firePropertyChange(CLOSE_CHANGESET_AFTER_UPLOAD, true, false); 262 Main.pref.put ("upload.changeset.close", false);262 Main.pref.putBoolean("upload.changeset.close", false); 263 263 break; 264 264 default: // Do nothing -
trunk/src/org/openstreetmap/josm/gui/io/CustomConfigurator.java
r12826 r12841 400 400 MainApplication.worker.submit(pluginDownloadTask); 401 401 } 402 Collection<String> pls = new ArrayList<>(Main.pref.getCollection("plugins"));402 List<String> pls = new ArrayList<>(Main.pref.getList("plugins")); 403 403 for (PluginInformation pi2: toInstallPlugins) { 404 404 if (!pls.contains(pi2.name)) { … … 413 413 new File(Main.pref.getPluginsDirectory(), pi4.name+".jar").deleteOnExit(); 414 414 } 415 Main.pref.put Collection("plugins", pls);415 Main.pref.putList("plugins", pls); 416 416 }); 417 417 } -
trunk/src/org/openstreetmap/josm/gui/io/RecentlyOpenedFilesMenu.java
r12634 r12841 58 58 private void rebuild() { 59 59 removeAll(); 60 Collection<String> fileHistory = Main.pref.get Collection("file-open.history");60 Collection<String> fileHistory = Main.pref.getList("file-open.history"); 61 61 62 62 for (final String file : fileHistory) { … … 101 101 @Override 102 102 public void actionPerformed(ActionEvent e) { 103 Main.pref.put Collection("file-open.history", null);103 Main.pref.putList("file-open.history", null); 104 104 } 105 105 } -
trunk/src/org/openstreetmap/josm/gui/io/UploadDialog.java
r12799 r12841 653 653 654 654 private static String getLastChangesetTagFromHistory(String historyKey, List<String> def) { 655 Collection<String> history = Main.pref.get Collection(historyKey, def);656 int age = (int) (System.currentTimeMillis() / 1000 - Main.pref.getInt eger(BasicUploadSettingsPanel.HISTORY_LAST_USED_KEY, 0));655 Collection<String> history = Main.pref.getList(historyKey, def); 656 int age = (int) (System.currentTimeMillis() / 1000 - Main.pref.getInt(BasicUploadSettingsPanel.HISTORY_LAST_USED_KEY, 0)); 657 657 if (history != null && age < Main.pref.getLong(BasicUploadSettingsPanel.HISTORY_MAX_AGE_KEY, TimeUnit.HOURS.toMillis(4)) 658 658 && !history.isEmpty()) { -
trunk/src/org/openstreetmap/josm/gui/io/UploadStrategySelectionPanel.java
r12687 r12841 323 323 UploadStrategy strategy = UploadStrategy.getFromPreferences(); 324 324 rbStrategy.get(strategy).setSelected(true); 325 int chunkSize = Main.pref.getInt eger("osm-server.upload-strategy.chunk-size", 1);325 int chunkSize = Main.pref.getInt("osm-server.upload-strategy.chunk-size", 1); 326 326 tfChunkSize.setText(Integer.toString(chunkSize)); 327 327 updateNumRequestsLabels(); … … 337 337 try { 338 338 chunkSize = Integer.parseInt(tfChunkSize.getText().trim()); 339 Main.pref.putInt eger("osm-server.upload-strategy.chunk-size", chunkSize);339 Main.pref.putInt("osm-server.upload-strategy.chunk-size", chunkSize); 340 340 } catch (NumberFormatException e) { 341 341 // don't save invalid value to preferences -
trunk/src/org/openstreetmap/josm/gui/io/importexport/GpxExporter.java
r12671 r12841 162 162 setCanceled(false); 163 163 164 Main.pref.put ("lastAddAuthor", author.isSelected());164 Main.pref.putBoolean("lastAddAuthor", author.isSelected()); 165 165 if (!authorName.getText().isEmpty()) { 166 166 Main.pref.put("lastAuthorName", authorName.getText());
Note:
See TracChangeset
for help on using the changeset viewer.