diff options
-rw-r--r-- | Userland/DevTools/Playground/main.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Userland/DevTools/Playground/main.cpp b/Userland/DevTools/Playground/main.cpp index d71fb5c876..6946bb41c7 100644 --- a/Userland/DevTools/Playground/main.cpp +++ b/Userland/DevTools/Playground/main.cpp @@ -181,10 +181,10 @@ ErrorOr<int> serenity_main(Main::Arguments arguments) return; if (window->is_modified()) { - auto save_document_first_result = GUI::MessageBox::show(window, "Save changes to current document first?", "Warning", GUI::MessageBox::Type::Warning, GUI::MessageBox::InputType::YesNoCancel); - if (save_document_first_result == GUI::Dialog::ExecResult::ExecYes) + auto result = GUI::MessageBox::ask_about_unsaved_changes(window, file_path, editor->document().undo_stack().last_unmodified_timestamp()); + if (result == GUI::MessageBox::ExecYes) save_action->activate(); - if (save_document_first_result != GUI::Dialog::ExecResult::ExecNo && window->is_modified()) + if (result != GUI::MessageBox::ExecNo && window->is_modified()) return; } @@ -257,7 +257,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments) if (!window->is_modified()) return GUI::Window::CloseRequestDecision::Close; - auto result = GUI::MessageBox::show(window, "The document has been modified. Would you like to save?", "Unsaved changes", GUI::MessageBox::Type::Warning, GUI::MessageBox::InputType::YesNoCancel); + auto result = GUI::MessageBox::ask_about_unsaved_changes(window, file_path, editor->document().undo_stack().last_unmodified_timestamp()); if (result == GUI::MessageBox::ExecYes) { save_action->activate(); if (window->is_modified()) |