Changeset 12846 in josm for trunk/src/org/openstreetmap/josm/gui/preferences/audio/AudioPreference.java
- Timestamp:
- 2017-09-13T23:24:50+02:00 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/preferences/audio/AudioPreference.java
r12841 r12846 11 11 import javax.swing.JPanel; 12 12 13 import org.openstreetmap.josm.Main;14 13 import org.openstreetmap.josm.gui.preferences.DefaultTabPreferenceSetting; 15 14 import org.openstreetmap.josm.gui.preferences.PreferenceSetting; … … 18 17 import org.openstreetmap.josm.gui.widgets.JosmTextField; 19 18 import org.openstreetmap.josm.gui.widgets.VerticallyScrollablePanel; 19 import org.openstreetmap.josm.spi.preferences.Config; 20 20 import org.openstreetmap.josm.tools.GBC; 21 21 … … 60 60 61 61 // audioMenuVisible 62 audioMenuVisible.setSelected(! Main.pref.getBoolean("audio.menuinvisible"));62 audioMenuVisible.setSelected(!Config.getPref().getBoolean("audio.menuinvisible")); 63 63 audioMenuVisible.setToolTipText(tr("Show or hide the audio menu entry on the main menu bar.")); 64 64 audio.add(audioMenuVisible, GBC.eol().insets(0, 0, 0, 0)); 65 65 66 66 // audioTraceVisible 67 markerAudioTraceVisible.setSelected( Main.pref.getBoolean("marker.traceaudio", true));67 markerAudioTraceVisible.setSelected(Config.getPref().getBoolean("marker.traceaudio", true)); 68 68 markerAudioTraceVisible.setToolTipText( 69 69 tr("Display a moving icon representing the point on the synchronized track where the audio currently playing was recorded.")); … … 71 71 72 72 // buttonLabels 73 markerButtonLabels.setSelected( Main.pref.getBoolean("marker.buttonlabels", true));73 markerButtonLabels.setSelected(Config.getPref().getBoolean("marker.buttonlabels", true)); 74 74 markerButtonLabels.setToolTipText(tr("Put text labels against audio (and image and web) markers as well as their button icons.")); 75 75 audio.add(markerButtonLabels, GBC.eol().insets(0, 0, 0, 0)); … … 78 78 79 79 // audioMarkersFromExplicitWaypoints 80 audioMarkersFromExplicitWaypoints.setSelected( Main.pref.getBoolean("marker.audiofromexplicitwaypoints", true));80 audioMarkersFromExplicitWaypoints.setSelected(Config.getPref().getBoolean("marker.audiofromexplicitwaypoints", true)); 81 81 audioMarkersFromExplicitWaypoints.setToolTipText(tr("When importing audio, apply it to any waypoints in the GPX layer.")); 82 82 audio.add(audioMarkersFromExplicitWaypoints, GBC.eol().insets(10, 0, 0, 0)); 83 83 84 84 // audioMarkersFromUntimedWaypoints 85 audioMarkersFromUntimedWaypoints.setSelected( Main.pref.getBoolean("marker.audiofromuntimedwaypoints", true));85 audioMarkersFromUntimedWaypoints.setSelected(Config.getPref().getBoolean("marker.audiofromuntimedwaypoints", true)); 86 86 audioMarkersFromUntimedWaypoints.setToolTipText(tr("When importing audio, apply it to any waypoints in the GPX layer.")); 87 87 audio.add(audioMarkersFromUntimedWaypoints, GBC.eol().insets(10, 0, 0, 0)); 88 88 89 89 // audioMarkersFromNamedTrackpoints 90 audioMarkersFromNamedTrackpoints.setSelected( Main.pref.getBoolean("marker.audiofromnamedtrackpoints", false));90 audioMarkersFromNamedTrackpoints.setSelected(Config.getPref().getBoolean("marker.audiofromnamedtrackpoints", false)); 91 91 audioMarkersFromNamedTrackpoints.setToolTipText( 92 92 tr("Automatically create audio markers from trackpoints (rather than explicit waypoints) with names or descriptions.")); … … 94 94 95 95 // audioMarkersFromWavTimestamps 96 audioMarkersFromWavTimestamps.setSelected( Main.pref.getBoolean("marker.audiofromwavtimestamps", false));96 audioMarkersFromWavTimestamps.setSelected(Config.getPref().getBoolean("marker.audiofromwavtimestamps", false)); 97 97 audioMarkersFromWavTimestamps.setToolTipText( 98 98 tr("Create audio markers at the position on the track corresponding to the modified time of each audio WAV file imported.")); … … 100 100 101 101 // audioMarkersFromStart 102 audioMarkersFromStart.setSelected( Main.pref.getBoolean("marker.audiofromstart"));102 audioMarkersFromStart.setSelected(Config.getPref().getBoolean("marker.audiofromstart")); 103 103 audioMarkersFromStart.setToolTipText( 104 104 tr("Automatically create audio markers from trackpoints (rather than explicit waypoints) with names or descriptions.")); 105 105 audio.add(audioMarkersFromStart, GBC.eol().insets(10, 0, 0, 0)); 106 106 107 audioForwardBackAmount.setText( Main.pref.get("audio.forwardbackamount", "10.0"));107 audioForwardBackAmount.setText(Config.getPref().get("audio.forwardbackamount", "10.0")); 108 108 audioForwardBackAmount.setToolTipText(tr("The number of seconds to jump forward or back when the relevant button is pressed")); 109 109 audio.add(new JLabel(tr("Forward/back time (seconds)")), GBC.std()); 110 110 audio.add(audioForwardBackAmount, GBC.eol().fill(GBC.HORIZONTAL).insets(5, 0, 0, 5)); 111 111 112 audioFastForwardMultiplier.setText( Main.pref.get("audio.fastfwdmultiplier", "1.3"));112 audioFastForwardMultiplier.setText(Config.getPref().get("audio.fastfwdmultiplier", "1.3")); 113 113 audioFastForwardMultiplier.setToolTipText(tr("The amount by which the speed is multiplied for fast forwarding")); 114 114 audio.add(new JLabel(tr("Fast forward multiplier")), GBC.std()); 115 115 audio.add(audioFastForwardMultiplier, GBC.eol().fill(GBC.HORIZONTAL).insets(5, 0, 0, 5)); 116 116 117 audioLeadIn.setText( Main.pref.get("audio.leadin", "1.0"));117 audioLeadIn.setText(Config.getPref().get("audio.leadin", "1.0")); 118 118 audioLeadIn.setToolTipText( 119 119 tr("Playback starts this number of seconds before (or after, if negative) the audio track position requested")); … … 121 121 audio.add(audioLeadIn, GBC.eol().fill(GBC.HORIZONTAL).insets(5, 0, 0, 5)); 122 122 123 audioCalibration.setText( Main.pref.get("audio.calibration", "1.0"));123 audioCalibration.setText(Config.getPref().get("audio.calibration", "1.0")); 124 124 audioCalibration.setToolTipText(tr("The ratio of voice recorder elapsed time to true elapsed time")); 125 125 audio.add(new JLabel(tr("Voice recorder calibration")), GBC.std()); … … 133 133 @Override 134 134 public boolean ok() { 135 Main.pref.putBoolean("audio.menuinvisible", !audioMenuVisible.isSelected());136 Main.pref.putBoolean("marker.traceaudio", markerAudioTraceVisible.isSelected());137 Main.pref.putBoolean("marker.buttonlabels", markerButtonLabels.isSelected());138 Main.pref.putBoolean("marker.audiofromexplicitwaypoints", audioMarkersFromExplicitWaypoints.isSelected());139 Main.pref.putBoolean("marker.audiofromuntimedwaypoints", audioMarkersFromUntimedWaypoints.isSelected());140 Main.pref.putBoolean("marker.audiofromnamedtrackpoints", audioMarkersFromNamedTrackpoints.isSelected());141 Main.pref.putBoolean("marker.audiofromwavtimestamps", audioMarkersFromWavTimestamps.isSelected());142 Main.pref.putBoolean("marker.audiofromstart", audioMarkersFromStart.isSelected());143 Main.pref.put("audio.forwardbackamount", audioForwardBackAmount.getText());144 Main.pref.put("audio.fastfwdmultiplier", audioFastForwardMultiplier.getText());145 Main.pref.put("audio.leadin", audioLeadIn.getText());146 Main.pref.put("audio.calibration", audioCalibration.getText());135 Config.getPref().putBoolean("audio.menuinvisible", !audioMenuVisible.isSelected()); 136 Config.getPref().putBoolean("marker.traceaudio", markerAudioTraceVisible.isSelected()); 137 Config.getPref().putBoolean("marker.buttonlabels", markerButtonLabels.isSelected()); 138 Config.getPref().putBoolean("marker.audiofromexplicitwaypoints", audioMarkersFromExplicitWaypoints.isSelected()); 139 Config.getPref().putBoolean("marker.audiofromuntimedwaypoints", audioMarkersFromUntimedWaypoints.isSelected()); 140 Config.getPref().putBoolean("marker.audiofromnamedtrackpoints", audioMarkersFromNamedTrackpoints.isSelected()); 141 Config.getPref().putBoolean("marker.audiofromwavtimestamps", audioMarkersFromWavTimestamps.isSelected()); 142 Config.getPref().putBoolean("marker.audiofromstart", audioMarkersFromStart.isSelected()); 143 Config.getPref().put("audio.forwardbackamount", audioForwardBackAmount.getText()); 144 Config.getPref().put("audio.fastfwdmultiplier", audioFastForwardMultiplier.getText()); 145 Config.getPref().put("audio.leadin", audioLeadIn.getText()); 146 Config.getPref().put("audio.calibration", audioCalibration.getText()); 147 147 return false; 148 148 }
Note:
See TracChangeset
for help on using the changeset viewer.