mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 14:57:35 +00:00
TextEditor/GMLPlayground: Don't close app if user aborts save on exit
This commit is contained in:
parent
a7d3709e1c
commit
9720261540
2 changed files with 4 additions and 0 deletions
|
@ -672,6 +672,8 @@ bool MainWidget::request_close()
|
||||||
|
|
||||||
if (result == GUI::MessageBox::ExecYes) {
|
if (result == GUI::MessageBox::ExecYes) {
|
||||||
m_save_action->activate();
|
m_save_action->activate();
|
||||||
|
if (editor().document().is_modified())
|
||||||
|
return false;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -251,6 +251,8 @@ int main(int argc, char** argv)
|
||||||
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::show(window, "The document has been modified. Would you like to save?", "Unsaved changes", GUI::MessageBox::Type::Warning, GUI::MessageBox::InputType::YesNoCancel);
|
||||||
if (result == GUI::MessageBox::ExecYes) {
|
if (result == GUI::MessageBox::ExecYes) {
|
||||||
save_action->activate();
|
save_action->activate();
|
||||||
|
if (window->is_modified())
|
||||||
|
return GUI::Window::CloseRequestDecision::StayOpen;
|
||||||
return GUI::Window::CloseRequestDecision::Close;
|
return GUI::Window::CloseRequestDecision::Close;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue