Changeset 30737 in osm for applications/editors/josm/plugins/DirectUpload/src/org
- Timestamp:
- 2014-10-18T23:07:52+02:00 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/DirectUpload/src/org/openstreetmap/josm/plugins/DirectUpload/UploadDataGui.java
r30532 r30737 52 52 */ 53 53 public class UploadDataGui extends ExtendedDialog { 54 54 55 55 /** 56 56 * This enum contains the possible values for the visibility field and their … … 103 103 104 104 private boolean canceled = false; 105 105 106 106 public UploadDataGui() { 107 107 // Initalizes ExtendedDialog … … 113 113 JPanel content = initComponents(); 114 114 GpxData gpxData = UploadOsmConnection.getInstance().autoSelectTrace(); 115 initTitleAndDescriptionFromGpxData(gpxData); // this is changing some dialog elements, so it (probably) must be before the following 115 initTitleAndDescriptionFromGpxData(gpxData); // this is changing some dialog elements, so it (probably) must be before the following 116 116 setContent(content); 117 117 setButtonIcons(new String[] { "uploadtrace.png", "cancel.png" }); … … 129 129 JLabel visibilityLabel = new JLabel(tr("Visibility")); 130 130 visibilityLabel.setToolTipText(tr("Defines the visibility of your trace for other OSM users.")); 131 131 132 132 visibilityCombo = new JComboBox<>(); 133 133 visibilityCombo.setEditable(false); … … 142 142 descriptionField = new HistoryComboBox(); 143 143 descriptionField.setToolTipText(tr("Please enter Description about your trace.")); 144 145 List<String> descHistory = new LinkedList< String>(Main.pref.getCollection("directupload.description.history", new LinkedList<String>()));144 145 List<String> descHistory = new LinkedList<>(Main.pref.getCollection("directupload.description.history", new LinkedList<String>())); 146 146 // we have to reverse the history, because ComboBoxHistory will reverse it again in addElement() 147 147 // XXX this should be handled in HistoryComboBox … … 154 154 tagsField.setToolTipText(tr("Please enter tags about your trace.")); 155 155 156 List<String> tagsHistory = new LinkedList< String>(Main.pref.getCollection("directupload.tags.history", new LinkedList<String>()));156 List<String> tagsHistory = new LinkedList<>(Main.pref.getCollection("directupload.tags.history", new LinkedList<String>())); 157 157 // we have to reverse the history, because ComboBoxHistory will reverse it againin addElement() 158 158 // XXX this should be handled in HistoryComboBox … … 199 199 } 200 200 else { 201 description = new SimpleDateFormat("yyMMddHHmmss").format(new Date()); 201 description = new SimpleDateFormat("yyMMddHHmmss").format(new Date()); 202 202 title = tr("No GPX layer selected. Cannot upload a trace."); 203 203 } … … 296 296 c.setRequestMethod("POST"); 297 297 c.setDoOutput(true); 298 // unfortunately, addAuth() is protected, so we need to subclass OsmConnection 299 // XXX make addAuth public. 298 // unfortunately, addAuth() is protected, so we need to subclass OsmConnection 299 // XXX make addAuth public. 300 300 UploadOsmConnection.getInstance().addAuthHack(c); 301 301 … … 322 322 returnMsg += "\n" + c.getHeaderField("Error"); 323 323 } 324 324 325 325 final String returnMsgEDT = returnMsg; 326 326 … … 408 408 409 409 final String errorsEDT = errors; 410 410 411 411 GuiHelper.runInEDT(new Runnable() { 412 412 @Override public void run() { … … 414 414 } 415 415 }); 416 416 417 417 return errors.length() > 0; 418 418 } … … 429 429 // Disable Upload button so users can't just upload that track again 430 430 buttons.get(0).setEnabled(false); 431 431 432 432 // save history 433 433 Main.pref.put("directupload.visibility.last-used", visibility.desc2visi(visibilityCombo.getSelectedItem().toString()).name()); 434 434 435 435 descriptionField.addCurrentItemToHistory(); 436 436 Main.pref.putCollection("directupload.description.history", descriptionField.getHistory());
Note:
See TracChangeset
for help on using the changeset viewer.