diff options
author | Zach Hilman <zachhilman@gmail.com> | 2018-11-11 16:41:31 -0500 |
---|---|---|
committer | Zach Hilman <zachhilman@gmail.com> | 2018-11-18 10:53:47 -0500 |
commit | fed6ab14c37f196f2a2fd378b46d7e5bd0118224 (patch) | |
tree | 9e199e88df8e5a35e1f18d7a2f2ca29373d90367 /src/yuzu/main.cpp | |
parent | e696ed1f4d20f28f8b26c637498962938df7d96f (diff) |
am: Implement text check software keyboard mode
Allows the game to verify and send a message to the frontend.
Diffstat (limited to 'src/yuzu/main.cpp')
-rw-r--r-- | src/yuzu/main.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp index 9b2c09f324..447d9dece8 100644 --- a/src/yuzu/main.cpp +++ b/src/yuzu/main.cpp @@ -61,6 +61,7 @@ static FileSys::VirtualFile VfsDirectoryCreateFileWrapper(const FileSys::Virtual #include "core/file_sys/romfs.h" #include "core/file_sys/savedata_factory.h" #include "core/file_sys/submission_package.h" +#include "core/frontend/applets/software_keyboard.h" #include "core/hle/kernel/process.h" #include "core/hle/service/filesystem/filesystem.h" #include "core/hle/service/filesystem/fsp_ldr.h" @@ -206,6 +207,22 @@ GMainWindow::~GMainWindow() { delete render_window; } +bool GMainWindow::SoftwareKeyboardGetText( + const Core::Frontend::SoftwareKeyboardParameters& parameters, std::u16string& text) { + QtSoftwareKeyboardDialog dialog(this, parameters); + dialog.setWindowFlags(Qt::Dialog | Qt::CustomizeWindowHint | Qt::WindowTitleHint | + Qt::WindowSystemMenuHint | Qt::WindowCloseButtonHint); + dialog.setWindowModality(Qt::WindowModal); + dialog.exec(); + + text = dialog.GetText(); + return dialog.GetStatus(); +} + +void GMainWindow::SoftwareKeyboardInvokeCheckDialog(std::u16string error_message) { + QMessageBox::warning(this, tr("Text Check Failed"), QString::fromStdU16String(error_message)); +} + void GMainWindow::InitializeWidgets() { #ifdef YUZU_ENABLE_COMPATIBILITY_REPORTING ui.action_Report_Compatibility->setVisible(true); |