summaryrefslogtreecommitdiff
path: root/altosui/AltosConfigureUI.java
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2011-01-14 16:47:36 -0800
committerKeith Packard <keithp@keithp.com>2011-01-14 16:48:29 -0800
commitd908c2ebd0b11a54cfd922a192249d0f0df0ddb0 (patch)
tree94d5f299640565438f2b6090adc006167cf3753c /altosui/AltosConfigureUI.java
parentfcaee12a64d5e195b55b8f77c19dfc0c57ef5d58 (diff)
altosui: Add preference for serial debugging.
This dumps serial input/output to stdout. Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'altosui/AltosConfigureUI.java')
-rw-r--r--altosui/AltosConfigureUI.java28
1 files changed, 27 insertions, 1 deletions
diff --git a/altosui/AltosConfigureUI.java b/altosui/AltosConfigureUI.java
index 153c59fd..ab3d950e 100644
--- a/altosui/AltosConfigureUI.java
+++ b/altosui/AltosConfigureUI.java
@@ -47,6 +47,8 @@ public class AltosConfigureUI
JLabel callsign_label;
JTextField callsign_value;
+ JRadioButton serial_debug;
+
/* DocumentListener interface methods */
public void changedUpdate(DocumentEvent e) {
AltosPreferences.set_callsign(callsign_value.getText());
@@ -166,6 +168,30 @@ public class AltosConfigureUI
c.anchor = GridBagConstraints.WEST;
pane.add(callsign_value, c);
+ /* Serial debug setting */
+ c.gridx = 0;
+ c.gridy = 4;
+ c.gridwidth = 1;
+ c.fill = GridBagConstraints.NONE;
+ c.anchor = GridBagConstraints.WEST;
+ pane.add(new JLabel("Serial Debug"), c);
+
+ serial_debug = new JRadioButton("Enable", AltosPreferences.serial_debug());
+ serial_debug.addActionListener(new ActionListener() {
+ public void actionPerformed(ActionEvent e) {
+ JRadioButton item = (JRadioButton) e.getSource();
+ boolean enabled = item.isSelected();
+ AltosPreferences.set_serial_debug(enabled);
+ }
+ });
+
+ c.gridx = 1;
+ c.gridy = 4;
+ c.gridwidth = 3;
+ c.fill = GridBagConstraints.NONE;
+ c.anchor = GridBagConstraints.WEST;
+ pane.add(serial_debug, c);
+
/* And a close button at the bottom */
close = new JButton("Close");
close.addActionListener(new ActionListener() {
@@ -174,7 +200,7 @@ public class AltosConfigureUI
}
});
c.gridx = 0;
- c.gridy = 4;
+ c.gridy = 5;
c.gridwidth = 3;
c.fill = GridBagConstraints.NONE;
c.anchor = GridBagConstraints.CENTER;