auto-sync

This commit is contained in:
rusEfi 2016-02-05 17:03:04 -05:00
parent 90ecd0e92b
commit 48996efdf2
3 changed files with 5 additions and 2 deletions

View File

@ -36,10 +36,12 @@ public enum FileLog {
@Nullable
private OutputStream fileLog; // null if not opened yet or already closed
private FileLog() {
FileLog() {
}
public void start() {
if (fileLog != null)
return;
try {
fileLog = openLog();
} catch (FileNotFoundException e) {

View File

@ -69,7 +69,6 @@ public class Launcher {
public Launcher(String port) {
this.port = port;
staticFrame = frame.getFrame();
FileLog.MAIN.start();
FileLog.MAIN.logLine("Console " + CONSOLE_VERSION);
getConfig().getRoot().setProperty(PORT_KEY, port);
@ -183,6 +182,7 @@ public class Launcher {
}
public static void main(final String[] args) throws Exception {
FileLog.MAIN.start();
getConfig().load();
Thread.setDefaultUncaughtExceptionHandler(new DefaultExceptionHandler());
VersionChecker.start();

View File

@ -165,6 +165,7 @@ public class StartupFrame {
private void findAndApplyPorts() {
List<String> ports = findAllAvailablePorts();
if (!currentlyDisplayedPorts.equals(ports) || isFirstTimeApplyingPorts) {
FileLog.MAIN.logLine("Available ports " + ports);
isFirstTimeApplyingPorts = false;
connectPanel.setVisible(!ports.isEmpty());
noPortsMessage.setVisible(ports.isEmpty());