From 336fcbc50e89b357fa5b9e059961b4a0c00de59e Mon Sep 17 00:00:00 2001 From: frosch Date: Tue, 13 Nov 2012 21:46:40 +0000 Subject: [PATCH] (svn r24728) -Codechange: Unify usage of OnOSKInput. --- src/network/network_content_gui.cpp | 10 ++++++---- src/settings_gui.cpp | 14 ++++++++------ src/signs_gui.cpp | 4 +--- 3 files changed, 15 insertions(+), 13 deletions(-) diff --git a/src/network/network_content_gui.cpp b/src/network/network_content_gui.cpp index bb9ca07f00..ed4010d407 100644 --- a/src/network/network_content_gui.cpp +++ b/src/network/network_content_gui.cpp @@ -788,10 +788,12 @@ public: virtual void OnOSKInput(int wid) { - this->string_filter.SetFilterTerm(this->edit_str_buf); - this->content.SetFilterState(!this->string_filter.IsEmpty()); - this->content.ForceRebuild(); - this->InvalidateData(); + if (wid == WID_NCL_FILTER) { + this->string_filter.SetFilterTerm(this->edit_str_buf); + this->content.SetFilterState(!this->string_filter.IsEmpty()); + this->content.ForceRebuild(); + this->InvalidateData(); + } } virtual void OnResize() diff --git a/src/settings_gui.cpp b/src/settings_gui.cpp index 6d11042d3c..c74098ae58 100644 --- a/src/settings_gui.cpp +++ b/src/settings_gui.cpp @@ -2418,13 +2418,15 @@ struct GameSettingsWindow : QueryStringBaseWindow { virtual void OnOSKInput(int wid) { - string_filter.SetFilterTerm(this->edit_str_buf); - if (!string_filter.IsEmpty() && !this->manually_changed_folding) { - /* User never expanded/collapsed single pages and entered a filter term. - * Expand everything, to save weird expand clicks, */ - _settings_main_page.UnFoldAll(); + if (wid == WID_GS_FILTER) { + string_filter.SetFilterTerm(this->edit_str_buf); + if (!string_filter.IsEmpty() && !this->manually_changed_folding) { + /* User never expanded/collapsed single pages and entered a filter term. + * Expand everything, to save weird expand clicks, */ + _settings_main_page.UnFoldAll(); + } + this->InvalidateData(); } - this->InvalidateData(); } virtual void OnResize() diff --git a/src/signs_gui.cpp b/src/signs_gui.cpp index ba7e669c7d..3af7822664 100644 --- a/src/signs_gui.cpp +++ b/src/signs_gui.cpp @@ -298,7 +298,7 @@ struct SignListWindow : QueryStringBaseWindow, SignList { EventState state = ES_NOT_HANDLED; switch (this->HandleEditBoxKey(WID_SIL_FILTER_TEXT, key, keycode, state)) { case HEBR_EDITING: - this->SetFilterString(this->text.buf); + this->OnOSKInput(WID_SIL_FILTER_TEXT); break; case HEBR_CONFIRM: // Enter pressed -> goto first sign in list @@ -325,8 +325,6 @@ struct SignListWindow : QueryStringBaseWindow, SignList { NOT_REACHED(); } - if (state == ES_HANDLED) OnOSKInput(WID_SIL_FILTER_TEXT); - return state; }