diff options
author | Lioncash <mathew1800@gmail.com> | 2021-01-03 13:18:02 -0500 |
---|---|---|
committer | Lioncash <mathew1800@gmail.com> | 2021-01-03 13:18:04 -0500 |
commit | 86592b274e228708cf0f9e1f4063e917f1bb3bd5 (patch) | |
tree | 5b18fb291f5655be3b6e9495efc7c7410b0bbfd8 | |
parent | 71e18dddbe14464160ac2d90e42d8b41da3d2e21 (diff) |
main: Resolve error string not displaying
During the transition to make the error dialog translatable, I
accidentally got rid of the conversion to ResultStatus, which prevented
operator<< from being invoked during formatting.
This adds a function to directly retrieve the result status string
instead so that it displays again.
-rw-r--r-- | src/core/loader/loader.cpp | 4 | ||||
-rw-r--r-- | src/core/loader/loader.h | 1 | ||||
-rw-r--r-- | src/yuzu/main.cpp | 5 |
3 files changed, 8 insertions, 2 deletions
diff --git a/src/core/loader/loader.cpp b/src/core/loader/loader.cpp index d91c15561..e4f5fd40c 100644 --- a/src/core/loader/loader.cpp +++ b/src/core/loader/loader.cpp @@ -185,6 +185,10 @@ constexpr std::array<const char*, 66> RESULT_MESSAGES{ "The INI file contains more than the maximum allowable number of KIP files.", }; +std::string GetResultStatusString(ResultStatus status) { + return RESULT_MESSAGES.at(static_cast<std::size_t>(status)); +} + std::ostream& operator<<(std::ostream& os, ResultStatus status) { os << RESULT_MESSAGES.at(static_cast<std::size_t>(status)); return os; diff --git a/src/core/loader/loader.h b/src/core/loader/loader.h index 36e79e71d..b2e5b13de 100644 --- a/src/core/loader/loader.h +++ b/src/core/loader/loader.h @@ -135,6 +135,7 @@ enum class ResultStatus : u16 { ErrorINITooManyKIPs, }; +std::string GetResultStatusString(ResultStatus status); std::ostream& operator<<(std::ostream& os, ResultStatus status); /// Interface for loading an application diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp index 43d64b708..d1c539b72 100644 --- a/src/yuzu/main.cpp +++ b/src/yuzu/main.cpp @@ -1058,8 +1058,9 @@ bool GMainWindow::LoadROM(const QString& filename, std::size_t program_index) { tr("%1<br>Please follow <a href='https://yuzu-emu.org/help/quickstart/'>the " "yuzu quickstart guide</a> to redump your files.<br>You can refer " "to the yuzu wiki</a> or the yuzu Discord</a> for help.", - "%1 signifies a numeric error ID.") - .arg(error_id); + "%1 signifies an error string.") + .arg(QString::fromStdString( + GetResultStatusString(static_cast<Loader::ResultStatus>(error_id)))); QMessageBox::critical(this, title, description); } else { |