auto-sync

This commit is contained in:
rusEfi 2015-04-06 07:08:15 -05:00
parent 3c8bec71f2
commit 562be8bd7f
2 changed files with 10 additions and 3 deletions

View File

@ -34,9 +34,10 @@ import static com.rusefi.ui.storage.PersistentConfiguration.getConfig;
* @see com.rusefi.StartupFrame * @see com.rusefi.StartupFrame
*/ */
public class Launcher { public class Launcher {
public static final int CONSOLE_VERSION = 20150405; public static final int CONSOLE_VERSION = 20150406;
public static final boolean SHOW_STIMULATOR = false; public static final boolean SHOW_STIMULATOR = false;
public static final String TAB_INDEX = "main_tab"; private static final String TAB_INDEX = "main_tab";
protected static final String PORT_KEY = "port";
private final String port; private final String port;
private final JTabbedPane tabbedPane = new JTabbedPane(); private final JTabbedPane tabbedPane = new JTabbedPane();
@ -70,6 +71,8 @@ public class Launcher {
staticFrame = frame.getFrame(); staticFrame = frame.getFrame();
FileLog.MAIN.start(); FileLog.MAIN.start();
getConfig().getRoot().setProperty(PORT_KEY, port);
LinkManager.start(port); LinkManager.start(port);
FileLog.MAIN.logLine("Console " + CONSOLE_VERSION); FileLog.MAIN.logLine("Console " + CONSOLE_VERSION);
@ -102,7 +105,7 @@ public class Launcher {
if (!LinkManager.isLogViewerMode(port)) { if (!LinkManager.isLogViewerMode(port)) {
int selectedIndex = getConfig().getRoot().getIntProperty("main_tab", 2); int selectedIndex = getConfig().getRoot().getIntProperty(TAB_INDEX, 2);
if (selectedIndex < tabbedPane.getTabCount()) if (selectedIndex < tabbedPane.getTabCount())
tabbedPane.setSelectedIndex(selectedIndex); tabbedPane.setSelectedIndex(selectedIndex);
} }

View File

@ -23,6 +23,8 @@ import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
import java.util.List; import java.util.List;
import static com.rusefi.ui.storage.PersistentConfiguration.getConfig;
/** /**
* This frame is used on startup to select the port we would be using * This frame is used on startup to select the port we would be using
* *
@ -128,6 +130,8 @@ public class StartupFrame {
for (final String port : ports) for (final String port : ports)
comboPorts.addItem(port); comboPorts.addItem(port);
panel.add(comboPorts); panel.add(comboPorts);
String defaultPort = getConfig().getRoot().getProperty(Launcher.PORT_KEY, "");
comboPorts.setSelectedItem(defaultPort);
final JComboBox<String> comboSpeeds = createSpeedCombo(); final JComboBox<String> comboSpeeds = createSpeedCombo();
// panel.add(comboSpeeds); // panel.add(comboSpeeds);