diff options
| author | Keith Packard <keithp@keithp.com> | 2011-08-28 15:50:01 -0700 | 
|---|---|---|
| committer | Keith Packard <keithp@keithp.com> | 2011-08-28 15:50:01 -0700 | 
| commit | cf72c2f5a69a736c28a9b63e124d510ef41a9f5d (patch) | |
| tree | 5b6b54f669e169c1e46747dd842eae27aba963d8 /altosui/AltosDeviceDialog.java | |
| parent | 3d478a39f2ede7b805bbe568cc1c8ecc176d7a04 (diff) | |
altosui: Add bluetooth bits back in
Stub out functions on mac/windows for now.
Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'altosui/AltosDeviceDialog.java')
| -rw-r--r-- | altosui/AltosDeviceDialog.java | 36 | 
1 files changed, 15 insertions, 21 deletions
| diff --git a/altosui/AltosDeviceDialog.java b/altosui/AltosDeviceDialog.java index fa9587bc..610bb73e 100644 --- a/altosui/AltosDeviceDialog.java +++ b/altosui/AltosDeviceDialog.java @@ -30,8 +30,7 @@ public class AltosDeviceDialog extends JDialog implements ActionListener {  	private JList		list;  	private JButton		cancel_button;  	private JButton		select_button; -// BLUETOOTH -//	private JButton		manage_bluetooth_button; +	private JButton		manage_bluetooth_button;  	private Frame		frame;  	private int		product; @@ -42,17 +41,15 @@ public class AltosDeviceDialog extends JDialog implements ActionListener {  	private AltosDevice[] devices() {  		java.util.List<AltosDevice>	usb_devices = AltosUSBDevice.list(product);  		int				num_devices = usb_devices.size(); -// BLUETOOTH -//		java.util.List<AltosDevice>	bt_devices = Altos.bt_known.list(product); -//		num_devices += bt_devices.size(); +		java.util.List<AltosDevice>	bt_devices = Altos.bt_known.list(product); +		num_devices += bt_devices.size();  		AltosDevice[]			devices = new AltosDevice[num_devices];  		for (int i = 0; i < usb_devices.size(); i++)  			devices[i] = usb_devices.get(i); -// BLUETOOTH -//		int off = usb_devices.size(); -//		for (int j = 0; j < bt_devices.size(); j++) -//			devices[off + j] = bt_devices.get(j); +		int off = usb_devices.size(); +		for (int j = 0; j < bt_devices.size(); j++) +			devices[off + j] = bt_devices.get(j);  		return devices;  	} @@ -75,10 +72,9 @@ public class AltosDeviceDialog extends JDialog implements ActionListener {  		cancel_button.setActionCommand("cancel");  		cancel_button.addActionListener(this); -// BLUETOOTH -//		manage_bluetooth_button = new JButton("Manage Bluetooth"); -//		manage_bluetooth_button.setActionCommand("manage"); -//		manage_bluetooth_button.addActionListener(this); +		manage_bluetooth_button = new JButton("Manage Bluetooth"); +		manage_bluetooth_button.setActionCommand("manage"); +		manage_bluetooth_button.addActionListener(this);  		select_button = new JButton("Select");  		select_button.setActionCommand("select"); @@ -152,8 +148,7 @@ public class AltosDeviceDialog extends JDialog implements ActionListener {  		buttonPane.add(Box.createHorizontalGlue());  		buttonPane.add(cancel_button);  		buttonPane.add(Box.createRigidArea(new Dimension(10, 0))); -// BLUETOOTH -//		buttonPane.add(manage_bluetooth_button); +		buttonPane.add(manage_bluetooth_button);  		buttonPane.add(Box.createRigidArea(new Dimension(10, 0)));  		buttonPane.add(select_button); @@ -173,12 +168,11 @@ public class AltosDeviceDialog extends JDialog implements ActionListener {  	public void actionPerformed(ActionEvent e) {  		if ("select".equals(e.getActionCommand()))  			value = (AltosDevice)(list.getSelectedValue()); -// BLUETOOTH -//		if ("manage".equals(e.getActionCommand())) { -//			AltosBTManage.show(frame, Altos.bt_known); -//			update_devices(); -//			return; -//		} +		if ("manage".equals(e.getActionCommand())) { +			AltosBTManage.show(frame, Altos.bt_known); +			update_devices(); +			return; +		}  		setVisible(false);  	} | 
