Permalink
Browse files

Fix space stripping in a few more string input methods. Helps #9795

  • Loading branch information...
hrydgard committed Aug 8, 2017
1 parent 8ba5d7e commit ec7e6342151e9303eeafcf54ba79cfb4c8f757e1
Showing with 5 additions and 4 deletions.
  1. +4 −3 UI/GameSettingsScreen.cpp
  2. +1 −1 ext/native/ui/ui_screen.cpp
@@ -1100,7 +1100,7 @@ UI::EventReturn GameSettingsScreen::OnChangeNickname(UI::EventParams &e) {
memset(name, 0, sizeof(name));
if (System_InputBoxGetString("Enter a new PSP nickname", g_Config.sNickName.c_str(), name, name_len)) {
g_Config.sNickName = name;
g_Config.sNickName = StripSpaces(name);
}
#elif defined(__ANDROID__)
System_SendMessage("inputbox", ("nickname:" + g_Config.sNickName).c_str());
@@ -1117,7 +1117,8 @@ UI::EventReturn GameSettingsScreen::OnChangeproAdhocServerAddress(UI::EventParam
memset(name, 0, sizeof(name));
if (System_InputBoxGetString("Enter an IP address", g_Config.proAdhocServer.c_str(), name, name_len)) {
g_Config.proAdhocServer = StripSpaces(name);
std::string stripped = StripSpaces(name);
g_Config.proAdhocServer = stripped;
}
}
else
@@ -1498,7 +1499,7 @@ UI::EventReturn ProAdhocServerScreen::OnDeleteAllClick(UI::EventParams &e) {
}
UI::EventReturn ProAdhocServerScreen::OnOKClick(UI::EventParams &e) {
g_Config.proAdhocServer = tempProAdhocServer;
g_Config.proAdhocServer = StripSpaces(tempProAdhocServer);
UIScreen::OnBack(e);
return UI::EVENT_DONE;
}
@@ -804,7 +804,7 @@ void TextEditPopupScreen::CreatePopupContents(UI::ViewGroup *parent) {
void TextEditPopupScreen::OnCompleted(DialogResult result) {
if (result == DR_OK) {
*value_ = edit_->GetText();
*value_ = StripSpaces(edit_->GetText());
EventParams e{};
e.v = edit_;
OnChange.Trigger(e);

0 comments on commit ec7e634

Please sign in to comment.