mirror of
https://github.com/badvision/jace.git
synced 2025-02-17 08:30:53 +00:00
Closing main window shuts down computer and exits app properly now.
This commit is contained in:
parent
ebed2a7c52
commit
d5b0e10add
@ -8,8 +8,8 @@ package jace;
|
||||
|
||||
import java.io.IOException;
|
||||
import javafx.application.Application;
|
||||
import javafx.application.Platform;
|
||||
import javafx.fxml.FXMLLoader;
|
||||
import javafx.scene.Parent;
|
||||
import javafx.scene.Scene;
|
||||
import javafx.scene.layout.AnchorPane;
|
||||
import javafx.stage.Stage;
|
||||
@ -46,8 +46,13 @@ public class JaceApplication extends Application {
|
||||
}
|
||||
controller.connectComputer(Emulator.computer);
|
||||
});
|
||||
primaryStage.setOnCloseRequest(value -> {
|
||||
Emulator.computer.deactivate();
|
||||
Platform.exit();
|
||||
System.exit(0);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param args the command line arguments
|
||||
*/
|
||||
|
@ -104,6 +104,12 @@ public abstract class Computer implements Reconfigurable {
|
||||
memory.loadRom(path);
|
||||
}
|
||||
|
||||
public void deactivate() {
|
||||
cpu.suspend();
|
||||
motherboard.suspend();
|
||||
video.suspend();
|
||||
}
|
||||
|
||||
@InvokableAction(
|
||||
name = "Cold boot",
|
||||
description = "Process startup sequence from power-up",
|
||||
|
Loading…
x
Reference in New Issue
Block a user