diff options
author | Zach Hilman <zachhilman@gmail.com> | 2018-11-17 12:18:03 -0500 |
---|---|---|
committer | Zach Hilman <zachhilman@gmail.com> | 2018-11-18 10:53:47 -0500 |
commit | 19b2571aecfff680c7a414c505eafc26264b6f2f (patch) | |
tree | 1f9725a2acbf98647f981496aaf758de1a5008ca /src/yuzu/applets/software_keyboard.cpp | |
parent | 6209fe0c27a5557c20ff6350a94f6e074e0285dc (diff) |
applet: Add operation completed callback
Diffstat (limited to 'src/yuzu/applets/software_keyboard.cpp')
-rw-r--r-- | src/yuzu/applets/software_keyboard.cpp | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/yuzu/applets/software_keyboard.cpp b/src/yuzu/applets/software_keyboard.cpp index 9fb179f5c0..83b9c320be 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 <algorithm> +#include <mutex> #include <QDialogButtonBox> #include <QFont> #include <QLabel> #include <QLineEdit> #include <QVBoxLayout> +#include "core/hle/lock.h" #include "yuzu/applets/software_keyboard.h" #include "yuzu/main.h" @@ -122,10 +124,20 @@ void QtSoftwareKeyboard::RequestText(std::function<void(std::optional<std::u16st emit MainWindowGetText(parameters); } -void QtSoftwareKeyboard::SendTextCheckDialog(std::u16string error_message) const { +void QtSoftwareKeyboard::SendTextCheckDialog(std::u16string error_message, + std::function<void()> finished_check) const { + this->finished_check = finished_check; emit MainWindowTextCheckDialog(error_message); } void QtSoftwareKeyboard::MainWindowFinishedText(std::optional<std::u16string> text) { + // Acquire the HLE mutex + std::lock_guard<std::recursive_mutex> lock(HLE::g_hle_lock); text_output(text); } + +void QtSoftwareKeyboard::MainWindowFinishedCheckDialog() { + // Acquire the HLE mutex + std::lock_guard<std::recursive_mutex> lock(HLE::g_hle_lock); + finished_check(); +} |