Changeset 36121 in osm for applications/editors/josm/plugins
- Timestamp:
- 2023-08-16T11:11:49+02:00 (15 months ago)
- Location:
- applications/editors/josm/plugins/livegps/src/livegps
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/livegps/src/livegps/LiveGPSPreferences.java
r36117 r36121 60 60 private final JTextField serialDevice = new JTextField(30); 61 61 private final JCheckBox disableGPSD = new JCheckBox(tr("Disable GPSD")); 62 private final JCheckBox showOffset = new JCheckBox(tr("Show Distance to nearest way")); 62 63 63 64 public LiveGPSPreferences() { … … 79 80 panel.add(gpsdPort, GBC.eol().fill(GridBagConstraints.HORIZONTAL).insets(5, 0, 0, 5)); 80 81 82 disableGPSD.setSelected(Config.getPref().getBoolean(C_DISABLED, false)); 83 panel.add(disableGPSD, GBC.eol().fill(GridBagConstraints.HORIZONTAL).insets(0, 0, 0, 5)); 84 81 85 serialDevice.setText(Config.getPref().get(C_SERIAL)); 82 serialDevice.setToolTipText(tr(" Serial device for direct NMEA input, does not exist by default"));86 serialDevice.setToolTipText(tr(".Serial device for direct NMEA input, does not exist by default.</html>")); 83 87 panel.add(new JLabel(tr("Serial device")), GBC.std()); 84 88 panel.add(serialDevice, GBC.eol().fill(GridBagConstraints.HORIZONTAL).insets(5, 0, 0, 5)); 89 /* I18n : {0} to {3} is like /dev/ttyACM<b>x</b>, {4} and {5} are COM1 and COM9 */ 90 panel.add(new JLabel(tr("<html>For Linux {0}, {1}, {2} or {3} (<b>x</b> means any number beginning with 0).<br>For Windows {4} to {5} (COM ports bigger than 9 wont work).</html>", "/dev/ttyS<b>x</b>", "/dev/ttyACM<b>x</b>", "/dev/ttyUSB<b>x</b>", "/dev/rfcomm<b>x</b>", "COM1", "COM9")), GBC.eol().fill(GridBagConstraints.HORIZONTAL).insets(10, 0, 0, 5)); 85 91 86 disableGPSD.setSelected(Config.getPref().getBoolean(C_DISABLED));87 panel.add( disableGPSD, GBC.eol().fill(GridBagConstraints.HORIZONTAL).insets(5, 0, 0, 5));92 showOffset.setSelected(Config.getPref().getBoolean(C_WAYOFFSET, false)); 93 panel.add(showOffset, GBC.eol().fill(GridBagConstraints.HORIZONTAL).insets(0, 0, 0, 5)); 88 94 89 95 panel.add(Box.createVerticalGlue(), GBC.eol().fill(GridBagConstraints.VERTICAL)); … … 97 103 Config.getPref().put(C_SERIAL, serialDevice.getText()); 98 104 Config.getPref().putBoolean(C_DISABLED, disableGPSD.isSelected()); 105 Config.getPref().putBoolean(C_WAYOFFSET, showOffset.isSelected()); 99 106 return false; 100 107 } -
applications/editors/josm/plugins/livegps/src/livegps/LiveGpsData.java
r36120 r36121 176 176 if (wayString == null) { 177 177 Node n = new Node(latLon); 178 Way way = null; 178 179 DataSet ds = MainApplication.getLayerManager().getActiveDataSet(); 179 Way way = Geometry.getClosestPrimitive(n, ds.getWays()); 180 if (ds != null) 181 Geometry.getClosestPrimitive(n, ds.getWays()); 180 182 if (way != null) { 181 183 wayString = way.getDisplayName(new DefaultNameFormatter() { -
applications/editors/josm/plugins/livegps/src/livegps/LiveGpsDialog.java
r36120 r36121 41 41 private JLabel courseLabel; 42 42 private JLabel speedLabel; 43 private JLabel wayText; 43 44 private JPanel panel; 44 45 private LiveGpsStatus status = new LiveGpsStatus(LiveGpsStatus.GpsStatus.CONNECTING, tr("Connecting")); … … 56 57 panel.add(nmeaStatusText = new JLabel(tr("Status NMEA"))); 57 58 panel.add(nmeaStatusLabel = new JLabel()); 58 panel.add( new JLabel(tr("Way Info")));59 panel.add(wayText = new JLabel(tr("Way Info"))); 59 60 panel.add(wayLabel = new JLabel()); 60 61 panel.add(latText = new JLabel(tr("Latitude"))); … … 67 68 panel.add(courseLabel = new JLabel()); 68 69 setStatusVisibility(true); 70 if (Config.getPref().getBoolean(LiveGPSPreferences.C_WAYOFFSET, false)) { 71 /* I18N: way information with offset (in m) enabled */ 72 wayText.setText(tr("Way Info [m]")); 73 } else { 74 wayText.setText(tr("Way Info")); 75 } 69 76 createLayout(panel, true, null); 70 77 } … … 110 117 longText.setText(tr("Longitude")); 111 118 } 119 112 120 latLabel.setText(mCord.latToString(data.getLatLon())); 113 121 longLabel.setText(mCord.lonToString(data.getLatLon())); … … 121 129 } else { 122 130 wayLabel.setText(tr("unknown")); 131 } 132 if (Config.getPref().getBoolean(LiveGPSPreferences.C_WAYOFFSET, false)) { 133 /* I18N: way information with offset (in m) enabled */ 134 wayText.setText(tr("Way Info [m]")); 135 } else { 136 wayText.setText(tr("Way Info")); 123 137 } 124 138 } else {
Note:
See TracChangeset
for help on using the changeset viewer.