mirror of
https://github.com/RGBCube/serenity
synced 2025-07-28 19:07:35 +00:00
Userland: Replace manual checking by using GUI::InputType::NonemptyText
Do this where we were already checking if the input was empty after the InputBox was submitted. Those places gain interactive input validation. :^)
This commit is contained in:
parent
55dbfd24c0
commit
8095d9276b
9 changed files with 13 additions and 14 deletions
|
@ -438,7 +438,7 @@ void BrowserWindow::build_menus()
|
|||
|
||||
auto custom_user_agent = GUI::Action::create_checkable("Custom...", [this](auto& action) {
|
||||
DeprecatedString user_agent;
|
||||
if (GUI::InputBox::show(this, user_agent, "Enter User Agent:"sv, "Custom User Agent"sv) != GUI::InputBox::ExecResult::OK || user_agent.is_empty() || user_agent.is_null()) {
|
||||
if (GUI::InputBox::show(this, user_agent, "Enter User Agent:"sv, "Custom User Agent"sv, {}, GUI::InputType::NonemptyText) != GUI::InputBox::ExecResult::OK) {
|
||||
m_disable_user_agent_spoofing->activate();
|
||||
return;
|
||||
}
|
||||
|
@ -529,7 +529,7 @@ ErrorOr<void> BrowserWindow::load_search_engines(GUI::Menu& settings_menu)
|
|||
|
||||
auto custom_search_engine_action = GUI::Action::create_checkable("Custom...", [&](auto& action) {
|
||||
DeprecatedString search_engine;
|
||||
if (GUI::InputBox::show(this, search_engine, "Enter URL template:"sv, "Custom Search Engine"sv, "https://host/search?q={}"sv) != GUI::InputBox::ExecResult::OK || search_engine.is_empty()) {
|
||||
if (GUI::InputBox::show(this, search_engine, "Enter URL template:"sv, "Custom Search Engine"sv, "https://host/search?q={}"sv, GUI::InputType::NonemptyText) != GUI::InputBox::ExecResult::OK) {
|
||||
m_disable_search_engine_action->activate();
|
||||
return;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue