more on icons

This commit is contained in:
rusefi 2020-06-30 20:20:00 -04:00
parent f4148c79bd
commit 4aeeef4f46
3 changed files with 10 additions and 1 deletions

View File

@ -3,6 +3,6 @@ package com.rusefi;
import java.util.concurrent.atomic.AtomicReference;
public class rusEFIVersion {
public static final int CONSOLE_VERSION = 20200627;
public static final int CONSOLE_VERSION = 20200630;
public static AtomicReference<String> firmwareVersion = new AtomicReference<>("N/A");
}

View File

@ -28,6 +28,7 @@ import java.lang.reflect.InvocationTargetException;
import java.util.HashMap;
import java.util.Map;
import static com.rusefi.StartupFrame.setFrameIcon;
import static com.rusefi.rusEFIVersion.CONSOLE_VERSION;
import static com.rusefi.ui.storage.PersistentConfiguration.getConfig;
@ -63,6 +64,7 @@ public class ConsoleUI {
this.port = port;
mainFrame = new MainFrame(this, tabbedPane);
ConsoleUI.staticFrame = mainFrame.getFrame().getFrame();
setFrameIcon(ConsoleUI.staticFrame);
FileLog.MAIN.logLine("Console " + CONSOLE_VERSION);
FileLog.MAIN.logLine("Hardware: " + FirmwareFlasher.getHardwareKind());

View File

@ -199,6 +199,7 @@ public class StartupFrame {
content.add(rightPanel, BorderLayout.EAST);
frame.add(content);
frame.pack();
setFrameIcon(frame);
frame.setVisible(true);
UiUtils.centerWindow(frame);
@ -209,6 +210,12 @@ public class StartupFrame {
}
}
public static void setFrameIcon(Frame frame) {
ImageIcon icon = AutoupdateUtil.loadIcon(LOGO);
if (icon != null)
frame.setIconImage(icon.getImage());
}
public static JLabel createLogoLabel() {
ImageIcon logoIcon = AutoupdateUtil.loadIcon(LOGO);
if (logoIcon == null)