mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 20:07:35 +00:00
FontEditor: Use GUI::MessageBox::ask_about_unsaved_changes()
This commit is contained in:
parent
1a54ac262a
commit
219339d2a5
1 changed files with 2 additions and 1 deletions
|
@ -613,6 +613,7 @@ bool FontEditorWidget::save_as(String const& path)
|
|||
return false;
|
||||
}
|
||||
m_path = path;
|
||||
m_undo_stack->set_current_unmodified();
|
||||
window()->set_modified(false);
|
||||
update_title();
|
||||
return true;
|
||||
|
@ -686,7 +687,7 @@ bool FontEditorWidget::request_close()
|
|||
{
|
||||
if (!window()->is_modified())
|
||||
return true;
|
||||
auto result = GUI::MessageBox::show(window(), "Save changes to the current font?", "Unsaved changes", GUI::MessageBox::Type::Warning, GUI::MessageBox::InputType::YesNoCancel);
|
||||
auto result = GUI::MessageBox::ask_about_unsaved_changes(window(), m_path, m_undo_stack->last_unmodified_timestamp());
|
||||
if (result == GUI::MessageBox::ExecYes) {
|
||||
m_save_action->activate();
|
||||
if (!window()->is_modified())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue