diff options
| author | 2021-03-26 06:07:27 -0400 | |
|---|---|---|
| committer | 2021-04-15 01:53:17 -0400 | |
| commit | b45930a0edbf762310f85fafa3724dc4766c2197 (patch) | |
| tree | d3b5c11a13b375560280c268013566e14ee2d8c5 /src | |
| parent | overlay_dialog: Add an overlay text dialog that accepts controller input (diff) | |
| download | yuzu-b45930a0edbf762310f85fafa3724dc4766c2197.tar.gz yuzu-b45930a0edbf762310f85fafa3724dc4766c2197.tar.xz yuzu-b45930a0edbf762310f85fafa3724dc4766c2197.zip | |
error: Make the error code as the title text of the OverlayDialog
Co-authored-by: Its-Rei <kupfel@gmail.com>
Diffstat (limited to '')
| -rw-r--r-- | src/yuzu/applets/error.cpp | 22 | ||||
| -rw-r--r-- | src/yuzu/applets/error.h | 2 | ||||
| -rw-r--r-- | src/yuzu/main.cpp | 6 | ||||
| -rw-r--r-- | src/yuzu/main.h | 2 |
4 files changed, 17 insertions, 15 deletions
diff --git a/src/yuzu/applets/error.cpp b/src/yuzu/applets/error.cpp index 8ee03ddb3..085688cd4 100644 --- a/src/yuzu/applets/error.cpp +++ b/src/yuzu/applets/error.cpp | |||
| @@ -19,11 +19,11 @@ QtErrorDisplay::~QtErrorDisplay() = default; | |||
| 19 | void QtErrorDisplay::ShowError(ResultCode error, std::function<void()> finished) const { | 19 | void QtErrorDisplay::ShowError(ResultCode error, std::function<void()> finished) const { |
| 20 | callback = std::move(finished); | 20 | callback = std::move(finished); |
| 21 | emit MainWindowDisplayError( | 21 | emit MainWindowDisplayError( |
| 22 | tr("An error has occurred.\nPlease try again or contact the developer of the " | 22 | tr("Error Code: %1-%2 (0x%3)") |
| 23 | "software.\n\nError Code: %1-%2 (0x%3)") | ||
| 24 | .arg(static_cast<u32>(error.module.Value()) + 2000, 4, 10, QChar::fromLatin1('0')) | 23 | .arg(static_cast<u32>(error.module.Value()) + 2000, 4, 10, QChar::fromLatin1('0')) |
| 25 | .arg(error.description, 4, 10, QChar::fromLatin1('0')) | 24 | .arg(error.description, 4, 10, QChar::fromLatin1('0')) |
| 26 | .arg(error.raw, 8, 16, QChar::fromLatin1('0'))); | 25 | .arg(error.raw, 8, 16, QChar::fromLatin1('0')), |
| 26 | tr("An error has occurred.\nPlease try again or contact the developer of the software.")); | ||
| 27 | } | 27 | } |
| 28 | 28 | ||
| 29 | void QtErrorDisplay::ShowErrorWithTimestamp(ResultCode error, std::chrono::seconds time, | 29 | void QtErrorDisplay::ShowErrorWithTimestamp(ResultCode error, std::chrono::seconds time, |
| @@ -32,13 +32,14 @@ void QtErrorDisplay::ShowErrorWithTimestamp(ResultCode error, std::chrono::secon | |||
| 32 | 32 | ||
| 33 | const QDateTime date_time = QDateTime::fromSecsSinceEpoch(time.count()); | 33 | const QDateTime date_time = QDateTime::fromSecsSinceEpoch(time.count()); |
| 34 | emit MainWindowDisplayError( | 34 | emit MainWindowDisplayError( |
| 35 | tr("An error occurred on %1 at %2.\nPlease try again or contact the " | 35 | tr("Error Code: %1-%2 (0x%3)") |
| 36 | "developer of the software.\n\nError Code: %3-%4 (0x%5)") | ||
| 37 | .arg(date_time.toString(QStringLiteral("dddd, MMMM d, yyyy"))) | ||
| 38 | .arg(date_time.toString(QStringLiteral("h:mm:ss A"))) | ||
| 39 | .arg(static_cast<u32>(error.module.Value()) + 2000, 4, 10, QChar::fromLatin1('0')) | 36 | .arg(static_cast<u32>(error.module.Value()) + 2000, 4, 10, QChar::fromLatin1('0')) |
| 40 | .arg(error.description, 4, 10, QChar::fromLatin1('0')) | 37 | .arg(error.description, 4, 10, QChar::fromLatin1('0')) |
| 41 | .arg(error.raw, 8, 16, QChar::fromLatin1('0'))); | 38 | .arg(error.raw, 8, 16, QChar::fromLatin1('0')), |
| 39 | tr("An error occurred on %1 at %2.\nPlease try again or contact the developer of the " | ||
| 40 | "software.") | ||
| 41 | .arg(date_time.toString(QStringLiteral("dddd, MMMM d, yyyy"))) | ||
| 42 | .arg(date_time.toString(QStringLiteral("h:mm:ss A")))); | ||
| 42 | } | 43 | } |
| 43 | 44 | ||
| 44 | void QtErrorDisplay::ShowCustomErrorText(ResultCode error, std::string dialog_text, | 45 | void QtErrorDisplay::ShowCustomErrorText(ResultCode error, std::string dialog_text, |
| @@ -46,10 +47,11 @@ void QtErrorDisplay::ShowCustomErrorText(ResultCode error, std::string dialog_te | |||
| 46 | std::function<void()> finished) const { | 47 | std::function<void()> finished) const { |
| 47 | callback = std::move(finished); | 48 | callback = std::move(finished); |
| 48 | emit MainWindowDisplayError( | 49 | emit MainWindowDisplayError( |
| 49 | tr("An error has occurred.\nError Code: %1-%2 (0x%3)\n\n%4\n\n%5") | 50 | tr("Error Code: %1-%2 (0x%3)") |
| 50 | .arg(static_cast<u32>(error.module.Value()) + 2000, 4, 10, QChar::fromLatin1('0')) | 51 | .arg(static_cast<u32>(error.module.Value()) + 2000, 4, 10, QChar::fromLatin1('0')) |
| 51 | .arg(error.description, 4, 10, QChar::fromLatin1('0')) | 52 | .arg(error.description, 4, 10, QChar::fromLatin1('0')) |
| 52 | .arg(error.raw, 8, 16, QChar::fromLatin1('0')) | 53 | .arg(error.raw, 8, 16, QChar::fromLatin1('0')), |
| 54 | tr("An error has occurred.\n\n%1\n\n%2") | ||
| 53 | .arg(QString::fromStdString(dialog_text)) | 55 | .arg(QString::fromStdString(dialog_text)) |
| 54 | .arg(QString::fromStdString(fullscreen_text))); | 56 | .arg(QString::fromStdString(fullscreen_text))); |
| 55 | } | 57 | } |
diff --git a/src/yuzu/applets/error.h b/src/yuzu/applets/error.h index b0932d895..8bd895a32 100644 --- a/src/yuzu/applets/error.h +++ b/src/yuzu/applets/error.h | |||
| @@ -24,7 +24,7 @@ public: | |||
| 24 | std::function<void()> finished) const override; | 24 | std::function<void()> finished) const override; |
| 25 | 25 | ||
| 26 | signals: | 26 | signals: |
| 27 | void MainWindowDisplayError(QString error) const; | 27 | void MainWindowDisplayError(QString error_code, QString error_text) const; |
| 28 | 28 | ||
| 29 | private: | 29 | private: |
| 30 | void MainWindowFinishedError(); | 30 | void MainWindowFinishedError(); |
diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp index 3d4558739..ce83dee27 100644 --- a/src/yuzu/main.cpp +++ b/src/yuzu/main.cpp | |||
| @@ -2266,9 +2266,9 @@ void GMainWindow::OnExecuteProgram(std::size_t program_index) { | |||
| 2266 | BootGame(last_filename_booted, program_index); | 2266 | BootGame(last_filename_booted, program_index); |
| 2267 | } | 2267 | } |
| 2268 | 2268 | ||
| 2269 | void GMainWindow::ErrorDisplayDisplayError(QString body) { | 2269 | void GMainWindow::ErrorDisplayDisplayError(QString error_code, QString error_text) { |
| 2270 | OverlayDialog dialog(render_window, Core::System::GetInstance(), body, QString{}, tr("OK"), | 2270 | OverlayDialog dialog(render_window, Core::System::GetInstance(), error_code, error_text, |
| 2271 | Qt::AlignLeft | Qt::AlignVCenter); | 2271 | QString{}, tr("OK"), Qt::AlignLeft | Qt::AlignVCenter); |
| 2272 | dialog.exec(); | 2272 | dialog.exec(); |
| 2273 | 2273 | ||
| 2274 | emit ErrorDisplayFinished(); | 2274 | emit ErrorDisplayFinished(); |
diff --git a/src/yuzu/main.h b/src/yuzu/main.h index d8849f85b..4c8a879d2 100644 --- a/src/yuzu/main.h +++ b/src/yuzu/main.h | |||
| @@ -143,7 +143,7 @@ public slots: | |||
| 143 | void OnExecuteProgram(std::size_t program_index); | 143 | void OnExecuteProgram(std::size_t program_index); |
| 144 | void ControllerSelectorReconfigureControllers( | 144 | void ControllerSelectorReconfigureControllers( |
| 145 | const Core::Frontend::ControllerParameters& parameters); | 145 | const Core::Frontend::ControllerParameters& parameters); |
| 146 | void ErrorDisplayDisplayError(QString body); | 146 | void ErrorDisplayDisplayError(QString error_code, QString error_text); |
| 147 | void ProfileSelectorSelectProfile(); | 147 | void ProfileSelectorSelectProfile(); |
| 148 | void WebBrowserOpenWebPage(std::string_view main_url, std::string_view additional_args, | 148 | void WebBrowserOpenWebPage(std::string_view main_url, std::string_view additional_args, |
| 149 | bool is_local); | 149 | bool is_local); |