1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-06-01 10:08:10 +00:00

TextEditor+HexEditor: Warn about unsaved changes after dropping files

This commit is contained in:
Karol Kosek 2022-11-05 16:13:51 +01:00 committed by Sam Atkins
parent 65919bcbb5
commit 6b8d351b40
2 changed files with 4 additions and 0 deletions

View file

@ -573,6 +573,8 @@ void HexEditorWidget::drop_event(GUI::DropEvent& event)
if (urls.is_empty())
return;
window()->move_to_front();
if (!request_close())
return;
// TODO: A drop event should be considered user consent for opening a file
auto response = FileSystemAccessClient::Client::the().try_request_file(window(), urls.first().path(), Core::OpenMode::ReadOnly);