From 19b2571aecfff680c7a414c505eafc26264b6f2f Mon Sep 17 00:00:00 2001 From: Zach Hilman Date: Sat, 17 Nov 2018 12:18:03 -0500 Subject: applet: Add operation completed callback --- src/yuzu/applets/software_keyboard.cpp | 14 +++++++++++++- src/yuzu/applets/software_keyboard.h | 5 ++++- 2 files changed, 17 insertions(+), 2 deletions(-) (limited to 'src/yuzu/applets') diff --git a/src/yuzu/applets/software_keyboard.cpp b/src/yuzu/applets/software_keyboard.cpp index 9fb179f5c..83b9c320b 100644 --- a/src/yuzu/applets/software_keyboard.cpp +++ b/src/yuzu/applets/software_keyboard.cpp @@ -3,11 +3,13 @@ // Refer to the license.txt file included. #include +#include #include #include #include #include #include +#include "core/hle/lock.h" #include "yuzu/applets/software_keyboard.h" #include "yuzu/main.h" @@ -122,10 +124,20 @@ void QtSoftwareKeyboard::RequestText(std::function finished_check) const { + this->finished_check = finished_check; emit MainWindowTextCheckDialog(error_message); } void QtSoftwareKeyboard::MainWindowFinishedText(std::optional text) { + // Acquire the HLE mutex + std::lock_guard lock(HLE::g_hle_lock); text_output(text); } + +void QtSoftwareKeyboard::MainWindowFinishedCheckDialog() { + // Acquire the HLE mutex + std::lock_guard lock(HLE::g_hle_lock); + finished_check(); +} diff --git a/src/yuzu/applets/software_keyboard.h b/src/yuzu/applets/software_keyboard.h index 670b05dc9..8d56f5db2 100644 --- a/src/yuzu/applets/software_keyboard.h +++ b/src/yuzu/applets/software_keyboard.h @@ -62,7 +62,8 @@ public: void RequestText(std::function)> out, Core::Frontend::SoftwareKeyboardParameters parameters) const override; - void SendTextCheckDialog(std::u16string error_message) const override; + void SendTextCheckDialog(std::u16string error_message, + std::function finished_check) const override; signals: void MainWindowGetText(Core::Frontend::SoftwareKeyboardParameters parameters) const; @@ -70,7 +71,9 @@ signals: public slots: void MainWindowFinishedText(std::optional text); + void MainWindowFinishedCheckDialog(); private: mutable std::function)> text_output; + mutable std::function finished_check; }; -- cgit v1.2.3