From a1c0605cbe90e16fd5bd2477f50664002475cac2 Mon Sep 17 00:00:00 2001 From: Cacodemon345 Date: Wed, 2 Feb 2022 22:08:19 +0600 Subject: [PATCH] qt: Fix error strings --- src/qt/qt_platform.cpp | 3 ++- src/qt/qt_ui.cpp | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/qt/qt_platform.cpp b/src/qt/qt_platform.cpp index b210ab69d..d6f3c0c6d 100644 --- a/src/qt/qt_platform.cpp +++ b/src/qt/qt_platform.cpp @@ -105,7 +105,8 @@ int strnicmp(const char *s1, const char *s2, size_t n) void do_stop(void) { - QCoreApplication::quit(); + cpu_thread_run = 0; + //main_window->close(); } void plat_get_exe_name(char *s, int size) diff --git a/src/qt/qt_ui.cpp b/src/qt/qt_ui.cpp index 00d0c53f0..d45fb889b 100644 --- a/src/qt/qt_ui.cpp +++ b/src/qt/qt_ui.cpp @@ -13,6 +13,7 @@ MainWindow* main_window = nullptr; extern "C" { #include <86box/plat.h> +#include <86box/ui.h> void plat_delay_ms(uint32_t count) @@ -58,8 +59,8 @@ int ui_msgbox_header(int flags, void *header, void* message) { if (header <= (void*)7168) header = plat_get_string((uintptr_t)header); if (message <= (void*)7168) message = plat_get_string((uintptr_t)message); - auto hdr = QString::fromWCharArray(reinterpret_cast(header)); - auto msg = QString::fromWCharArray(reinterpret_cast(message)); + auto hdr = (flags & MBX_ANSI) ? QString((char*)header) : QString::fromWCharArray(reinterpret_cast(header)); + auto msg = (flags & MBX_ANSI) ? QString((char*)message) : QString::fromWCharArray(reinterpret_cast(message)); // any error in early init if (main_window == nullptr) {