diff --git a/java_console/ui/src/com/rusefi/Launcher.java b/java_console/ui/src/com/rusefi/Launcher.java index e2d928593a..6df781a90c 100644 --- a/java_console/ui/src/com/rusefi/Launcher.java +++ b/java_console/ui/src/com/rusefi/Launcher.java @@ -32,7 +32,7 @@ import static com.rusefi.ui.storage.PersistentConfiguration.getConfig; * @see EngineSnifferPanel */ public class Launcher { - public static final int CONSOLE_VERSION = 20160104; + public static final int CONSOLE_VERSION = 20160109; public static final boolean SHOW_STIMULATOR = false; private static final String TAB_INDEX = "main_tab"; protected static final String PORT_KEY = "port"; diff --git a/java_console/ui/src/com/rusefi/StartupFrame.java b/java_console/ui/src/com/rusefi/StartupFrame.java index ebca5aa905..108b52dc57 100644 --- a/java_console/ui/src/com/rusefi/StartupFrame.java +++ b/java_console/ui/src/com/rusefi/StartupFrame.java @@ -52,7 +52,6 @@ public class StartupFrame { }); private final JPanel connectPanel = new JPanel(new FlowLayout()); // todo: move this line to the connectPanel - private HorizontalLine horizontalLine = new HorizontalLine(); private final JComboBox comboPorts = new JComboBox<>(); @NotNull private List currentlyDisplayedPorts = new ArrayList<>(); @@ -64,9 +63,10 @@ public class StartupFrame { * closing the application. */ private boolean isProceeding; + private JLabel noPortsMessage = new JLabel("No ports found!"); public StartupFrame() { - frame = new JFrame(Launcher.CONSOLE_VERSION + ": Serial port selection"); + frame = new JFrame("rusEfi console v" + Launcher.CONSOLE_VERSION); frame.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE); frame.addWindowListener(new WindowAdapter() { @Override @@ -106,8 +106,10 @@ public class StartupFrame { }); leftPanel.add(connectPanel); + leftPanel.add(noPortsMessage); + installMessage(noPortsMessage, "Check you cables. Check your drivers. Do you want to start simulator maybe?"); leftPanel.add(new URLLabel(VCP_DRIVER_TEXT, VCP_DRIVER_URI)); - leftPanel.add(horizontalLine); + leftPanel.add(new HorizontalLine()); findAndApplyPorts(); @@ -156,13 +158,18 @@ public class StartupFrame { UiUtils.centerWindow(frame); } + private void installMessage(JComponent component, String s) { + component.setToolTipText(s); + } + private void findAndApplyPorts() { List ports = findAllAvailablePorts(); if (!currentlyDisplayedPorts.equals(ports) || isFirstTimeApplyingPorts) { isFirstTimeApplyingPorts = false; connectPanel.setVisible(!ports.isEmpty()); + noPortsMessage.setVisible(ports.isEmpty()); // panel.add(comboSpeeds); // todo: finish speed selector UI component - horizontalLine.setVisible(!ports.isEmpty()); +// horizontalLine.setVisible(!ports.isEmpty()); addPortSelection(ports); currentlyDisplayedPorts = ports;