mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-26 01:20:25 +00:00
GMLPlayground: Use current file name in the 'Save as...' dialog
Previously it was always "Untitled".
This commit is contained in:
parent
23ac52bc80
commit
e7954f62b3
Notes:
sideshowbarker
2024-07-17 04:09:56 +09:00
Author: https://github.com/krkk Commit: https://github.com/SerenityOS/serenity/commit/e7954f62b3 Pull-request: https://github.com/SerenityOS/serenity/pull/18747 Reviewed-by: https://github.com/AtkinsSJ
1 changed files with 3 additions and 1 deletions
|
@ -9,6 +9,7 @@
|
|||
*/
|
||||
|
||||
#include "MainWidget.h"
|
||||
#include <AK/LexicalPath.h>
|
||||
#include <LibDesktop/Launcher.h>
|
||||
#include <LibFileSystemAccessClient/Client.h>
|
||||
#include <LibGUI/Application.h>
|
||||
|
@ -123,7 +124,8 @@ ErrorOr<void> MainWidget::initialize_menubar(GUI::Window& window)
|
|||
auto file_menu = TRY(window.try_add_menu("&File"_short_string));
|
||||
|
||||
auto save_as_action = GUI::CommonActions::make_save_as_action([&](auto&) {
|
||||
auto response = FileSystemAccessClient::Client::the().save_file(&window, "Untitled", "gml");
|
||||
LexicalPath initial_path(m_file_path.is_empty() ? "Untitled.gml" : m_file_path);
|
||||
auto response = FileSystemAccessClient::Client::the().save_file(&window, initial_path.title(), initial_path.extension());
|
||||
if (response.is_error())
|
||||
return;
|
||||
|
||||
|
|
Loading…
Reference in a new issue