mirror of https://github.com/rusefi/rusefi-1.git
"wrong bundle" warning text sometimes not visible #3267
This commit is contained in:
parent
cc381d111a
commit
2e12371e91
|
@ -32,16 +32,20 @@ public class DfuHelper {
|
||||||
if (!bundleName.equalsIgnoreCase(s.getBundle())) {
|
if (!bundleName.equalsIgnoreCase(s.getBundle())) {
|
||||||
String message = String.format("You have \"%s\" controller does not look right to program it with \"%s\"", s.getBundle(), bundleName);
|
String message = String.format("You have \"%s\" controller does not look right to program it with \"%s\"", s.getBundle(), bundleName);
|
||||||
FileLog.MAIN.logLine(message);
|
FileLog.MAIN.logLine(message);
|
||||||
JOptionPane.showMessageDialog(parent, message);
|
|
||||||
// in case of mismatched bundle type we are supposed do close connection
|
SwingUtilities.invokeLater(() -> {
|
||||||
// and properly handle the case of user hitting "Update Firmware" again
|
JOptionPane.showMessageDialog(parent, message);
|
||||||
// closing connection is a mess on Windows so it's simpler to just exit
|
// in case of mismatched bundle type we are supposed do close connection
|
||||||
new Thread(() -> {
|
// and properly handle the case of user hitting "Update Firmware" again
|
||||||
// let's have a delay and separate thread to address
|
// closing connection is a mess on Windows so it's simpler to just exit
|
||||||
// "wrong bundle" warning text sometimes not visible #3267
|
new Thread(() -> {
|
||||||
sleep(5 * SECOND);
|
// let's have a delay and separate thread to address
|
||||||
System.exit(-5);
|
// "wrong bundle" warning text sometimes not visible #3267
|
||||||
}).start();
|
sleep(5 * SECOND);
|
||||||
|
System.exit(-5);
|
||||||
|
}).start();
|
||||||
|
});
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue