mirror of
https://git.eden-emu.dev/eden-emu/eden.git
synced 2025-07-21 15:45:46 +00:00
yuzu: main: Register a callback for Exit
This commit is contained in:
parent
37e30e80ed
commit
85a103cf25
4 changed files with 17 additions and 0 deletions
|
@ -1384,6 +1384,9 @@ void GMainWindow::BootGame(const QString& filename, u64 program_id, std::size_t
|
|||
system.RegisterExecuteProgramCallback(
|
||||
[this](std::size_t program_index) { render_window->ExecuteProgram(program_index); });
|
||||
|
||||
// Register an Exit callback such that Core can exit the currently running application.
|
||||
system.RegisterExitCallback([this]() { render_window->Exit(); });
|
||||
|
||||
connect(render_window, &GRenderWindow::Closed, this, &GMainWindow::OnStopGame);
|
||||
connect(render_window, &GRenderWindow::MouseActivity, this, &GMainWindow::OnMouseActivity);
|
||||
// BlockingQueuedConnection is important here, it makes sure we've finished refreshing our views
|
||||
|
@ -2469,6 +2472,10 @@ void GMainWindow::OnExecuteProgram(std::size_t program_index) {
|
|||
BootGame(last_filename_booted, 0, program_index);
|
||||
}
|
||||
|
||||
void GMainWindow::OnExit() {
|
||||
OnStopGame();
|
||||
}
|
||||
|
||||
void GMainWindow::ErrorDisplayDisplayError(QString error_code, QString error_text) {
|
||||
OverlayDialog dialog(render_window, Core::System::GetInstance(), error_code, error_text,
|
||||
QString{}, tr("OK"), Qt::AlignLeft | Qt::AlignVCenter);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue