1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-28 20:57:44 +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:
Karol Baraniecki 2022-12-30 00:06:01 +01:00 committed by Andrew Kaster
parent 55dbfd24c0
commit 8095d9276b
9 changed files with 13 additions and 14 deletions

View file

@ -119,8 +119,7 @@ ContentFilterSettingsWidget::ContentFilterSettingsWidget()
m_add_new_domain_button->on_click = [&](unsigned) {
DeprecatedString text;
if (GUI::InputBox::show(window(), text, "Enter domain name"sv, "Add domain to Content Filter"sv) == GUI::Dialog::ExecResult::OK
&& !text.is_empty()) {
if (GUI::InputBox::show(window(), text, "Enter domain name"sv, "Add domain to Content Filter"sv, {}, GUI::InputType::NonemptyText) == GUI::Dialog::ExecResult::OK) {
m_domain_list_model->add_domain(move(text));
set_modified(true);
}