Changeset 34502 in osm for applications/editors/josm/plugins/DirectUpload/src
- Timestamp:
- 2018-08-18T03:44:15+02:00 (6 years ago)
- 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 9 9 import java.io.IOException; 10 10 import java.net.URL; 11 import java.nio.charset.StandardCharsets; 11 12 import java.text.DecimalFormat; 12 13 import java.text.SimpleDateFormat; … … 20 21 import javax.swing.JPanel; 21 22 22 import org.openstreetmap.josm.Main;23 23 import org.openstreetmap.josm.data.gpx.GpxConstants; 24 24 import org.openstreetmap.josm.data.gpx.GpxData; … … 34 34 import org.openstreetmap.josm.io.GpxWriter; 35 35 import org.openstreetmap.josm.io.OsmApi; 36 import org.openstreetmap.josm.spi.preferences.Config; 36 37 import org.openstreetmap.josm.tools.GBC; 37 38 import org.openstreetmap.josm.tools.HttpClient; … … 97 98 public UploadDataGui() { 98 99 // Initalizes ExtendedDialog 99 super(Main .parent,100 super(MainApplication.getMainFrame(), 100 101 tr("Upload Traces"), 101 102 new String[] {uploadTraceText, tr("Cancel")}, … … 126 127 visibilityCombo.addItem(v.description); 127 128 } 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); 129 130 /* I18n: either copy the link verbose or replace it by the translated version from the wiki for already translated languages */ 130 131 UrlLabel visiUrl = new UrlLabel(tr("https://wiki.openstreetmap.org/wiki/Visibility_of_GPS_traces"), tr("(What does that mean?)"), 2); … … 135 136 descriptionField.setToolTipText(tr("Please enter Description about your trace.")); 136 137 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>())); 138 139 // we have to reverse the history, because ComboBoxHistory will reverse it again in addElement() 139 140 // XXX this should be handled in HistoryComboBox … … 146 147 tagsField.setToolTipText(tr("Please enter tags about your trace.")); 147 148 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>())); 149 150 // we have to reverse the history, because ComboBoxHistory will reverse it againin addElement() 150 151 // XXX this should be handled in HistoryComboBox … … 414 415 415 416 // 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()); 417 418 418 419 descriptionField.addCurrentItemToHistory(); 419 Main.pref.putList("directupload.description.history", descriptionField.getHistory());420 Config.getPref().putList("directupload.description.history", descriptionField.getHistory()); 420 421 421 422 tagsField.addCurrentItemToHistory(); 422 Main.pref.putList("directupload.tags.history", tagsField.getHistory());423 Config.getPref().putList("directupload.tags.history", tagsField.getHistory()); 423 424 424 425 PleaseWaitRunnable uploadTask = new PleaseWaitRunnable(tr("Uploading GPX Track")){ … … 486 487 private void writeString(ByteArrayOutputStream baos, String s) { 487 488 try { 488 baos.write(s.getBytes( ));489 baos.write(s.getBytes(StandardCharsets.UTF_8)); 489 490 } catch(Exception e) {} 490 491 }
Note:
See TracChangeset
for help on using the changeset viewer.