X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=altosui%2FAltosConfig.java;h=2cf69525fea1e468d5ab40a502b224d9c64530bd;hb=44ca50a2c9404c92cc887a23dfa25b335ebe6198;hp=a6e6094fc1acbc21fb23dc5ca3de8e60ff612843;hpb=488a527267decece48e6682e0e0c7fc29cbed329;p=fw%2Faltos diff --git a/altosui/AltosConfig.java b/altosui/AltosConfig.java index a6e6094f..2cf69525 100644 --- a/altosui/AltosConfig.java +++ b/altosui/AltosConfig.java @@ -22,8 +22,8 @@ import javax.swing.*; import java.io.*; import java.util.concurrent.*; import java.text.*; -import org.altusmetrum.altoslib_2.*; -import org.altusmetrum.altosuilib_1.*; +import org.altusmetrum.altoslib_4.*; +import org.altusmetrum.altosuilib_2.*; public class AltosConfig implements ActionListener { @@ -161,9 +161,9 @@ public class AltosConfig implements ActionListener { } finally { try { stop_serial(); + serial_line.close(); } catch (InterruptedException ie) { } - serial_line.close(); } } @@ -242,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) { @@ -298,4 +304,4 @@ public class AltosConfig implements ActionListener { } } } -} \ No newline at end of file +}