mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-11 01:06:01 +03:00
TextEditor+HexEditor: Warn about unsaved changes after dropping files
This commit is contained in:
parent
65919bcbb5
commit
6b8d351b40
Notes:
sideshowbarker
2024-07-17 04:43:16 +09:00
Author: https://github.com/krkk Commit: https://github.com/SerenityOS/serenity/commit/6b8d351b40 Pull-request: https://github.com/SerenityOS/serenity/pull/15940
@ -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);
|
||||
|
@ -761,6 +761,8 @@ void MainWidget::drop_event(GUI::DropEvent& event)
|
||||
GUI::MessageBox::show(window(), "TextEditor can only open one file at a time!"sv, "One at a time please!"sv, GUI::MessageBox::Type::Error);
|
||||
return;
|
||||
}
|
||||
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);
|
||||
|
Loading…
Reference in New Issue
Block a user