Ignore:
Timestamp:
2017-09-13T16:30:27+02:00 (7 years ago)
Author:
bastiK
Message:

see #15229 - fix deprecations caused by [12840]

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  
    7878        hcbUploadComment.setToolTipText(tr("Enter an upload comment"));
    7979        hcbUploadComment.setMaxTextLength(Changeset.MAX_CHANGESET_TAG_LENGTH);
    80         List<String> cmtHistory = new LinkedList<>(Main.pref.getCollection(HISTORY_KEY, new LinkedList<String>()));
     80        List<String> cmtHistory = new LinkedList<>(Main.pref.getList(HISTORY_KEY, new LinkedList<String>()));
    8181        Collections.reverse(cmtHistory); // we have to reverse the history, because ComboBoxHistory will reverse it again in addElement()
    8282        hcbUploadComment.setPossibleItems(cmtHistory);
     
    100100        hcbUploadSource.setToolTipText(tr("Enter a source"));
    101101        hcbUploadSource.setMaxTextLength(Changeset.MAX_CHANGESET_TAG_LENGTH);
    102         List<String> sourceHistory = new LinkedList<>(Main.pref.getCollection(SOURCE_HISTORY_KEY, getDefaultSources()));
     102        List<String> sourceHistory = new LinkedList<>(Main.pref.getList(SOURCE_HISTORY_KEY, getDefaultSources()));
    103103        Collections.reverse(sourceHistory); // we have to reverse the history, because ComboBoxHistory will reverse it again in addElement()
    104104        hcbUploadSource.setPossibleItems(sourceHistory);
     
    166166        // store the history of comments
    167167        hcbUploadComment.addCurrentItemToHistory();
    168         Main.pref.putCollection(HISTORY_KEY, hcbUploadComment.getHistory());
    169         Main.pref.putInteger(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())));
    170170        // store the history of sources
    171171        hcbUploadSource.addCurrentItemToHistory();
    172         Main.pref.putCollection(SOURCE_HISTORY_KEY, hcbUploadSource.getHistory());
     172        Main.pref.putList(SOURCE_HISTORY_KEY, hcbUploadSource.getHistory());
    173173    }
    174174
  • trunk/src/org/openstreetmap/josm/gui/io/ChangesetManagementPanel.java

    r12634 r12841  
    256256            case ItemEvent.SELECTED:
    257257                firePropertyChange(CLOSE_CHANGESET_AFTER_UPLOAD, false, true);
    258                 Main.pref.put("upload.changeset.close", true);
     258                Main.pref.putBoolean("upload.changeset.close", true);
    259259                break;
    260260            case ItemEvent.DESELECTED:
    261261                firePropertyChange(CLOSE_CHANGESET_AFTER_UPLOAD, true, false);
    262                 Main.pref.put("upload.changeset.close", false);
     262                Main.pref.putBoolean("upload.changeset.close", false);
    263263                break;
    264264            default: // Do nothing
  • trunk/src/org/openstreetmap/josm/gui/io/CustomConfigurator.java

    r12826 r12841  
    400400                        MainApplication.worker.submit(pluginDownloadTask);
    401401                    }
    402                     Collection<String> pls = new ArrayList<>(Main.pref.getCollection("plugins"));
     402                    List<String> pls = new ArrayList<>(Main.pref.getList("plugins"));
    403403                    for (PluginInformation pi2: toInstallPlugins) {
    404404                        if (!pls.contains(pi2.name)) {
     
    413413                        new File(Main.pref.getPluginsDirectory(), pi4.name+".jar").deleteOnExit();
    414414                    }
    415                     Main.pref.putCollection("plugins", pls);
     415                    Main.pref.putList("plugins", pls);
    416416                });
    417417            }
  • trunk/src/org/openstreetmap/josm/gui/io/RecentlyOpenedFilesMenu.java

    r12634 r12841  
    5858    private void rebuild() {
    5959        removeAll();
    60         Collection<String> fileHistory = Main.pref.getCollection("file-open.history");
     60        Collection<String> fileHistory = Main.pref.getList("file-open.history");
    6161
    6262        for (final String file : fileHistory) {
     
    101101        @Override
    102102        public void actionPerformed(ActionEvent e) {
    103             Main.pref.putCollection("file-open.history", null);
     103            Main.pref.putList("file-open.history", null);
    104104        }
    105105    }
  • trunk/src/org/openstreetmap/josm/gui/io/UploadDialog.java

    r12799 r12841  
    653653
    654654    private static String getLastChangesetTagFromHistory(String historyKey, List<String> def) {
    655         Collection<String> history = Main.pref.getCollection(historyKey, def);
    656         int age = (int) (System.currentTimeMillis() / 1000 - Main.pref.getInteger(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));
    657657        if (history != null && age < Main.pref.getLong(BasicUploadSettingsPanel.HISTORY_MAX_AGE_KEY, TimeUnit.HOURS.toMillis(4))
    658658                && !history.isEmpty()) {
  • trunk/src/org/openstreetmap/josm/gui/io/UploadStrategySelectionPanel.java

    r12687 r12841  
    323323        UploadStrategy strategy = UploadStrategy.getFromPreferences();
    324324        rbStrategy.get(strategy).setSelected(true);
    325         int chunkSize = Main.pref.getInteger("osm-server.upload-strategy.chunk-size", 1);
     325        int chunkSize = Main.pref.getInt("osm-server.upload-strategy.chunk-size", 1);
    326326        tfChunkSize.setText(Integer.toString(chunkSize));
    327327        updateNumRequestsLabels();
     
    337337        try {
    338338            chunkSize = Integer.parseInt(tfChunkSize.getText().trim());
    339             Main.pref.putInteger("osm-server.upload-strategy.chunk-size", chunkSize);
     339            Main.pref.putInt("osm-server.upload-strategy.chunk-size", chunkSize);
    340340        } catch (NumberFormatException e) {
    341341            // don't save invalid value to preferences
  • trunk/src/org/openstreetmap/josm/gui/io/importexport/GpxExporter.java

    r12671 r12841  
    162162        setCanceled(false);
    163163
    164         Main.pref.put("lastAddAuthor", author.isSelected());
     164        Main.pref.putBoolean("lastAddAuthor", author.isSelected());
    165165        if (!authorName.getText().isEmpty()) {
    166166            Main.pref.put("lastAuthorName", authorName.getText());
Note: See TracChangeset for help on using the changeset viewer.