mirror of https://github.com/FOME-Tech/fome-fw.git
minor usability: reducing "set date" spam
This commit is contained in:
parent
017278832d
commit
a443a9b65b
|
@ -6,7 +6,7 @@ import java.net.URL;
|
||||||
import java.util.concurrent.atomic.AtomicReference;
|
import java.util.concurrent.atomic.AtomicReference;
|
||||||
|
|
||||||
public class rusEFIVersion {
|
public class rusEFIVersion {
|
||||||
public static final int CONSOLE_VERSION = 20211007;
|
public static final int CONSOLE_VERSION = 20211010;
|
||||||
public static AtomicReference<String> firmwareVersion = new AtomicReference<>("N/A");
|
public static AtomicReference<String> firmwareVersion = new AtomicReference<>("N/A");
|
||||||
|
|
||||||
public static long classBuildTimeMillis() {
|
public static long classBuildTimeMillis() {
|
||||||
|
|
|
@ -198,7 +198,7 @@ public class RecentCommands {
|
||||||
getConfig().getRoot().setProperty(KEY, pack());
|
getConfig().getRoot().setProperty(KEY, pack());
|
||||||
}
|
}
|
||||||
|
|
||||||
private static boolean isBoringCommand(String command) {
|
public static boolean isBoringCommand(String command) {
|
||||||
return command.startsWith(getSetCommand(CMD_DATE));
|
return command.startsWith(getSetCommand(CMD_DATE));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -29,6 +29,7 @@ import java.util.function.Function;
|
||||||
/**
|
/**
|
||||||
* Date: 3/20/13
|
* Date: 3/20/13
|
||||||
* Andrey Belomutskiy, (c) 2013-2020
|
* Andrey Belomutskiy, (c) 2013-2020
|
||||||
|
* @see com.rusefi.CommandControl for hard-coded commands
|
||||||
*/
|
*/
|
||||||
public class AnyCommand {
|
public class AnyCommand {
|
||||||
private final static ThreadFactory THREAD_FACTORY = new NamedThreadFactory("AnyCommand");
|
private final static ThreadFactory THREAD_FACTORY = new NamedThreadFactory("AnyCommand");
|
||||||
|
@ -53,16 +54,11 @@ public class AnyCommand {
|
||||||
content.add(text);
|
content.add(text);
|
||||||
JButton go = new JButton("Go");
|
JButton go = new JButton("Go");
|
||||||
go.setContentAreaFilled(false);
|
go.setContentAreaFilled(false);
|
||||||
go.addActionListener(new ActionListener() {
|
go.addActionListener(e -> send());
|
||||||
@Override
|
|
||||||
public void actionPerformed(ActionEvent e) {
|
|
||||||
send();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
content.add(go);
|
content.add(go);
|
||||||
|
|
||||||
uiContext.getCommandQueue().addListener(command -> {
|
uiContext.getCommandQueue().addListener(command -> {
|
||||||
if (listenToCommands && !reentrant)
|
if (listenToCommands && !reentrant && RecentCommands.isBoringCommand(command))
|
||||||
text.setText(command);
|
text.setText(command);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue