From b54e3b7aa969c2e98f11babeaf23268ce1bbfbf1 Mon Sep 17 00:00:00 2001 From: zhupengfei Date: Tue, 17 Jul 2018 22:42:53 +0800 Subject: [PATCH] frontend/applets/swkbd: use system username --- src/core/frontend/applets/default_applets.cpp | 2 +- src/core/frontend/applets/swkbd.cpp | 11 +++++++---- src/core/frontend/applets/swkbd.h | 2 +- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/src/core/frontend/applets/default_applets.cpp b/src/core/frontend/applets/default_applets.cpp index 2f599b79c8..814b6381e0 100644 --- a/src/core/frontend/applets/default_applets.cpp +++ b/src/core/frontend/applets/default_applets.cpp @@ -7,6 +7,6 @@ namespace Frontend { void RegisterDefaultApplets() { - RegisterSoftwareKeyboard(std::make_shared()); + RegisterSoftwareKeyboard(std::make_shared()); } } // namespace Frontend diff --git a/src/core/frontend/applets/swkbd.cpp b/src/core/frontend/applets/swkbd.cpp index 324ebf7284..335d99d167 100644 --- a/src/core/frontend/applets/swkbd.cpp +++ b/src/core/frontend/applets/swkbd.cpp @@ -6,8 +6,10 @@ #include #include "common/assert.h" #include "common/logging/log.h" +#include "common/string_util.h" #include "core/core.h" #include "core/frontend/applets/swkbd.h" +#include "core/hle/service/cfg/cfg.h" namespace Frontend { @@ -130,18 +132,19 @@ ValidationError SoftwareKeyboard::Finalize(const std::string& text, u8 button) { data = {text, button}; } -void DefaultCitraKeyboard::Setup(const Frontend::KeyboardConfig* config) { +void DefaultKeyboard::Setup(const Frontend::KeyboardConfig* config) { SoftwareKeyboard::Setup(config); + std::string username = Common::UTF16ToUTF8(Service::CFG::GetCurrentModule()->GetUsername()); switch (this->config.button_config) { case ButtonConfig::None: case ButtonConfig::Single: - Finalize("Citra", 0); + Finalize(username, 0); break; case ButtonConfig::Dual: - Finalize("Citra", 1); + Finalize(username, 1); break; case ButtonConfig::Triple: - Finalize("Citra", 2); + Finalize(username, 2); break; default: UNREACHABLE(); diff --git a/src/core/frontend/applets/swkbd.h b/src/core/frontend/applets/swkbd.h index cadfb725a7..5c07eb12d6 100644 --- a/src/core/frontend/applets/swkbd.h +++ b/src/core/frontend/applets/swkbd.h @@ -119,7 +119,7 @@ protected: KeyboardData data; }; -class DefaultCitraKeyboard final : public SoftwareKeyboard { +class DefaultKeyboard final : public SoftwareKeyboard { public: void Setup(const KeyboardConfig* config) override; };