From 7cfb29de23836aa1873bbb108e3d25a0e9dcfa6d Mon Sep 17 00:00:00 2001 From: Zach Hilman Date: Sun, 11 Nov 2018 20:16:38 -0500 Subject: am: Allow applets to push multiple and different channels of data --- src/yuzu/main.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'src/yuzu/main.cpp') diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp index 447d9dece..a11eb7f86 100644 --- a/src/yuzu/main.cpp +++ b/src/yuzu/main.cpp @@ -207,16 +207,18 @@ GMainWindow::~GMainWindow() { delete render_window; } -bool GMainWindow::SoftwareKeyboardGetText( - const Core::Frontend::SoftwareKeyboardParameters& parameters, std::u16string& text) { +std::optional GMainWindow::SoftwareKeyboardGetText( + const Core::Frontend::SoftwareKeyboardParameters& parameters) { 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(); + if (!dialog.GetStatus()) + return std::nullopt; + + return dialog.GetText(); } void GMainWindow::SoftwareKeyboardInvokeCheckDialog(std::u16string error_message) { @@ -1251,10 +1253,10 @@ void GMainWindow::OnStartGame() { emu_thread->SetRunning(true); qRegisterMetaType( - "core::Frontend::SoftwareKeyboardParameters"); + "Core::Frontend::SoftwareKeyboardParameters"); qRegisterMetaType("Core::System::ResultStatus"); qRegisterMetaType("std::string"); - qRegisterMetaType("std::u16string"); + qRegisterMetaType>("std::optional"); connect(emu_thread.get(), &EmuThread::ErrorThrown, this, &GMainWindow::OnCoreError); -- cgit v1.2.3