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
Notes: sideshowbarker 2024-07-18 15:19:55 +09:00

View file

@ -127,7 +127,8 @@ void KeyboardMapperWidget::load_from_file(String filename)
{
auto result = Keyboard::CharacterMapFile::load_from_file(filename);
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;
}