diff options
| author | Bdale Garbee <bdale@gag.com> | 2014-06-24 21:17:53 -0600 | 
|---|---|---|
| committer | Bdale Garbee <bdale@gag.com> | 2014-06-24 21:17:53 -0600 | 
| commit | bd440afc2a6e37b74fffcf1b977e149485095316 (patch) | |
| tree | 3e42f1102d68d49dae3061b9592e23907e245f23 /altosui/AltosConfigTDUI.java | |
| parent | 5d4f912bcc6784f975c82f7b0ed8dc360e60aae8 (diff) | |
| parent | a0ccab8e4235934538a03f8be3b37aa1bbd6b144 (diff) | |
Merge branch 'master' of ssh://git.gag.com/scm/git/fw/altos
Diffstat (limited to 'altosui/AltosConfigTDUI.java')
| -rw-r--r-- | altosui/AltosConfigTDUI.java | 34 | 
1 files changed, 8 insertions, 26 deletions
diff --git a/altosui/AltosConfigTDUI.java b/altosui/AltosConfigTDUI.java index 22b3384d..ca365718 100644 --- a/altosui/AltosConfigTDUI.java +++ b/altosui/AltosConfigTDUI.java @@ -21,8 +21,8 @@ import java.awt.*;  import java.awt.event.*;  import javax.swing.*;  import javax.swing.event.*; -import org.altusmetrum.altoslib_4.*; -import org.altusmetrum.altosuilib_2.*; +import org.altusmetrum.altoslib_5.*; +import org.altusmetrum.altosuilib_3.*;  public class AltosConfigTDUI  	extends AltosUIDialog @@ -44,6 +44,7 @@ public class AltosConfigTDUI  	JLabel		product_value;  	JLabel		version_value;  	JLabel		serial_value; +	JMenuBar	radio_frequency_menu_bar;  	AltosFreqList	radio_frequency_value;  	JLabel		radio_calibration_value; @@ -166,9 +167,11 @@ public class AltosConfigTDUI  		c.anchor = GridBagConstraints.LINE_START;  		c.insets = ir;  		c.ipady = 5; -		radio_frequency_value = new AltosFreqList(); +		radio_frequency_value = new AltosFreqList(false);  		radio_frequency_value.addItemListener(this); -		pane.add(radio_frequency_value, c); +		radio_frequency_menu_bar = new JMenuBar(); +		radio_frequency_menu_bar.add(radio_frequency_value); +		pane.add(radio_frequency_menu_bar, c);  		radio_frequency_value.setToolTipText("Telemetry, RDF and packet frequency");  		/* Radio Calibration */ @@ -308,28 +311,7 @@ public class AltosConfigTDUI  	}  	public void set_radio_frequency(double new_radio_frequency) { -		int i; -		for (i = 0; i < radio_frequency_value.getItemCount(); i++) { -			AltosFrequency	f = (AltosFrequency) radio_frequency_value.getItemAt(i); - -			if (f.close(new_radio_frequency)) { -				radio_frequency_value.setSelectedIndex(i); -				return; -			} -		} -		for (i = 0; i < radio_frequency_value.getItemCount(); i++) { -			AltosFrequency	f = (AltosFrequency) radio_frequency_value.getItemAt(i); - -			if (new_radio_frequency < f.frequency) -				break; -		} -		String	description = String.format("%s serial %s", -						    product_value.getText(), -						    serial_value.getText()); -		AltosFrequency	new_frequency = new AltosFrequency(new_radio_frequency, description); -		AltosPreferences.add_common_frequency(new_frequency); -		radio_frequency_value.insertItemAt(new_frequency, i); -		radio_frequency_value.setSelectedIndex(i); +		radio_frequency_value.set_frequency(new_radio_frequency);  	}  	public double radio_frequency() {  | 
