diff options
| author | 2022-12-05 18:56:47 -0500 | |
|---|---|---|
| committer | 2022-12-05 19:06:04 -0500 | |
| commit | d8da9a2afdff6b3aa2f8c2ac80083353fcaab8b3 (patch) | |
| tree | 2d4961867fba4f10b6bc2a6695a660ef79cdd9d3 /src/core/frontend/applets | |
| parent | applets/mii_edit: Use aliases for callbacks (diff) | |
| download | yuzu-d8da9a2afdff6b3aa2f8c2ac80083353fcaab8b3.tar.gz yuzu-d8da9a2afdff6b3aa2f8c2ac80083353fcaab8b3.tar.xz yuzu-d8da9a2afdff6b3aa2f8c2ac80083353fcaab8b3.zip | |
applets/error: Use aliases for callbacks
Diffstat (limited to 'src/core/frontend/applets')
| -rw-r--r-- | src/core/frontend/applets/error.cpp | 6 | ||||
| -rw-r--r-- | src/core/frontend/applets/error.h | 14 |
2 files changed, 11 insertions, 9 deletions
diff --git a/src/core/frontend/applets/error.cpp b/src/core/frontend/applets/error.cpp index f8b961098..69c2b2b4d 100644 --- a/src/core/frontend/applets/error.cpp +++ b/src/core/frontend/applets/error.cpp | |||
| @@ -8,13 +8,13 @@ namespace Core::Frontend { | |||
| 8 | 8 | ||
| 9 | ErrorApplet::~ErrorApplet() = default; | 9 | ErrorApplet::~ErrorApplet() = default; |
| 10 | 10 | ||
| 11 | void DefaultErrorApplet::ShowError(Result error, std::function<void()> finished) const { | 11 | void DefaultErrorApplet::ShowError(Result error, FinishedCallback finished) const { |
| 12 | LOG_CRITICAL(Service_Fatal, "Application requested error display: {:04}-{:04} (raw={:08X})", | 12 | LOG_CRITICAL(Service_Fatal, "Application requested error display: {:04}-{:04} (raw={:08X})", |
| 13 | error.module.Value(), error.description.Value(), error.raw); | 13 | error.module.Value(), error.description.Value(), error.raw); |
| 14 | } | 14 | } |
| 15 | 15 | ||
| 16 | void DefaultErrorApplet::ShowErrorWithTimestamp(Result error, std::chrono::seconds time, | 16 | void DefaultErrorApplet::ShowErrorWithTimestamp(Result error, std::chrono::seconds time, |
| 17 | std::function<void()> finished) const { | 17 | FinishedCallback finished) const { |
| 18 | LOG_CRITICAL( | 18 | LOG_CRITICAL( |
| 19 | Service_Fatal, | 19 | Service_Fatal, |
| 20 | "Application requested error display: {:04X}-{:04X} (raw={:08X}) with timestamp={:016X}", | 20 | "Application requested error display: {:04X}-{:04X} (raw={:08X}) with timestamp={:016X}", |
| @@ -23,7 +23,7 @@ void DefaultErrorApplet::ShowErrorWithTimestamp(Result error, std::chrono::secon | |||
| 23 | 23 | ||
| 24 | void DefaultErrorApplet::ShowCustomErrorText(Result error, std::string main_text, | 24 | void DefaultErrorApplet::ShowCustomErrorText(Result error, std::string main_text, |
| 25 | std::string detail_text, | 25 | std::string detail_text, |
| 26 | std::function<void()> finished) const { | 26 | FinishedCallback finished) const { |
| 27 | LOG_CRITICAL(Service_Fatal, | 27 | LOG_CRITICAL(Service_Fatal, |
| 28 | "Application requested custom error with error_code={:04X}-{:04X} (raw={:08X})", | 28 | "Application requested custom error with error_code={:04X}-{:04X} (raw={:08X})", |
| 29 | error.module.Value(), error.description.Value(), error.raw); | 29 | error.module.Value(), error.description.Value(), error.raw); |
diff --git a/src/core/frontend/applets/error.h b/src/core/frontend/applets/error.h index f378f8805..884f2f653 100644 --- a/src/core/frontend/applets/error.h +++ b/src/core/frontend/applets/error.h | |||
| @@ -12,25 +12,27 @@ namespace Core::Frontend { | |||
| 12 | 12 | ||
| 13 | class ErrorApplet { | 13 | class ErrorApplet { |
| 14 | public: | 14 | public: |
| 15 | using FinishedCallback = std::function<void()>; | ||
| 16 | |||
| 15 | virtual ~ErrorApplet(); | 17 | virtual ~ErrorApplet(); |
| 16 | 18 | ||
| 17 | virtual void ShowError(Result error, std::function<void()> finished) const = 0; | 19 | virtual void ShowError(Result error, FinishedCallback finished) const = 0; |
| 18 | 20 | ||
| 19 | virtual void ShowErrorWithTimestamp(Result error, std::chrono::seconds time, | 21 | virtual void ShowErrorWithTimestamp(Result error, std::chrono::seconds time, |
| 20 | std::function<void()> finished) const = 0; | 22 | FinishedCallback finished) const = 0; |
| 21 | 23 | ||
| 22 | virtual void ShowCustomErrorText(Result error, std::string dialog_text, | 24 | virtual void ShowCustomErrorText(Result error, std::string dialog_text, |
| 23 | std::string fullscreen_text, | 25 | std::string fullscreen_text, |
| 24 | std::function<void()> finished) const = 0; | 26 | FinishedCallback finished) const = 0; |
| 25 | }; | 27 | }; |
| 26 | 28 | ||
| 27 | class DefaultErrorApplet final : public ErrorApplet { | 29 | class DefaultErrorApplet final : public ErrorApplet { |
| 28 | public: | 30 | public: |
| 29 | void ShowError(Result error, std::function<void()> finished) const override; | 31 | void ShowError(Result error, FinishedCallback finished) const override; |
| 30 | void ShowErrorWithTimestamp(Result error, std::chrono::seconds time, | 32 | void ShowErrorWithTimestamp(Result error, std::chrono::seconds time, |
| 31 | std::function<void()> finished) const override; | 33 | FinishedCallback finished) const override; |
| 32 | void ShowCustomErrorText(Result error, std::string main_text, std::string detail_text, | 34 | void ShowCustomErrorText(Result error, std::string main_text, std::string detail_text, |
| 33 | std::function<void()> finished) const override; | 35 | FinishedCallback finished) const override; |
| 34 | }; | 36 | }; |
| 35 | 37 | ||
| 36 | } // namespace Core::Frontend | 38 | } // namespace Core::Frontend |