From f4aba71fc137709757549a591661ab307a81af7a Mon Sep 17 00:00:00 2001 From: Karol Kosek Date: Sat, 16 Jul 2022 09:42:26 +0200 Subject: [PATCH] PixelPaint: Export images using the editor title as a default basename --- Userland/Applications/PixelPaint/MainWidget.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Userland/Applications/PixelPaint/MainWidget.cpp b/Userland/Applications/PixelPaint/MainWidget.cpp index b1fe758fe2..351719a5ef 100644 --- a/Userland/Applications/PixelPaint/MainWidget.cpp +++ b/Userland/Applications/PixelPaint/MainWidget.cpp @@ -171,7 +171,7 @@ void MainWidget::initialize_menubar(GUI::Window& window) "As &BMP", [&](auto&) { auto* editor = current_image_editor(); VERIFY(editor); - auto response = FileSystemAccessClient::Client::the().try_save_file(&window, "untitled", "bmp"); + auto response = FileSystemAccessClient::Client::the().try_save_file(&window, editor->title(), "bmp"); if (response.is_error()) return; auto preserve_alpha_channel = GUI::MessageBox::show(&window, "Do you wish to preserve transparency?"sv, "Preserve transparency?"sv, GUI::MessageBox::Type::Question, GUI::MessageBox::InputType::YesNo); @@ -186,7 +186,7 @@ void MainWidget::initialize_menubar(GUI::Window& window) auto* editor = current_image_editor(); VERIFY(editor); // TODO: fix bmp on line below? - auto response = FileSystemAccessClient::Client::the().try_save_file(&window, "untitled", "png"); + auto response = FileSystemAccessClient::Client::the().try_save_file(&window, editor->title(), "png"); if (response.is_error()) return; auto preserve_alpha_channel = GUI::MessageBox::show(&window, "Do you wish to preserve transparency?"sv, "Preserve transparency?"sv, GUI::MessageBox::Type::Question, GUI::MessageBox::InputType::YesNo); @@ -200,7 +200,7 @@ void MainWidget::initialize_menubar(GUI::Window& window) "As &QOI", [&](auto&) { auto* editor = current_image_editor(); VERIFY(editor); - auto response = FileSystemAccessClient::Client::the().try_save_file(&window, "untitled", "qoi"); + auto response = FileSystemAccessClient::Client::the().try_save_file(&window, editor->title(), "qoi"); if (response.is_error()) return; auto result = editor->image().export_qoi_to_file(response.value());