Ignore:
Timestamp:
2018-08-18T03:44:15+02:00 (6 years ago)
Author:
donvip
Message:

update to JOSM 14153

Location:
applications/editors/josm/plugins/DirectUpload/src/org/openstreetmap/josm/plugins/DirectUpload
Files:
1 deleted
1 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/DirectUpload/src/org/openstreetmap/josm/plugins/DirectUpload/UploadDataGui.java

    r34382 r34502  
    99import java.io.IOException;
    1010import java.net.URL;
     11import java.nio.charset.StandardCharsets;
    1112import java.text.DecimalFormat;
    1213import java.text.SimpleDateFormat;
     
    2021import javax.swing.JPanel;
    2122
    22 import org.openstreetmap.josm.Main;
    2323import org.openstreetmap.josm.data.gpx.GpxConstants;
    2424import org.openstreetmap.josm.data.gpx.GpxData;
     
    3434import org.openstreetmap.josm.io.GpxWriter;
    3535import org.openstreetmap.josm.io.OsmApi;
     36import org.openstreetmap.josm.spi.preferences.Config;
    3637import org.openstreetmap.josm.tools.GBC;
    3738import org.openstreetmap.josm.tools.HttpClient;
     
    9798    public UploadDataGui() {
    9899        // Initalizes ExtendedDialog
    99         super(Main.parent,
     100        super(MainApplication.getMainFrame(),
    100101                tr("Upload Traces"),
    101102                new String[] {uploadTraceText, tr("Cancel")},
     
    126127            visibilityCombo.addItem(v.description);
    127128        }
    128         visibilityCombo.setSelectedItem(visibility.valueOf(Main.pref.get("directupload.visibility.last-used", visibility.PRIVATE.name())).description);
     129        visibilityCombo.setSelectedItem(visibility.valueOf(Config.getPref().get("directupload.visibility.last-used", visibility.PRIVATE.name())).description);
    129130        /* I18n: either copy the link verbose or replace it by the translated version from the wiki for already translated languages */
    130131        UrlLabel visiUrl = new UrlLabel(tr("https://wiki.openstreetmap.org/wiki/Visibility_of_GPS_traces"), tr("(What does that mean?)"), 2);
     
    135136        descriptionField.setToolTipText(tr("Please enter Description about your trace."));
    136137
    137         List<String> descHistory = new LinkedList<>(Main.pref.getList("directupload.description.history", new LinkedList<String>()));
     138        List<String> descHistory = new LinkedList<>(Config.getPref().getList("directupload.description.history", new LinkedList<String>()));
    138139        // we have to reverse the history, because ComboBoxHistory will reverse it again in addElement()
    139140        // XXX this should be handled in HistoryComboBox
     
    146147        tagsField.setToolTipText(tr("Please enter tags about your trace."));
    147148
    148         List<String> tagsHistory = new LinkedList<>(Main.pref.getList("directupload.tags.history", new LinkedList<String>()));
     149        List<String> tagsHistory = new LinkedList<>(Config.getPref().getList("directupload.tags.history", new LinkedList<String>()));
    149150        // we have to reverse the history, because ComboBoxHistory will reverse it againin addElement()
    150151        // XXX this should be handled in HistoryComboBox
     
    414415
    415416        // save history
    416         Main.pref.put("directupload.visibility.last-used", visibility.desc2visi(visibilityCombo.getSelectedItem().toString()).name());
     417        Config.getPref().put("directupload.visibility.last-used", visibility.desc2visi(visibilityCombo.getSelectedItem().toString()).name());
    417418
    418419        descriptionField.addCurrentItemToHistory();
    419         Main.pref.putList("directupload.description.history", descriptionField.getHistory());
     420        Config.getPref().putList("directupload.description.history", descriptionField.getHistory());
    420421
    421422        tagsField.addCurrentItemToHistory();
    422         Main.pref.putList("directupload.tags.history", tagsField.getHistory());
     423        Config.getPref().putList("directupload.tags.history", tagsField.getHistory());
    423424
    424425        PleaseWaitRunnable uploadTask = new PleaseWaitRunnable(tr("Uploading GPX Track")){
     
    486487    private void writeString(ByteArrayOutputStream baos, String s) {
    487488        try {
    488             baos.write(s.getBytes());
     489            baos.write(s.getBytes(StandardCharsets.UTF_8));
    489490        } catch(Exception e) {}
    490491    }
Note: See TracChangeset for help on using the changeset viewer.