diff options
author | Morph <39850852+Morph1984@users.noreply.github.com> | 2021-03-26 11:07:27 +0100 |
---|---|---|
committer | Morph <39850852+Morph1984@users.noreply.github.com> | 2021-04-15 07:53:17 +0200 |
commit | b45930a0edbf762310f85fafa3724dc4766c2197 (patch) | |
tree | d3b5c11a13b375560280c268013566e14ee2d8c5 /src | |
parent | overlay_dialog: Add an overlay text dialog that accepts controller input (diff) | |
download | yuzu-b45930a0edbf762310f85fafa3724dc4766c2197.tar yuzu-b45930a0edbf762310f85fafa3724dc4766c2197.tar.gz yuzu-b45930a0edbf762310f85fafa3724dc4766c2197.tar.bz2 yuzu-b45930a0edbf762310f85fafa3724dc4766c2197.tar.lz yuzu-b45930a0edbf762310f85fafa3724dc4766c2197.tar.xz yuzu-b45930a0edbf762310f85fafa3724dc4766c2197.tar.zst yuzu-b45930a0edbf762310f85fafa3724dc4766c2197.zip |
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; void QtErrorDisplay::ShowError(ResultCode error, std::function<void()> finished) const { callback = std::move(finished); emit MainWindowDisplayError( - tr("An error has occurred.\nPlease try again or contact the developer of the " - "software.\n\nError Code: %1-%2 (0x%3)") + tr("Error Code: %1-%2 (0x%3)") .arg(static_cast<u32>(error.module.Value()) + 2000, 4, 10, QChar::fromLatin1('0')) .arg(error.description, 4, 10, QChar::fromLatin1('0')) - .arg(error.raw, 8, 16, QChar::fromLatin1('0'))); + .arg(error.raw, 8, 16, QChar::fromLatin1('0')), + tr("An error has occurred.\nPlease try again or contact the developer of the software.")); } void QtErrorDisplay::ShowErrorWithTimestamp(ResultCode error, std::chrono::seconds time, @@ -32,13 +32,14 @@ void QtErrorDisplay::ShowErrorWithTimestamp(ResultCode error, std::chrono::secon const QDateTime date_time = QDateTime::fromSecsSinceEpoch(time.count()); emit MainWindowDisplayError( - tr("An error occurred on %1 at %2.\nPlease try again or contact the " - "developer of the software.\n\nError Code: %3-%4 (0x%5)") - .arg(date_time.toString(QStringLiteral("dddd, MMMM d, yyyy"))) - .arg(date_time.toString(QStringLiteral("h:mm:ss A"))) + tr("Error Code: %1-%2 (0x%3)") .arg(static_cast<u32>(error.module.Value()) + 2000, 4, 10, QChar::fromLatin1('0')) .arg(error.description, 4, 10, QChar::fromLatin1('0')) - .arg(error.raw, 8, 16, QChar::fromLatin1('0'))); + .arg(error.raw, 8, 16, QChar::fromLatin1('0')), + tr("An error occurred on %1 at %2.\nPlease try again or contact the developer of the " + "software.") + .arg(date_time.toString(QStringLiteral("dddd, MMMM d, yyyy"))) + .arg(date_time.toString(QStringLiteral("h:mm:ss A")))); } void QtErrorDisplay::ShowCustomErrorText(ResultCode error, std::string dialog_text, @@ -46,10 +47,11 @@ void QtErrorDisplay::ShowCustomErrorText(ResultCode error, std::string dialog_te std::function<void()> finished) const { callback = std::move(finished); emit MainWindowDisplayError( - tr("An error has occurred.\nError Code: %1-%2 (0x%3)\n\n%4\n\n%5") + tr("Error Code: %1-%2 (0x%3)") .arg(static_cast<u32>(error.module.Value()) + 2000, 4, 10, QChar::fromLatin1('0')) .arg(error.description, 4, 10, QChar::fromLatin1('0')) - .arg(error.raw, 8, 16, QChar::fromLatin1('0')) + .arg(error.raw, 8, 16, QChar::fromLatin1('0')), + tr("An error has occurred.\n\n%1\n\n%2") .arg(QString::fromStdString(dialog_text)) .arg(QString::fromStdString(fullscreen_text))); } 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: std::function<void()> finished) const override; signals: - void MainWindowDisplayError(QString error) const; + void MainWindowDisplayError(QString error_code, QString error_text) const; private: 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) { BootGame(last_filename_booted, program_index); } -void GMainWindow::ErrorDisplayDisplayError(QString body) { - OverlayDialog dialog(render_window, Core::System::GetInstance(), body, QString{}, tr("OK"), - Qt::AlignLeft | Qt::AlignVCenter); +void GMainWindow::ErrorDisplayDisplayError(QString error_code, QString error_text) { + OverlayDialog dialog(render_window, Core::System::GetInstance(), error_code, error_text, + QString{}, tr("OK"), Qt::AlignLeft | Qt::AlignVCenter); dialog.exec(); 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: void OnExecuteProgram(std::size_t program_index); void ControllerSelectorReconfigureControllers( const Core::Frontend::ControllerParameters& parameters); - void ErrorDisplayDisplayError(QString body); + void ErrorDisplayDisplayError(QString error_code, QString error_text); void ProfileSelectorSelectProfile(); void WebBrowserOpenWebPage(std::string_view main_url, std::string_view additional_args, bool is_local); |