mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 08:37:45 +00:00
ThemeEditor: Warn about unsaved changes on file open
This commit is contained in:
parent
6b8d351b40
commit
9805cdeaf5
1 changed files with 2 additions and 0 deletions
|
@ -208,6 +208,8 @@ ErrorOr<void> MainWidget::initialize_menubar(GUI::Window& window)
|
||||||
{
|
{
|
||||||
auto file_menu = TRY(window.try_add_menu("&File"));
|
auto file_menu = TRY(window.try_add_menu("&File"));
|
||||||
TRY(file_menu->try_add_action(GUI::CommonActions::make_open_action([&](auto&) {
|
TRY(file_menu->try_add_action(GUI::CommonActions::make_open_action([&](auto&) {
|
||||||
|
if (request_close() == GUI::Window::CloseRequestDecision::StayOpen)
|
||||||
|
return;
|
||||||
auto response = FileSystemAccessClient::Client::the().try_open_file(&window, "Select theme file", "/res/themes"sv);
|
auto response = FileSystemAccessClient::Client::the().try_open_file(&window, "Select theme file", "/res/themes"sv);
|
||||||
if (response.is_error())
|
if (response.is_error())
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue