1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 16:27:35 +00:00

KeyboardMapper: Add GUI alert in case load from file fails

Previously there was no visual clue letting the user know that loading
from file failed.
This commit is contained in:
NonStdModel 2021-06-04 20:19:01 +02:00 committed by Linus Groh
parent b9980ffd07
commit 484ec94624

View file

@ -127,7 +127,8 @@ void KeyboardMapperWidget::load_from_file(String filename)
{ {
auto result = Keyboard::CharacterMapFile::load_from_file(filename); auto result = Keyboard::CharacterMapFile::load_from_file(filename);
if (!result.has_value()) { if (!result.has_value()) {
dbgln("Failed to load character map from file {}", filename); auto error_message = String::formatted("Failed to load character map from file {}", filename);
GUI::MessageBox::show(window(), error_message, "Error", GUI::MessageBox::Type::Error);
return; return;
} }