X-Git-Url: https://git.gag.com/?p=fw%2Faltos;a=blobdiff_plain;f=ao-tools%2Faltosui%2FAltosDeviceDialog.java;h=08921c3d044d308680106b529b96f2c0b4abad8e;hp=cb1eef8bc8f8204db8ab414a5dbd7563be1ddb80;hb=e76b9cc32bbcc5176d9bdd6f8d79778024627382;hpb=447c121fc1ceb878e45718ad1364a5349965a59a diff --git a/ao-tools/altosui/AltosDeviceDialog.java b/ao-tools/altosui/AltosDeviceDialog.java index cb1eef8b..08921c3d 100644 --- a/ao-tools/altosui/AltosDeviceDialog.java +++ b/ao-tools/altosui/AltosDeviceDialog.java @@ -20,15 +20,17 @@ package altosui; import java.lang.*; import java.util.*; import javax.swing.*; +import libaltosJNI.libaltos; +import libaltosJNI.altos_device; +import libaltosJNI.SWIGTYPE_p_altos_file; +import libaltosJNI.SWIGTYPE_p_altos_list; import altosui.AltosDevice; -import altosui.AltosDeviceLinux; public class AltosDeviceDialog { - static AltosDevice show (JFrame frame, String product) { - AltosDevice[] devices = null; - if (System.getProperty("os.name").startsWith("Linux")) - devices = AltosDeviceLinux.list(product); + static altos_device show (JFrame frame, String product) { + AltosDevice[] devices; + devices = AltosDevice.list(product); if (devices != null & devices.length > 0) { Object o = JOptionPane.showInputDialog(frame, "Select a device", @@ -37,8 +39,12 @@ public class AltosDeviceDialog { null, devices, devices[0]); - return (AltosDevice) o; + return (altos_device) o; } else { + JOptionPane.showMessageDialog(frame, + "No AltOS devices available", + "No AltOS devices", + JOptionPane.ERROR_MESSAGE); return null; } }