mirror of
https://github.com/badvision/jace.git
synced 2025-02-19 21:30:34 +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 java.io.IOException;
|
||||||
import javafx.application.Application;
|
import javafx.application.Application;
|
||||||
|
import javafx.application.Platform;
|
||||||
import javafx.fxml.FXMLLoader;
|
import javafx.fxml.FXMLLoader;
|
||||||
import javafx.scene.Parent;
|
|
||||||
import javafx.scene.Scene;
|
import javafx.scene.Scene;
|
||||||
import javafx.scene.layout.AnchorPane;
|
import javafx.scene.layout.AnchorPane;
|
||||||
import javafx.stage.Stage;
|
import javafx.stage.Stage;
|
||||||
@ -46,8 +46,13 @@ public class JaceApplication extends Application {
|
|||||||
}
|
}
|
||||||
controller.connectComputer(Emulator.computer);
|
controller.connectComputer(Emulator.computer);
|
||||||
});
|
});
|
||||||
|
primaryStage.setOnCloseRequest(value -> {
|
||||||
|
Emulator.computer.deactivate();
|
||||||
|
Platform.exit();
|
||||||
|
System.exit(0);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param args the command line arguments
|
* @param args the command line arguments
|
||||||
*/
|
*/
|
||||||
|
@ -104,6 +104,12 @@ public abstract class Computer implements Reconfigurable {
|
|||||||
memory.loadRom(path);
|
memory.loadRom(path);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void deactivate() {
|
||||||
|
cpu.suspend();
|
||||||
|
motherboard.suspend();
|
||||||
|
video.suspend();
|
||||||
|
}
|
||||||
|
|
||||||
@InvokableAction(
|
@InvokableAction(
|
||||||
name = "Cold boot",
|
name = "Cold boot",
|
||||||
description = "Process startup sequence from power-up",
|
description = "Process startup sequence from power-up",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user