summaryrefslogtreecommitdiff
path: root/Userland
diff options
context:
space:
mode:
authorJunior Rantila <junior.rantila@gmail.com>2021-12-29 22:07:30 +0100
committerAndreas Kling <kling@serenityos.org>2022-01-06 18:20:07 +0100
commite114e2e66d6ecc696b593c59ea85967c77120d07 (patch)
treeabf4823558d3b7d8ce753c0c3f58d1d3f9889fc2 /Userland
parent9a2aad9ecadebe5ee703f44eec996bf58874596f (diff)
downloadserenity-e114e2e66d6ecc696b593c59ea85967c77120d07.zip
ImageViewer: Show error if wallpaper could not be set
Diffstat (limited to 'Userland')
-rw-r--r--Userland/Applications/ImageViewer/main.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/Userland/Applications/ImageViewer/main.cpp b/Userland/Applications/ImageViewer/main.cpp
index 4795dabeac..f77107f7c6 100644
--- a/Userland/Applications/ImageViewer/main.cpp
+++ b/Userland/Applications/ImageViewer/main.cpp
@@ -171,7 +171,13 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
auto desktop_wallpaper_action = GUI::Action::create("Set as Desktop &Wallpaper",
[&](auto&) {
- GUI::Desktop::the().set_wallpaper(widget->path());
+ auto could_set_wallpaper = GUI::Desktop::the().set_wallpaper(widget->path());
+ if (!could_set_wallpaper) {
+ GUI::MessageBox::show(window,
+ String::formatted("set_wallpaper({}) failed", widget->path()),
+ "Could not set wallpaper",
+ GUI::MessageBox::Type::Error);
+ }
});
auto go_first_action = GUI::Action::create("&Go to First", { Mod_None, Key_Home }, TRY(Gfx::Bitmap::try_load_from_file("/res/icons/16x16/go-first.png")),