From e5e109a556d87aea7b201d923a4967a456829a64 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Tue, 4 Jan 2022 17:33:26 +0100 Subject: [PATCH] LibGUI: Add optional unmodified timestamp to "unsaved changes" dialogs This allows us to show "last saved N seconds ago" when asking the user what to do. :^) --- Userland/Libraries/LibGUI/MessageBox.cpp | 17 ++++++++++++----- Userland/Libraries/LibGUI/MessageBox.h | 5 +++-- 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/Userland/Libraries/LibGUI/MessageBox.cpp b/Userland/Libraries/LibGUI/MessageBox.cpp index cfb967a06a..9f395762b9 100644 --- a/Userland/Libraries/LibGUI/MessageBox.cpp +++ b/Userland/Libraries/LibGUI/MessageBox.cpp @@ -27,15 +27,22 @@ int MessageBox::show_error(Window* parent_window, StringView text) return show(parent_window, text, "Error", GUI::MessageBox::Type::Error, GUI::MessageBox::InputType::OK); } -int MessageBox::ask_about_unsaved_changes(Window* parent_window, StringView path) +int MessageBox::ask_about_unsaved_changes(Window* parent_window, StringView path, Optional