From e696ed1f4d20f28f8b26c637498962938df7d96f Mon Sep 17 00:00:00 2001 From: Zach Hilman Date: Sun, 11 Nov 2018 16:39:25 -0500 Subject: am: Deglobalize software keyboard applet --- src/yuzu/applets/software_keyboard.h | 33 +++++++++++++++++++-------------- 1 file changed, 19 insertions(+), 14 deletions(-) (limited to 'src/yuzu/applets/software_keyboard.h') diff --git a/src/yuzu/applets/software_keyboard.h b/src/yuzu/applets/software_keyboard.h index 2a18419db..1069c10ec 100644 --- a/src/yuzu/applets/software_keyboard.h +++ b/src/yuzu/applets/software_keyboard.h @@ -3,11 +3,13 @@ // Refer to the license.txt file included. #pragma once + #include #include #include "common/assert.h" #include "core/frontend/applets/software_keyboard.h" +class GMainWindow; class QDialogButtonBox; class QLabel; class QLineEdit; @@ -16,11 +18,11 @@ class QtSoftwareKeyboard; class QtSoftwareKeyboardValidator final : public QValidator { public: - explicit QtSoftwareKeyboardValidator(Frontend::SoftwareKeyboardApplet::Parameters parameters); - State validate(QString&, int&) const override; + explicit QtSoftwareKeyboardValidator(Core::Frontend::SoftwareKeyboardParameters parameters); + State validate(QString& input, int& pos) const override; private: - Frontend::SoftwareKeyboardApplet::Parameters parameters; + Core::Frontend::SoftwareKeyboardParameters parameters; }; class QtSoftwareKeyboardDialog final : public QDialog { @@ -28,10 +30,15 @@ class QtSoftwareKeyboardDialog final : public QDialog { public: QtSoftwareKeyboardDialog(QWidget* parent, - Frontend::SoftwareKeyboardApplet::Parameters parameters); + Core::Frontend::SoftwareKeyboardParameters parameters); + ~QtSoftwareKeyboardDialog() override; + void Submit(); void Reject(); + std::u16string GetText(); + bool GetStatus(); + private: bool ok = false; std::u16string text; @@ -43,20 +50,18 @@ private: QLineEdit* line_edit; QVBoxLayout* layout; - Frontend::SoftwareKeyboardApplet::Parameters parameters; - - friend class QtSoftwareKeyboard; + Core::Frontend::SoftwareKeyboardParameters parameters; }; -class QtSoftwareKeyboard final : public QObject, public Frontend::SoftwareKeyboardApplet { +class QtSoftwareKeyboard final : public QObject, public Core::Frontend::SoftwareKeyboardApplet { public: - explicit QtSoftwareKeyboard(QWidget& parent); - bool GetText(Parameters parameters, std::u16string& text) override; + explicit QtSoftwareKeyboard(GMainWindow& parent); + ~QtSoftwareKeyboard() override; - ~QtSoftwareKeyboard() { - UNREACHABLE(); - } + bool GetText(Core::Frontend::SoftwareKeyboardParameters parameters, + std::u16string& text) const override; + void SendTextCheckDialog(std::u16string error_message) const override; private: - QWidget& parent; + GMainWindow& main_window; }; -- cgit v1.2.3