diff options
author | Andreas Kling <kling@serenityos.org> | 2022-01-04 17:34:10 +0100 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2022-01-04 21:49:44 +0100 |
commit | 7178c39a78003404493bfd31197986708f8ef469 (patch) | |
tree | 2cdb27a12ea3fb2aac68b497343707fc8199d20e /Userland/Applications/TextEditor | |
parent | e5e109a556d87aea7b201d923a4967a456829a64 (diff) | |
download | serenity-7178c39a78003404493bfd31197986708f8ef469.zip |
TextEditor: Show time-since-last-save in "unsaved changes" dialogs :^)
Diffstat (limited to 'Userland/Applications/TextEditor')
-rw-r--r-- | Userland/Applications/TextEditor/MainWidget.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Userland/Applications/TextEditor/MainWidget.cpp b/Userland/Applications/TextEditor/MainWidget.cpp index d8ca9fc1f4..21dad0c640 100644 --- a/Userland/Applications/TextEditor/MainWidget.cpp +++ b/Userland/Applications/TextEditor/MainWidget.cpp @@ -252,7 +252,7 @@ MainWidget::MainWidget() m_new_action = GUI::Action::create("&New", { Mod_Ctrl, Key_N }, Gfx::Bitmap::try_load_from_file("/res/icons/16x16/new.png").release_value_but_fixme_should_propagate_errors(), [this](GUI::Action const&) { if (editor().document().is_modified()) { - auto save_document_first_result = GUI::MessageBox::ask_about_unsaved_changes(window(), m_path); + auto save_document_first_result = GUI::MessageBox::ask_about_unsaved_changes(window(), m_path, editor().document().undo_stack().last_unmodified_timestamp()); if (save_document_first_result == GUI::Dialog::ExecResult::ExecYes) m_save_action->activate(); if (save_document_first_result != GUI::Dialog::ExecResult::ExecNo && editor().document().is_modified()) @@ -274,7 +274,7 @@ MainWidget::MainWidget() } if (editor().document().is_modified()) { - auto save_document_first_result = GUI::MessageBox::ask_about_unsaved_changes(window(), m_path); + auto save_document_first_result = GUI::MessageBox::ask_about_unsaved_changes(window(), m_path, editor().document().undo_stack().last_unmodified_timestamp()); if (save_document_first_result == GUI::Dialog::ExecResult::ExecYes) m_save_action->activate(); if (save_document_first_result != GUI::Dialog::ExecResult::ExecNo && editor().document().is_modified()) @@ -719,7 +719,7 @@ bool MainWidget::request_close() { if (!editor().document().is_modified()) return true; - auto result = GUI::MessageBox::ask_about_unsaved_changes(window(), m_path); + auto result = GUI::MessageBox::ask_about_unsaved_changes(window(), m_path, editor().document().undo_stack().last_unmodified_timestamp()); if (result == GUI::MessageBox::ExecYes) { m_save_action->activate(); |