PixelPaint: Only prompt for unsaved changes if there any

Previously MainWidget::request_close() would always put up the
message box asking to save unsaved changes, even if there aren't any.
This patch makes it so that the message box is only shown if the
undo stack is in a modified state.
This commit is contained in:
Mustafa Quraish 2022-01-04 20:20:01 -05:00 committed by Andreas Kling
parent 2440d2c2fe
commit 8c4579bced
Notes: sideshowbarker 2024-07-17 21:37:37 +09:00

View file

@ -755,6 +755,10 @@ bool MainWidget::request_close()
VERIFY(current_image_editor());
if (!current_image_editor()->undo_stack().is_current_modified()) {
return true;
}
auto result = GUI::MessageBox::ask_about_unsaved_changes(window(), current_image_editor()->path(), current_image_editor()->undo_stack().last_unmodified_timestamp());
if (result == GUI::MessageBox::ExecYes) {