1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-28 14:15:07 +00:00

TextEditor: Quit after saving unsaved changes on close event.

This commit is contained in:
Oriko 2020-03-10 15:23:28 +02:00 committed by Andreas Kling
parent 2af94bbf48
commit 75672263ce

View file

@ -485,8 +485,10 @@ bool TextEditorWidget::request_close()
return true;
auto result = GUI::MessageBox::show("The document has been modified. Would you like to save?", "Unsaved changes", GUI::MessageBox::Type::Warning, GUI::MessageBox::InputType::YesNoCancel, window());
if (result == GUI::MessageBox::ExecYes)
if (result == GUI::MessageBox::ExecYes) {
m_save_action->activate();
return true;
}
if (result == GUI::MessageBox::ExecNo)
return true;