X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=altosui%2FAltosConfig.java;h=2cf69525fea1e468d5ab40a502b224d9c64530bd;hb=e0dfa934ba76d6f913af37999e05c20e614bd3e9;hp=e1ffebb4b95f1129144e1a86c70dadf2915ae78d;hpb=b26e837a6f18641aae9372aab22168849ff10812;p=fw%2Faltos diff --git a/altosui/AltosConfig.java b/altosui/AltosConfig.java index e1ffebb4..2cf69525 100644 --- a/altosui/AltosConfig.java +++ b/altosui/AltosConfig.java @@ -21,8 +21,9 @@ import java.awt.event.*; import javax.swing.*; import java.io.*; import java.util.concurrent.*; -import org.altusmetrum.AltosLib.*; import java.text.*; +import org.altusmetrum.altoslib_4.*; +import org.altusmetrum.altosuilib_2.*; public class AltosConfig implements ActionListener { @@ -160,9 +161,9 @@ public class AltosConfig implements ActionListener { } finally { try { stop_serial(); + serial_line.close(); } catch (InterruptedException ie) { } - serial_line.close(); } } @@ -241,9 +242,15 @@ public class AltosConfig implements ActionListener { /* Pull data out of the UI and stuff back into our local data record */ - data.get_values(config_ui); - - run_serial_thread(serial_mode_save); + try { + data.get_values(config_ui); + run_serial_thread(serial_mode_save); + } catch (AltosConfigDataException ae) { + JOptionPane.showMessageDialog(owner, + ae.getMessage(), + "Configuration Data Error", + JOptionPane.ERROR_MESSAGE); + } } public void actionPerformed(ActionEvent e) { @@ -270,7 +277,7 @@ public class AltosConfig implements ActionListener { public AltosConfig(JFrame given_owner) { owner = given_owner; - device = AltosDeviceDialog.show(owner, Altos.product_any); + device = AltosDeviceUIDialog.show(owner, Altos.product_any); if (device != null) { try { serial_line = new AltosSerial(device); @@ -297,4 +304,4 @@ public class AltosConfig implements ActionListener { } } } -} \ No newline at end of file +}