mirror of https://github.com/rusefi/rusefi.git
Too much of "Looks like another instance is already running." #5584
This commit is contained in:
parent
736db73c31
commit
51a7acdbb2
|
@ -6,7 +6,7 @@ import java.net.URL;
|
||||||
import java.util.concurrent.atomic.AtomicReference;
|
import java.util.concurrent.atomic.AtomicReference;
|
||||||
|
|
||||||
public interface rusEFIVersion {
|
public interface rusEFIVersion {
|
||||||
int CONSOLE_VERSION = 20230930;
|
int CONSOLE_VERSION = 20231007;
|
||||||
AtomicReference<String> firmwareVersion = new AtomicReference<>("N/A");
|
AtomicReference<String> firmwareVersion = new AtomicReference<>("N/A");
|
||||||
|
|
||||||
static long classBuildTimeMillis() {
|
static long classBuildTimeMillis() {
|
||||||
|
|
|
@ -74,6 +74,16 @@ public class UiUtils {
|
||||||
pauseButton.setText((isPaused ? RESUME.getMessage() : PAUSE.getMessage()) + suffix);
|
pauseButton.setText((isPaused ? RESUME.getMessage() : PAUSE.getMessage()) + suffix);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* problem: say we are downloading auto-update and remove progress bar window from front.
|
||||||
|
* Special considerations are required for a popup dialog to get to front of display
|
||||||
|
*/
|
||||||
|
public static JDialog createOnTopParent() {
|
||||||
|
JDialog dialog = new JDialog();
|
||||||
|
dialog.setAlwaysOnTop(true);
|
||||||
|
return dialog;
|
||||||
|
}
|
||||||
|
|
||||||
public static void centerWindow(Window w) {
|
public static void centerWindow(Window w) {
|
||||||
w.pack();
|
w.pack();
|
||||||
Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
|
Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
|
||||||
|
|
|
@ -33,6 +33,7 @@ import static com.devexperts.logging.Logging.getLogging;
|
||||||
import static com.rusefi.StartupFrame.setFrameIcon;
|
import static com.rusefi.StartupFrame.setFrameIcon;
|
||||||
import static com.rusefi.core.preferences.storage.PersistentConfiguration.getConfig;
|
import static com.rusefi.core.preferences.storage.PersistentConfiguration.getConfig;
|
||||||
import static com.rusefi.core.rusEFIVersion.CONSOLE_VERSION;
|
import static com.rusefi.core.rusEFIVersion.CONSOLE_VERSION;
|
||||||
|
import static com.rusefi.ui.util.UiUtils.createOnTopParent;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see StartupFrame
|
* @see StartupFrame
|
||||||
|
@ -205,7 +206,7 @@ public class ConsoleUI {
|
||||||
|
|
||||||
private static void awtCode(String[] args) {
|
private static void awtCode(String[] args) {
|
||||||
if (JustOneInstance.isAlreadyRunning()) {
|
if (JustOneInstance.isAlreadyRunning()) {
|
||||||
int result = JOptionPane.showConfirmDialog(null, "Looks like another instance is already running. Do you really want to start another instance?",
|
int result = JOptionPane.showConfirmDialog(createOnTopParent(), "Looks like another instance is already running. Do you really want to start another instance?",
|
||||||
"rusEfi", JOptionPane.YES_NO_OPTION);
|
"rusEfi", JOptionPane.YES_NO_OPTION);
|
||||||
if (result == JOptionPane.NO_OPTION)
|
if (result == JOptionPane.NO_OPTION)
|
||||||
System.exit(-1);
|
System.exit(-1);
|
||||||
|
|
Loading…
Reference in New Issue