From 219339d2a56df4604dc91966b1f38d25199b73fa Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Tue, 4 Jan 2022 18:04:28 +0100 Subject: [PATCH] FontEditor: Use GUI::MessageBox::ask_about_unsaved_changes() --- Userland/Applications/FontEditor/FontEditor.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Userland/Applications/FontEditor/FontEditor.cpp b/Userland/Applications/FontEditor/FontEditor.cpp index 1431df911d..03bcd8b6e9 100644 --- a/Userland/Applications/FontEditor/FontEditor.cpp +++ b/Userland/Applications/FontEditor/FontEditor.cpp @@ -613,6 +613,7 @@ bool FontEditorWidget::save_as(String const& path) return false; } m_path = path; + m_undo_stack->set_current_unmodified(); window()->set_modified(false); update_title(); return true; @@ -686,7 +687,7 @@ bool FontEditorWidget::request_close() { if (!window()->is_modified()) return true; - auto result = GUI::MessageBox::show(window(), "Save changes to the current font?", "Unsaved changes", GUI::MessageBox::Type::Warning, GUI::MessageBox::InputType::YesNoCancel); + auto result = GUI::MessageBox::ask_about_unsaved_changes(window(), m_path, m_undo_stack->last_unmodified_timestamp()); if (result == GUI::MessageBox::ExecYes) { m_save_action->activate(); if (!window()->is_modified())