From f28bc28d6b2f52b95aa810e5009ba75f0c0814c9 Mon Sep 17 00:00:00 2001 From: zhupengfei Date: Mon, 27 Aug 2018 22:37:26 +0800 Subject: [PATCH] core, citra_qt: unify status of system archives and shared fonts Shared fonts is no different from any other system archives, and there is not really any point to make a separate status for it. This also fixes the incorrect error message that was introduced when I made the UI text improvements. --- src/citra_qt/main.cpp | 29 +++++++++-------------------- src/core/core.h | 1 - src/core/hle/service/apt/apt.cpp | 3 ++- 3 files changed, 11 insertions(+), 22 deletions(-) diff --git a/src/citra_qt/main.cpp b/src/citra_qt/main.cpp index 8ccc7c252..c0a75292e 100644 --- a/src/citra_qt/main.cpp +++ b/src/citra_qt/main.cpp @@ -1407,14 +1407,15 @@ void GMainWindow::UpdateStatusBar() { void GMainWindow::OnCoreError(Core::System::ResultStatus result, std::string details) { QMessageBox::StandardButton answer; QString status_message; - const QString common_message = - tr("%1 is missing. Please dump your " - "system archives.
Continuing emulation may result in crashes and bugs."); + QString title, message; - switch (result) { - case Core::System::ResultStatus::ErrorSystemFiles: { + if (result == Core::System::ResultStatus::ErrorSystemFiles) { + const QString common_message = + tr("%1 is missing. Please dump your " + "system archives.
Continuing emulation may result in crashes and bugs."); + if (!details.empty()) { message = common_message.arg(QString::fromStdString(details)); } else { @@ -1423,18 +1424,7 @@ void GMainWindow::OnCoreError(Core::System::ResultStatus result, std::string det title = tr("System Archive Not Found"); status_message = "System Archive Missing"; - break; - } - - case Core::System::ResultStatus::ErrorSharedFont: { - message = tr("Shared fonts not found. "); - message.append(common_message); - title = tr("Shared Fonts Not Found"); - status_message = "Shared Font Missing"; - break; - } - - default: + } else { title = tr("Fatal Error"); message = tr("A fatal error occured. " @@ -1442,7 +1432,6 @@ void GMainWindow::OnCoreError(Core::System::ResultStatus result, std::string det "the log for details." "
Continuing emulation may result in crashes and bugs."); status_message = "Fatal Error encountered"; - break; } QMessageBox message_box; diff --git a/src/core/core.h b/src/core/core.h index f9e5aac8f..b4f3408f3 100644 --- a/src/core/core.h +++ b/src/core/core.h @@ -50,7 +50,6 @@ public: ErrorLoader_ErrorInvalidFormat, ///< Error loading the specified application due to an /// invalid format ErrorSystemFiles, ///< Error in finding system files - ErrorSharedFont, ///< Error in finding shared font ErrorVideoCore, ///< Error in the video core ErrorVideoCore_ErrorGenericDrivers, ///< Error in the video core due to the user having /// generic drivers installed diff --git a/src/core/hle/service/apt/apt.cpp b/src/core/hle/service/apt/apt.cpp index edda8f9c9..cca5c16da 100644 --- a/src/core/hle/service/apt/apt.cpp +++ b/src/core/hle/service/apt/apt.cpp @@ -204,7 +204,8 @@ void Module::Interface::GetSharedFont(Kernel::HLERequestContext& ctx) { rb.Push(-1); // TODO: Find the right error code rb.Push(0); rb.PushCopyObjects(nullptr); - Core::System::GetInstance().SetStatus(Core::System::ResultStatus::ErrorSharedFont); + Core::System::GetInstance().SetStatus(Core::System::ResultStatus::ErrorSystemFiles, + "Shared fonts"); return; } }