X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=altosui%2FAltosFlashUI.java;h=f91c542dfd5e7b24cc1b53b762a5f04ddd407b54;hb=97663f922e236f4ee7bd08277ca80d419b5cd10f;hp=39151641e42bdbaa6bf1ef0bf93d269f8c1d9dfe;hpb=7ecde50fbebe68a2e2200a2f8d081fd37074f840;p=fw%2Faltos diff --git a/altosui/AltosFlashUI.java b/altosui/AltosFlashUI.java index 39151641..f91c542d 100644 --- a/altosui/AltosFlashUI.java +++ b/altosui/AltosFlashUI.java @@ -161,7 +161,7 @@ public class AltosFlashUI boolean select_source_file() { JFileChooser hexfile_chooser = new JFileChooser(); - File firmwaredir = AltosPreferences.firmwaredir(); + File firmwaredir = AltosUIPreferences.firmwaredir(); if (firmwaredir != null) hexfile_chooser.setCurrentDirectory(firmwaredir); @@ -174,7 +174,7 @@ public class AltosFlashUI file = hexfile_chooser.getSelectedFile(); if (file == null) return false; - AltosPreferences.set_firmwaredir(file.getParentFile()); + AltosUIPreferences.set_firmwaredir(file.getParentFile()); return true; } @@ -247,7 +247,7 @@ public class AltosFlashUI flash.set_romconfig(ui.rom_config); flash.flash(); } - } catch (Exception ee) { + } catch (InterruptedException ee) { final Exception e = ee; System.out.printf("exception %s\n", e.toString()); SwingUtilities.invokeLater(new Runnable() { @@ -255,9 +255,26 @@ public class AltosFlashUI ui.exception(e); } }); + } catch (IOException ee) { + final Exception e = ee; + System.out.printf("exception %s\n", e.toString()); + SwingUtilities.invokeLater(new Runnable() { + public void run() { + ui.exception(e); + } + }); + } catch (AltosSerialInUseException ee) { + final Exception e = ee; + System.out.printf("exception %s\n", e.toString()); + SwingUtilities.invokeLater(new Runnable() { + public void run() { + ui.exception(e); + } + }); + } finally { + if (flash != null) + flash.close(); } - if (flash != null) - flash.close(); } public flash_task(AltosFlashUI in_ui) {