summaryrefslogtreecommitdiff
path: root/Userland/DevTools
diff options
context:
space:
mode:
authorKarol Kosek <krkk@serenityos.org>2023-05-09 17:03:10 +0200
committerSam Atkins <atkinssj@gmail.com>2023-05-16 12:57:34 +0100
commite7954f62b325c54463485b4e1ee4144b68002d4b (patch)
treeba4519687774b2e5cc1b04bb87d5b1decf4300e3 /Userland/DevTools
parent23ac52bc80fb3d82542664a27325a9a7e7b474e0 (diff)
downloadserenity-e7954f62b325c54463485b4e1ee4144b68002d4b.zip
GMLPlayground: Use current file name in the 'Save as...' dialog
Previously it was always "Untitled".
Diffstat (limited to 'Userland/DevTools')
-rw-r--r--Userland/DevTools/GMLPlayground/MainWidget.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/Userland/DevTools/GMLPlayground/MainWidget.cpp b/Userland/DevTools/GMLPlayground/MainWidget.cpp
index ccd6411569..68e85528ab 100644
--- a/Userland/DevTools/GMLPlayground/MainWidget.cpp
+++ b/Userland/DevTools/GMLPlayground/MainWidget.cpp
@@ -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;