From: Keith Packard Date: Sat, 14 Jun 2014 05:04:57 +0000 (-0700) Subject: telegps: Allow TeleGPS preferences to have a custom title and label X-Git-Tag: 1.4~38 X-Git-Url: https://git.gag.com/?p=fw%2Faltos;a=commitdiff_plain;h=bfbabfa60f3cedd994f693867bce56aad05be02a telegps: Allow TeleGPS preferences to have a custom title and label Don't just inherit the AltosUI ones Signed-off-by: Keith Packard --- diff --git a/altosuilib/AltosUIConfigure.java b/altosuilib/AltosUIConfigure.java index ae7626de..920ed8e2 100644 --- a/altosuilib/AltosUIConfigure.java +++ b/altosuilib/AltosUIConfigure.java @@ -229,8 +229,8 @@ public class AltosUIConfigure public void add_frequencies() { } - public AltosUIConfigure(JFrame in_owner) { - super(in_owner, "Configure AltosUI", false); + public AltosUIConfigure(JFrame in_owner, String name, String label) { + super(in_owner, name, false); owner = in_owner; pane = getContentPane(); @@ -239,7 +239,7 @@ public class AltosUIConfigure row = 0; /* Nice label at the top */ - pane.add(new JLabel ("Configure AltOS UI"), + pane.add(new JLabel (label), constraints(0, 3)); row++; @@ -271,4 +271,8 @@ public class AltosUIConfigure setLocationRelativeTo(owner); setVisible(true); } + + public AltosUIConfigure(JFrame in_owner) { + this(in_owner, "Configure AltosUI", "Configure AltOS UI"); + } } diff --git a/telegps/TeleGPSPreferences.java b/telegps/TeleGPSPreferences.java index 534cf550..8bd371f4 100644 --- a/telegps/TeleGPSPreferences.java +++ b/telegps/TeleGPSPreferences.java @@ -112,38 +112,8 @@ public class TeleGPSPreferences row++; } - final static String[] position_names = { - "Top left", - "Top", - "Top right", - "Left", - "Center", - "Right", - "Bottom left", - "Bottom", - "Bottom right", - }; - - public void add_position() { - pane.add(new JLabel ("Menu position"), constraints(0, 1)); - - position_value = new JComboBox(position_names); - position_value.setMaximumRowCount(position_names.length); - int position = AltosUIPreferences.position(); - position_value.setSelectedIndex(position); - position_value.addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent e) { - int position = position_value.getSelectedIndex(); - AltosUIPreferences.set_position(position); - } - }); - pane.add(position_value, constraints(1, 2, GridBagConstraints.BOTH)); - position_value.setToolTipText("Position of main AltosUI window"); - row++; - } - public TeleGPSPreferences(JFrame owner, AltosVoice voice) { - super(owner); + super(owner, "TeleGPS Preferences", "Configure TeleGPS"); this.voice = voice; }