From 3132ce1d36ff9350fc1bbf83d502b0c5a94ef423 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Babiarz?= <5783815+sauler@users.noreply.github.com> Date: Wed, 5 Jan 2022 22:43:24 +0100 Subject: [PATCH] LibGUI: Show hours and minutes in "unsaved changes" dialogs --- Userland/Libraries/LibGUI/MessageBox.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Userland/Libraries/LibGUI/MessageBox.cpp b/Userland/Libraries/LibGUI/MessageBox.cpp index 1c91b7fd7d..6dde5e0657 100644 --- a/Userland/Libraries/LibGUI/MessageBox.cpp +++ b/Userland/Libraries/LibGUI/MessageBox.cpp @@ -5,6 +5,7 @@ */ #include +#include #include #include #include @@ -39,7 +40,8 @@ int MessageBox::ask_about_unsaved_changes(Window* parent_window, StringView path if (!path.is_empty() && last_unmodified_timestamp.has_value()) { auto age = (Time::now_monotonic() - *last_unmodified_timestamp).to_seconds(); - builder.appendff("\nLast saved {} second{} ago.", age, age == 1 ? "" : "s"); + auto readable_time = human_readable_time(age); + builder.appendff("\nLast saved {} ago.", readable_time); } auto box = MessageBox::construct(parent_window, builder.string_view(), "Unsaved changes", Type::Warning, InputType::YesNoCancel);