Close the main window after ACPI/APM shutdown
This commit is contained in:
@@ -270,7 +270,7 @@ MainWindow::MainWindow(QWidget *parent) :
|
|||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::closeEvent(QCloseEvent *event) {
|
void MainWindow::closeEvent(QCloseEvent *event) {
|
||||||
if (confirm_exit)
|
if (confirm_exit && cpu_thread_run)
|
||||||
{
|
{
|
||||||
QMessageBox questionbox(QMessageBox::Icon::Question, "86Box", "Are you sure you want to exit 86Box?", QMessageBox::Yes | QMessageBox::No, this);
|
QMessageBox questionbox(QMessageBox::Icon::Question, "86Box", "Are you sure you want to exit 86Box?", QMessageBox::Yes | QMessageBox::No, this);
|
||||||
QCheckBox *chkbox = new QCheckBox("Do not ask me again");
|
QCheckBox *chkbox = new QCheckBox("Do not ask me again");
|
||||||
|
|||||||
@@ -16,12 +16,15 @@
|
|||||||
#include <QLibrary>
|
#include <QLibrary>
|
||||||
#include <QElapsedTimer>
|
#include <QElapsedTimer>
|
||||||
|
|
||||||
|
#include "qt_mainwindow.hpp"
|
||||||
|
|
||||||
#ifdef Q_OS_UNIX
|
#ifdef Q_OS_UNIX
|
||||||
#include <sys/mman.h>
|
#include <sys/mman.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// static QByteArray buf;
|
// static QByteArray buf;
|
||||||
extern QElapsedTimer elapsed_timer;
|
extern QElapsedTimer elapsed_timer;
|
||||||
|
extern MainWindow* main_window;
|
||||||
QElapsedTimer elapsed_timer;
|
QElapsedTimer elapsed_timer;
|
||||||
|
|
||||||
static std::atomic_int blitmx_contention = 0;
|
static std::atomic_int blitmx_contention = 0;
|
||||||
@@ -355,6 +358,7 @@ plat_power_off(void)
|
|||||||
cycles -= 99999999;
|
cycles -= 99999999;
|
||||||
|
|
||||||
cpu_thread_run = 0;
|
cpu_thread_run = 0;
|
||||||
|
main_window->close();
|
||||||
}
|
}
|
||||||
|
|
||||||
void set_language(uint32_t id) {
|
void set_language(uint32_t id) {
|
||||||
|
|||||||
Reference in New Issue
Block a user